[llvm-commits] [llvm] r136098 - in /llvm/trunk: lib/Target/ARM/ARMInstrFormats.td lib/Target/ARM/ARMInstrInfo.td test/MC/ARM/basic-arm-instructions.s
Jim Grosbach
grosbach at apple.com
Tue Jul 26 10:15:11 PDT 2011
Author: grosbach
Date: Tue Jul 26 12:15:11 2011
New Revision: 136098
URL: http://llvm.org/viewvc/llvm-project?rev=136098&view=rev
Log:
ARM assembly parsing and encoding for SWP[B] instructions.
Modified:
llvm/trunk/lib/Target/ARM/ARMInstrFormats.td
llvm/trunk/lib/Target/ARM/ARMInstrInfo.td
llvm/trunk/test/MC/ARM/basic-arm-instructions.s
Modified: llvm/trunk/lib/Target/ARM/ARMInstrFormats.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrFormats.td?rev=136098&r1=136097&r2=136098&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrFormats.td (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrFormats.td Tue Jul 26 12:15:11 2011
@@ -442,14 +442,14 @@
let Inst{3-0} = Rt;
}
class AIswp<bit b, dag oops, dag iops, string opc, list<dag> pattern>
- : AI<oops, iops, MiscFrm, NoItinerary, opc, "\t$Rt, $Rt2, [$Rn]", pattern> {
+ : AI<oops, iops, MiscFrm, NoItinerary, opc, "\t$Rt, $Rt2, $addr", pattern> {
bits<4> Rt;
bits<4> Rt2;
- bits<4> Rn;
+ bits<4> addr;
let Inst{27-23} = 0b00010;
let Inst{22} = b;
let Inst{21-20} = 0b00;
- let Inst{19-16} = Rn;
+ let Inst{19-16} = addr;
let Inst{15-12} = Rt;
let Inst{11-4} = 0b00001001;
let Inst{3-0} = Rt2;
Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.td?rev=136098&r1=136097&r2=136098&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Tue Jul 26 12:15:11 2011
@@ -3659,10 +3659,10 @@
let Inst{31-0} = 0b11110101011111111111000000011111;
}
-// SWP/SWPB are deprecated in V6/V7 and for disassembly only.
+// SWP/SWPB are deprecated in V6/V7.
let mayLoad = 1, mayStore = 1 in {
-def SWP : AIswp<0, (outs GPR:$Rt), (ins GPR:$Rt2, GPR:$Rn), "swp", []>;
-def SWPB : AIswp<1, (outs GPR:$Rt), (ins GPR:$Rt2, GPR:$Rn), "swpb", []>;
+def SWP : AIswp<0, (outs GPR:$Rt), (ins GPR:$Rt2, addrmode7:$addr), "swp", []>;
+def SWPB: AIswp<1, (outs GPR:$Rt), (ins GPR:$Rt2, addrmode7:$addr), "swpb", []>;
}
//===----------------------------------------------------------------------===//
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=136098&r1=136097&r2=136098&view=diff
==============================================================================
--- llvm/trunk/test/MC/ARM/basic-arm-instructions.s (original)
+++ llvm/trunk/test/MC/ARM/basic-arm-instructions.s Tue Jul 26 12:15:11 2011
@@ -1763,3 +1763,15 @@
@ CHECK: svc #16 @ encoding: [0x10,0x00,0x00,0xef]
@ CHECK: svc #0 @ encoding: [0x00,0x00,0x00,0xef]
@ CHECK: svc #16777215 @ encoding: [0xff,0xff,0xff,0xef]
+
+
+ at ------------------------------------------------------------------------------
+@ SWP/SWPB
+ at ------------------------------------------------------------------------------
+ swp r1, r2, [r3]
+ swp r4, r4, [r6]
+ swpb r5, r1, [r9]
+
+@ CHECK: swp r1, r2, [r3] @ encoding: [0x92,0x10,0x03,0xe1]
+@ CHECK: swp r4, r4, [r6] @ encoding: [0x94,0x40,0x06,0xe1]
+@ CHECK: swpb r5, r1, [r9] @ encoding: [0x91,0x50,0x49,0xe1]
More information about the llvm-commits
mailing list