From: Jim Grosbach Date: Thu, 18 Aug 2011 18:08:29 +0000 (+0000) Subject: Thumb assembly parsing and encoding for CMP. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0d1511c022e78e6d8769290b451b98a3b656de63;p=oota-llvm.git Thumb assembly parsing and encoding for CMP. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137963 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/ARM/ARMInstrThumb.td b/lib/Target/ARM/ARMInstrThumb.td index af502b63c6b..2b047279d21 100644 --- a/lib/Target/ARM/ARMInstrThumb.td +++ b/lib/Target/ARM/ARMInstrThumb.td @@ -910,7 +910,7 @@ def tCMNz : // A8.6.33 // CMP immediate let isCompare = 1, Defs = [CPSR] in { -def tCMPi8 : T1pI<(outs), (ins tGPR:$Rn, i32imm:$imm8), IIC_iCMPi, +def tCMPi8 : T1pI<(outs), (ins tGPR:$Rn, imm0_255:$imm8), IIC_iCMPi, "cmp", "\t$Rn, $imm8", [(ARMcmp tGPR:$Rn, imm0_255:$imm8)]>, T1General<{1,0,1,?,?}> { diff --git a/test/MC/ARM/basic-thumb-instructions.s b/test/MC/ARM/basic-thumb-instructions.s index 1448538d6b1..5ded1fadc82 100644 --- a/test/MC/ARM/basic-thumb-instructions.s +++ b/test/MC/ARM/basic-thumb-instructions.s @@ -144,3 +144,14 @@ _func: @ CHECK: cmn r5, r1 @ encoding: [0xcd,0x42] + +@------------------------------------------------------------------------------ +@ CMP +@------------------------------------------------------------------------------ + cmp r6, #32 + cmp r3, r4 + cmp r8, r1 + +@ CHECK: cmp r6, #32 @ encoding: [0x20,0x2e] +@ CHECK: cmp r3, r4 @ encoding: [0xa3,0x42] +@ CHECK: cmp r8, r1 @ encoding: [0x88,0x45]