aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2011-07-21 19:57:11 +0000
committerJim Grosbach <grosbach@apple.com>2011-07-21 19:57:11 +0000
commit10c7d70a4e843b3006db9f5f583d6f6f56cc245e (patch)
treeb3e98d26af65192890473a6e8e4d707a870e4d43
parent45e11c7cc78e8a826e224b30a2eba4f1eb664c33 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135702 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/ARM/ARMInstrInfo.td6
-rw-r--r--test/MC/ARM/basic-arm-instructions.s29
2 files changed, 35 insertions, 0 deletions
diff --git a/lib/Target/ARM/ARMInstrInfo.td b/lib/Target/ARM/ARMInstrInfo.td
index a877619a2e..fdc2533fe3 100644
--- a/lib/Target/ARM/ARMInstrInfo.td
+++ b/lib/Target/ARM/ARMInstrInfo.td
@@ -4250,3 +4250,9 @@ def : InstAlias<"pkhbt${p} $Rd, $Rn, $Rm",
(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)>;
diff --git a/test/MC/ARM/basic-arm-instructions.s b/test/MC/ARM/basic-arm-instructions.s
index 968e3f84c0..da4ea0e9f5 100644
--- a/test/MC/ARM/basic-arm-instructions.s
+++ b/test/MC/ARM/basic-arm-instructions.s
@@ -990,6 +990,35 @@ _func:
@ CHECK: pkhtb r2, r2, r3, asr #31 @ encoding: [0xd3,0x2f,0x82,0xe6]
@ CHECK: pkhtb r2, r2, r3, asr #15 @ encoding: [0xd3,0x27,0x82,0xe6]
+@------------------------------------------------------------------------------
+@ FIXME: PLD
+@------------------------------------------------------------------------------
+@------------------------------------------------------------------------------
+@ FIXME: PLI
+@------------------------------------------------------------------------------
+
+
+@------------------------------------------------------------------------------
+@ POP
+@------------------------------------------------------------------------------
+ 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]
+
+
+@------------------------------------------------------------------------------
+@ PUSH
+@------------------------------------------------------------------------------
+ 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*