[llvm-commits] [llvm] r135702 - in /llvm/trunk: lib/Target/ARM/ARMInstrInfo.td test/MC/ARM/basic-arm-instructions.s

Jim Grosbach grosbach at apple.com
Thu Jul 21 12:57:12 PDT 2011


Author: grosbach
Date: Thu Jul 21 14:57:11 2011
New Revision: 135702

URL: http://llvm.org/viewvc/llvm-project?rev=135702&view=rev
Log:
ARM assembly parsing POP/PUSH mnemonics.

Aliases for LDM/STM. The single-register versions should encode to LDR/STR
with writeback, but we don't (yet) get that correct. Neither does Darwin's
system assembler, though, so that's not a deal-breaker of a limitation.

Modified:
    llvm/trunk/lib/Target/ARM/ARMInstrInfo.td
    llvm/trunk/test/MC/ARM/basic-arm-instructions.s

Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.td?rev=135702&r1=135701&r2=135702&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Thu Jul 21 14:57:11 2011
@@ -4250,3 +4250,9 @@
                 (PKHBT GPR:$Rd, GPR:$Rn, GPR:$Rm, 0, pred:$p)>;
 def : InstAlias<"pkhtb${p} $Rd, $Rn, $Rm",
                 (PKHBT GPR:$Rd, GPR:$Rn, GPR:$Rm, 0, pred:$p)>;
+
+// PUSH/POP aliases for STM/LDM
+def : InstAlias<"push${p} $regs",
+                (STMDB_UPD SP, pred:$p, reglist:$regs)>;
+def : InstAlias<"pop${p} $regs",
+                (LDMIA_UPD SP, pred:$p, reglist:$regs)>;

Modified: llvm/trunk/test/MC/ARM/basic-arm-instructions.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ARM/basic-arm-instructions.s?rev=135702&r1=135701&r2=135702&view=diff
==============================================================================
--- llvm/trunk/test/MC/ARM/basic-arm-instructions.s (original)
+++ llvm/trunk/test/MC/ARM/basic-arm-instructions.s Thu Jul 21 14:57:11 2011
@@ -990,6 +990,35 @@
 @ CHECK: pkhtb	r2, r2, r3, asr #31     @ encoding: [0xd3,0x2f,0x82,0xe6]
 @ CHECK: pkhtb	r2, r2, r3, asr #15     @ encoding: [0xd3,0x27,0x82,0xe6]
 
+ at ------------------------------------------------------------------------------
+@ FIXME: PLD
+ at ------------------------------------------------------------------------------
+ at ------------------------------------------------------------------------------
+@ FIXME: PLI
+ at ------------------------------------------------------------------------------
+
+
+ at ------------------------------------------------------------------------------
+@ POP
+ at ------------------------------------------------------------------------------
+        pop {r7}
+        pop {r7, r8, r9, r10}
+
+@ FIXME: pop of a single register should encode as "ldr r7, [sp], #4"
+@ CHECK-FIXME: pop	{r7}                    @ encoding: [0x04,0x70,0x9d,0xe4]
+@ CHECK: pop	{r7, r8, r9, r10}       @ encoding: [0x80,0x07,0xbd,0xe8]
+
+
+ at ------------------------------------------------------------------------------
+@ PUSH
+ at ------------------------------------------------------------------------------
+        push {r7}
+        push {r7, r8, r9, r10}
+
+@ FIXME: push of a single register should encode as "str r7, [sp, #-4]!"
+@ CHECK-FIXME: push	{r7}                    @ encoding: [0x04,0x70,0x2d,0xe5]
+@ CHECK: push	{r7, r8, r9, r10}       @ encoding: [0x80,0x07,0x2d,0xe9]
+
 
 @------------------------------------------------------------------------------
 @ STM*





More information about the llvm-commits mailing list