[Hexagon] Adding combine ri/ir instructions.
authorColin LeMahieu <colinl@codeaurora.org>
Wed, 10 Dec 2014 22:23:07 +0000 (22:23 +0000)
committerColin LeMahieu <colinl@codeaurora.org>
Wed, 10 Dec 2014 22:23:07 +0000 (22:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223971 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Hexagon/HexagonInstrInfoV4.td
test/MC/Disassembler/Hexagon/alu32_perm.txt

index 41f944611da6aaba9c9c8515279c738b89a5b005..2cefca58365ea37ff8932f9b61d21101dd6c854b 100644 (file)
@@ -206,6 +206,32 @@ def COMBINE_iI_V4 : ALU32_ii<(outs DoubleRegs:$dst),
 // ALU32/PERM +
 //===----------------------------------------------------------------------===//
 
+// Combine a word and an immediate into a register pair.
+let hasSideEffects = 0, isExtentSigned = 1, isExtendable = 1,
+    opExtentBits = 8 in
+class T_Combine1 <bits<2> MajOp, dag ins, string AsmStr>
+  : ALU32Inst <(outs DoubleRegs:$Rdd), ins, AsmStr> {
+    bits<5> Rdd;
+    bits<5> Rs;
+    bits<8> s8;
+
+    let IClass      = 0b0111;
+    let Inst{27-24} = 0b0011;
+    let Inst{22-21} = MajOp;
+    let Inst{20-16} = Rs;
+    let Inst{13}    = 0b1;
+    let Inst{12-5}  = s8;
+    let Inst{4-0}   = Rdd;
+  }
+
+let opExtendable = 2, isCodeGenOnly = 0 in
+def A4_combineri : T_Combine1<0b00, (ins IntRegs:$Rs, s8Ext:$s8),
+                                    "$Rdd = combine($Rs, #$s8)">;
+
+let opExtendable = 1, isCodeGenOnly = 0 in
+def A4_combineir : T_Combine1<0b01, (ins s8Ext:$s8, IntRegs:$Rs),
+                                    "$Rdd = combine(#$s8, $Rs)">;
+
 //===----------------------------------------------------------------------===//
 // LD +
 //===----------------------------------------------------------------------===//
index d8952102ec71bdc121d732517890b79034d693b1..15977edbd6b73a25fb98586a0837d74c7265fb34 100644 (file)
 # CHECK: r17 = combine(r31.l, r21.l)
 0xb0 0xe2 0x0f 0x7c
 # CHECK: r17:16 = combine(#21, #31)
+0xb0 0xe2 0x3f 0x73
+# CHECK: r17:16 = combine(#21, r31)
+0xf0 0xe3 0x15 0x73
+# CHECK: r17:16 = combine(r21, #31)
 0x10 0xdf 0x15 0xf5
 # CHECK: r17:16 = combine(r21, r31)
 0xf1 0xc3 0x75 0x73