diff options
author | Owen Anderson <resistor@mac.com> | 2011-09-14 22:46:14 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2011-09-14 22:46:14 +0000 |
commit | 8adf62034a874adacff158e8adc9438cb3e67c01 (patch) | |
tree | 4efead494eb9f7a4c54c2c8e7adc805cf40cade7 | |
parent | 544e4124fe18804b8adcbb90993bbfa76a090763 (diff) |
Fix a crasher in Thumb2 MOV-immediate encoding for certain inputs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139747 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/ARM/AsmParser/ARMAsmParser.cpp | 2 | ||||
-rw-r--r-- | test/MC/ARM/basic-thumb2-instructions.s | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp index 4314d743b7..59e5e84c7e 100644 --- a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp +++ b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp @@ -3261,7 +3261,7 @@ bool ARMAsmParser::shouldOmitCCOutOperand(StringRef Mnemonic, // We do this as post-processing of the explicit operands rather than just // conditionally adding the cc_out in the first place because we need // to check the type of the parsed immediate operand. - if (Mnemonic == "mov" && Operands.size() > 4 && + if (Mnemonic == "mov" && Operands.size() > 4 && !isThumb() && !static_cast<ARMOperand*>(Operands[4])->isARMSOImm() && static_cast<ARMOperand*>(Operands[4])->isImm0_65535Expr() && static_cast<ARMOperand*>(Operands[1])->getReg() == 0) diff --git a/test/MC/ARM/basic-thumb2-instructions.s b/test/MC/ARM/basic-thumb2-instructions.s index bbc30663ad..5f0ccf12c5 100644 --- a/test/MC/ARM/basic-thumb2-instructions.s +++ b/test/MC/ARM/basic-thumb2-instructions.s @@ -1013,6 +1013,7 @@ _func: movseq r1, #12 moveq r1, #12 movne.w r1, #12 + mov.w r6, #450 @ CHECK: movs r1, #21 @ encoding: [0x15,0x21] @ CHECK: movs.w r1, #21 @ encoding: [0x5f,0xf0,0x15,0x01] @@ -1027,6 +1028,7 @@ _func: @ CHECK: movseq.w r1, #12 @ encoding: [0x5f,0xf0,0x0c,0x01] @ CHECK: moveq r1, #12 @ encoding: [0x0c,0x21] @ CHECK: movne.w r1, #12 @ encoding: [0x4f,0xf0,0x0c,0x01] +@ CHECK: mov.w r6, #450 @ encoding: [0x4f,0xf4,0xe1,0x76] @------------------------------------------------------------------------------ |