[llvm] r175404 - [XCore] Add missing u10 / lu10 instructions.
Richard Osborne
richard at xmos.com
Sun Feb 17 12:44:48 PST 2013
Author: friedgold
Date: Sun Feb 17 14:44:48 2013
New Revision: 175404
URL: http://llvm.org/viewvc/llvm-project?rev=175404&view=rev
Log:
[XCore] Add missing u10 / lu10 instructions.
These instructions are not targeted by the compiler but they are
needed for the MC layer.
Modified:
llvm/trunk/lib/Target/XCore/XCoreInstrInfo.td
llvm/trunk/test/MC/Disassembler/XCore/xcore.txt
Modified: llvm/trunk/lib/Target/XCore/XCoreInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreInstrInfo.td?rev=175404&r1=175403&r2=175404&view=diff
==============================================================================
--- llvm/trunk/lib/Target/XCore/XCoreInstrInfo.td (original)
+++ llvm/trunk/lib/Target/XCore/XCoreInstrInfo.td Sun Feb 17 14:44:48 2013
@@ -661,7 +661,6 @@ let Uses = [SP], Defs = [SP], mayLoad =
defm KRESTSP : FU6_LU6_np<0b0111101111, "krestsp">;
// U10
-// TODO ldwcpl, blacp
let Defs = [R11], isReMaterializable = 1, neverHasSideEffects = 1 in
def LDAPF_u10 : _FU10<0b110110, (outs), (ins i32imm:$a), "ldap r11, $a", []>;
@@ -677,6 +676,10 @@ def LDAPF_lu10_ba : _FLU10<0b110110, (ou
let isCall=1,
// All calls clobber the link register and the non-callee-saved registers:
Defs = [R0, R1, R2, R3, R11, LR], Uses = [SP] in {
+def BLACP_u10 : _FU10<0b111000, (outs), (ins i32imm:$a), "bla cp[$a]", []>;
+
+def BLACP_lu10 : _FLU10<0b111000, (outs), (ins i32imm:$a), "bla cp[$a]", []>;
+
def BLRF_u10 : _FU10<0b110100, (outs), (ins calltarget:$a), "bl $a",
[(XCoreBranchLink immU10:$a)]>;
@@ -684,6 +687,14 @@ def BLRF_lu10 : _FLU10<0b110100, (outs),
[(XCoreBranchLink immU20:$a)]>;
}
+let Defs = [R11], mayLoad = 1, isReMaterializable = 1,
+ neverHasSideEffects = 1 in {
+def LDWCP_u10 : _FU10<0b111001, (outs), (ins i32imm:$a), "ldw r11, cp[$a]", []>;
+
+def LDWCP_lu10 : _FLU10<0b111001, (outs), (ins i32imm:$a), "ldw r11, cp[$a]",
+ []>;
+}
+
// Two operand short
// TODO eet, eef, tsetmr
def NOT : _F2R<0b100010, (outs GRRegs:$dst), (ins GRRegs:$b),
Modified: llvm/trunk/test/MC/Disassembler/XCore/xcore.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Disassembler/XCore/xcore.txt?rev=175404&r1=175403&r2=175404&view=diff
==============================================================================
--- llvm/trunk/test/MC/Disassembler/XCore/xcore.txt (original)
+++ llvm/trunk/test/MC/Disassembler/XCore/xcore.txt Sun Feb 17 14:44:48 2013
@@ -589,6 +589,18 @@
# CHECK: bl 38631
0x25 0xf0 0xe7 0xd2
+# CHECK: bla cp[500]
+0xf4 0xe1
+
+# CHECK: bla cp[413742]
+0x94 0xf1 0x2e 0xe0
+
+# CHECK: ldw r11, cp[132]
+0x84 0xe4
+
+# CHECK: ldw r11, cp[3444]
+0x35 0xf0 0xf4 0x6e
+
# l6r instructions
# CHECK: lmul r11, r0, r2, r5, r8, r10
More information about the llvm-commits
mailing list