Skip to content

Commit 6ed3845

Browse files
author
Jim Grosbach
committed
Thumb2 t2LDMDB[_UPD] assembly parsing to recognize .w suffix.
rdar://10348844 llvm-svn: 143110
1 parent f7a89d0 commit 6ed3845

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

llvm/lib/Target/ARM/ARMInstrThumb2.td

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3944,6 +3944,12 @@ def : t2InstAlias<"push${p} $regs", (t2STMDB_UPD SP, pred:$p, reglist:$regs)>;
39443944
def : t2InstAlias<"pop${p}.w $regs", (t2LDMIA_UPD SP, pred:$p, reglist:$regs)>;
39453945
def : t2InstAlias<"pop${p} $regs", (t2LDMIA_UPD SP, pred:$p, reglist:$regs)>;
39463946

3947+
// LDMDB/LDMDB_UPD aliases w/ the optional .w suffix
3948+
def : t2InstAlias<"ldmdb${p}.w $Rn, $regs",
3949+
(t2LDMDB GPR:$Rn, pred:$p, reglist:$regs)>;
3950+
def : t2InstAlias<"ldmdb${p}.w $Rn!, $regs",
3951+
(t2LDMDB_UPD GPR:$Rn, pred:$p, reglist:$regs)>;
3952+
39473953
// Alias for REV/REV16/REVSH without the ".w" optional width specifier.
39483954
def : t2InstAlias<"rev${p} $Rd, $Rm", (t2REV rGPR:$Rd, rGPR:$Rm, pred:$p)>;
39493955
def : t2InstAlias<"rev16${p} $Rd, $Rm", (t2REV16 rGPR:$Rd, rGPR:$Rm, pred:$p)>;

llvm/test/MC/ARM/basic-thumb2-instructions.s

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,11 +599,15 @@ _func:
599599
ldmdb r4, {r5, r6}
600600
ldmdb r5!, {r3, r8}
601601
ldmea r5!, {r3, r8}
602+
ldmdb.w r4, {r5, r6}
603+
ldmdb.w r5!, {r3, r8}
602604

603605
@ CHECK: ldmdb r4, {r4, r5, r8, r9} @ encoding: [0x14,0xe9,0x30,0x03]
604606
@ CHECK: ldmdb r4, {r5, r6} @ encoding: [0x14,0xe9,0x60,0x00]
605607
@ CHECK: ldmdb r5!, {r3, r8} @ encoding: [0x35,0xe9,0x08,0x01]
606608
@ CHECK: ldmdb r5!, {r3, r8} @ encoding: [0x35,0xe9,0x08,0x01]
609+
@ CHECK: ldmdb r4, {r5, r6} @ encoding: [0x14,0xe9,0x60,0x00]
610+
@ CHECK: ldmdb r5!, {r3, r8} @ encoding: [0x35,0xe9,0x08,0x01]
607611

608612

609613
@------------------------------------------------------------------------------

0 commit comments

Comments
 (0)