[llvm] r186682 - ARM: Add instruction aliases for the Thumb2 PLD/PLDW (literal) alternate form.

Tilmann Scheller tilmann.scheller at googlemail.com
Fri Jul 19 09:18:57 PDT 2013


Author: tilmann
Date: Fri Jul 19 11:18:56 2013
New Revision: 186682

URL: http://llvm.org/viewvc/llvm-project?rev=186682&view=rev
Log:
ARM: Add instruction aliases for the Thumb2 PLD/PLDW (literal) alternate form.

See A8.8.127 in ARM DDI 0406C.b.

Related to <rdar://problem/14403733>.


Added:
    llvm/trunk/test/MC/ARM/thumb2-pldw.s
Modified:
    llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td
    llvm/trunk/test/MC/ARM/basic-thumb2-instructions.s

Modified: llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td?rev=186682&r1=186681&r2=186682&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td Fri Jul 19 11:18:56 2013
@@ -4428,7 +4428,12 @@ def : t2InstAlias<"ldrsh${p}.w $Rt, $add
 def : t2InstAlias<"add${p} $Rd, pc, $imm",
                   (t2ADR rGPR:$Rd, imm0_4095:$imm, pred:$p)>;
 
-// PLI with alternate literal form.
+// PLD/PLDW/PLI with alternate literal form.
+def : t2InstAlias<"pld${p} $addr",
+                  (t2PLDpci t2ldr_pcrel_imm12:$addr, pred:$p)>;
+def : InstAlias<"pldw${p} $addr",
+                 (t2PLDWpci  t2ldr_pcrel_imm12:$addr, pred:$p)>,
+      Requires<[IsThumb2,HasV7,HasMP]>;
 def : InstAlias<"pli${p} $addr",
                  (t2PLIpci  t2ldr_pcrel_imm12:$addr, pred:$p)>,
       Requires<[IsThumb2,HasV7]>;

Modified: llvm/trunk/test/MC/ARM/basic-thumb2-instructions.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ARM/basic-thumb2-instructions.s?rev=186682&r1=186681&r2=186682&view=diff
==============================================================================
--- llvm/trunk/test/MC/ARM/basic-thumb2-instructions.s (original)
+++ llvm/trunk/test/MC/ARM/basic-thumb2-instructions.s Fri Jul 19 11:18:56 2013
@@ -1573,6 +1573,9 @@ _func:
 @ FIXME: pld	_foo                    @ encoding: [0x9f'A',0xf8'A',A,0xf0'A']
             @   fixup A - offset: 0, value: _foo, kind: fixup_t2_ldst_pcrel_12
 
+        pld [pc,#-4095]
+@ CHECK: pld [pc, #-4095]            @ encoding: [0x1f,0xf8,0xff,0xff]
+
 
 @------------------------------------------------------------------------------
 @ PLD(register)

Added: llvm/trunk/test/MC/ARM/thumb2-pldw.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ARM/thumb2-pldw.s?rev=186682&view=auto
==============================================================================
--- llvm/trunk/test/MC/ARM/thumb2-pldw.s (added)
+++ llvm/trunk/test/MC/ARM/thumb2-pldw.s Fri Jul 19 11:18:56 2013
@@ -0,0 +1,7 @@
+@ RUN: llvm-mc -triple=thumbv7-apple-darwin -mcpu=cortex-a8 -mattr=+mp -show-encoding < %s | FileCheck %s
+
+ at ------------------------------------------------------------------------------
+@ PLD(literal)
+ at ------------------------------------------------------------------------------
+        pldw [pc,#-4095]
+@ CHECK: pldw [pc, #-4095]            @ encoding: [0x3f,0xf8,0xff,0xff]





More information about the llvm-commits mailing list