diff options
author | Quentin Colombet <qcolombet@apple.com> | 2013-04-26 17:54:54 +0000 |
---|---|---|
committer | Quentin Colombet <qcolombet@apple.com> | 2013-04-26 17:54:54 +0000 |
commit | a83d5e9f9186a71cdd01b6d487e23aa4c97085ec (patch) | |
tree | 06bfe0a5bd3eaf9b93e8bc6ec184b0deed199d39 /llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp | |
parent | 37212578ee5e7f8b014fd49d7797775b788fbd1d (diff) | |
download | bcm5719-llvm-a83d5e9f9186a71cdd01b6d487e23aa4c97085ec.tar.gz bcm5719-llvm-a83d5e9f9186a71cdd01b6d487e23aa4c97085ec.zip |
ARM: Fix encoding of hint instruction for Thumb.
"hint" space for Thumb actually overlaps the encoding space of the CPS
instruction. In actuality, hints can be defined as CPS instructions where imod
and M bits are all nil.
Handle decoding of permitted nop-compatible hints (i.e. nop, yield, wfi, wfe,
sev) in DecodeT2CPSInstruction.
This commit adds a proper diagnostic message for Imm0_4 and updates all tests.
Patch by Mihail Popa <Mihail.Popa@arm.com>.
llvm-svn: 180617
Diffstat (limited to 'llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp index 20468af9a27..114cc9e5c05 100644 --- a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp +++ b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp @@ -7622,6 +7622,11 @@ MatchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode, return Error(IDLoc, "instruction variant requires ARMv6 or later"); case Match_RequiresThumb2: return Error(IDLoc, "instruction variant requires Thumb2"); + case Match_ImmRange0_4: { + SMLoc ErrorLoc = ((ARMOperand*)Operands[ErrorInfo])->getStartLoc(); + if (ErrorLoc == SMLoc()) ErrorLoc = IDLoc; + return Error(ErrorLoc, "immediate operand must be in the range [0,4]"); + } case Match_ImmRange0_15: { SMLoc ErrorLoc = ((ARMOperand*)Operands[ErrorInfo])->getStartLoc(); if (ErrorLoc == SMLoc()) ErrorLoc = IDLoc; |