[mips][ias] Range check uimm2 operands and fix a bug this revealed.
authorDaniel Sanders <daniel.sanders@imgtec.com>
Fri, 6 Nov 2015 12:22:31 +0000 (12:22 +0000)
committerDaniel Sanders <daniel.sanders@imgtec.com>
Fri, 6 Nov 2015 12:22:31 +0000 (12:22 +0000)
commitf5ed626e96b8c0f0abe986e7730dfb95c5edf66b
tree31051dc6fd7d50d6b6db5f5996eb880b7e8260d3
parentb08deab89592720d68c8520fb00f2a9b400d52e3
[mips][ias] Range check uimm2 operands and fix a bug this revealed.

Summary:
The bug was that the MIPS32R6/MIPS64R6/microMIPS32R6 versions of LSA and DLSA
(unlike the MSA version) failed to account for the off-by-one encoding of the
immediate. The range is actually 1..4 rather than 0..3.

Reviewers: vkalintiris

Subscribers: atanasyan, dsanders, llvm-commits

Differential Revision: http://reviews.llvm.org/D14015

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252295 91177308-0d34-0410-b5e6-96231b3b80d8
23 files changed:
lib/Target/Mips/AsmParser/MipsAsmParser.cpp
lib/Target/Mips/Disassembler/MipsDisassembler.cpp
lib/Target/Mips/MCTargetDesc/MipsMCCodeEmitter.cpp
lib/Target/Mips/MCTargetDesc/MipsMCCodeEmitter.h
lib/Target/Mips/MicroMips32r6InstrInfo.td
lib/Target/Mips/Mips32r6InstrInfo.td
lib/Target/Mips/Mips64r6InstrInfo.td
lib/Target/Mips/MipsInstrInfo.td
lib/Target/Mips/MipsMSAInstrInfo.td
test/MC/Disassembler/Mips/micromips32r6/valid.txt
test/MC/Disassembler/Mips/mips32r6/valid-mips32r6-el.txt
test/MC/Disassembler/Mips/mips32r6/valid-mips32r6.txt
test/MC/Disassembler/Mips/mips64r6/valid-mips64r6-el.txt
test/MC/Disassembler/Mips/mips64r6/valid-mips64r6.txt
test/MC/Mips/micromips32r6/invalid.s
test/MC/Mips/micromips32r6/valid.s
test/MC/Mips/micromips64r6/invalid.s
test/MC/Mips/mips32r6/invalid.s
test/MC/Mips/mips32r6/valid.s
test/MC/Mips/mips64r6/invalid.s
test/MC/Mips/mips64r6/valid.s
test/MC/Mips/msa/invalid-64.s
test/MC/Mips/msa/invalid.s