diff --git a/lib/Target/Hexagon/HexagonInstrInfoV4.td b/lib/Target/Hexagon/HexagonInstrInfoV4.td index 41f944611da..2cefca58365 100644 --- a/lib/Target/Hexagon/HexagonInstrInfoV4.td +++ b/lib/Target/Hexagon/HexagonInstrInfoV4.td @@ -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 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 + //===----------------------------------------------------------------------===// diff --git a/test/MC/Disassembler/Hexagon/alu32_perm.txt b/test/MC/Disassembler/Hexagon/alu32_perm.txt index d8952102ec7..15977edbd6b 100644 --- a/test/MC/Disassembler/Hexagon/alu32_perm.txt +++ b/test/MC/Disassembler/Hexagon/alu32_perm.txt @@ -10,6 +10,10 @@ # 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