[llvm-commits] [llvm] r139747 - in /llvm/trunk: lib/Target/ARM/AsmParser/ARMAsmParser.cpp test/MC/ARM/basic-thumb2-instructions.s
Owen Anderson
resistor at mac.com
Wed Sep 14 15:46:14 PDT 2011
Author: resistor
Date: Wed Sep 14 17:46:14 2011
New Revision: 139747
URL: http://llvm.org/viewvc/llvm-project?rev=139747&view=rev
Log:
Fix a crasher in Thumb2 MOV-immediate encoding for certain inputs.
Modified:
llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
llvm/trunk/test/MC/ARM/basic-thumb2-instructions.s
Modified: llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp?rev=139747&r1=139746&r2=139747&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp Wed Sep 14 17:46:14 2011
@@ -3261,7 +3261,7 @@
// 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)
Modified: llvm/trunk/test/MC/ARM/basic-thumb2-instructions.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ARM/basic-thumb2-instructions.s?rev=139747&r1=139746&r2=139747&view=diff
==============================================================================
--- llvm/trunk/test/MC/ARM/basic-thumb2-instructions.s (original)
+++ llvm/trunk/test/MC/ARM/basic-thumb2-instructions.s Wed Sep 14 17:46:14 2011
@@ -1013,6 +1013,7 @@
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 @@
@ 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]
@------------------------------------------------------------------------------
More information about the llvm-commits
mailing list