[Hexagon] Adding round reg/imm and bitsplit instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225188 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Colin LeMahieu 2015-01-05 18:08:21 +00:00
parent e5f07551f0
commit 9e989cf190
4 changed files with 29 additions and 0 deletions

View File

@ -3220,6 +3220,13 @@ class T_S2op_2 <string mnemonic, bits<4> RegTyBits, RegisterClass RCOut,
let Inst{7-5} = MinOp;
let Inst{4-0} = dst;
}
class T_S2op_2_di <string mnemonic, bits<3> MajOp, bits<3> MinOp>
: T_S2op_2 <mnemonic, 0b1000, DoubleRegs, IntRegs, MajOp, MinOp, 0, 0>;
let hasNewValue = 1 in
class T_S2op_2_id <string mnemonic, bits<3> MajOp, bits<3> MinOp>
: T_S2op_2 <mnemonic, 0b1000, IntRegs, DoubleRegs, MajOp, MinOp, 0, 0>;
let hasNewValue = 1 in
class T_S2op_2_ii <string mnemonic, bits<3> MajOp, bits<3> MinOp,

View File

@ -1747,6 +1747,20 @@ def M4_xor_xacc
let Inst{12-8} = Rtt;
let Inst{4-0} = Rxx;
}
// Split bitfield
let isCodeGenOnly = 0 in
def A4_bitspliti : T_S2op_2_di <"bitsplit", 0b110, 0b100>;
// Arithmetic/Convergent round
let isCodeGenOnly = 0 in
def A4_cround_ri : T_S2op_2_ii <"cround", 0b111, 0b000>;
let isCodeGenOnly = 0 in
def A4_round_ri : T_S2op_2_ii <"round", 0b111, 0b100>;
let Defs = [USR_OVF], isCodeGenOnly = 0 in
def A4_round_ri_sat : T_S2op_2_ii <"round", 0b111, 0b110, 1>;
// Add and accumulate.
// Rd=add(Rs,add(Ru,#s6))

View File

@ -86,6 +86,12 @@
# CHECK: r17:16 = neg(r21:20)
0xd1 0xc0 0x95 0x8c
# CHECK: r17 = neg(r21):sat
0x11 0xdf 0xf5 0x8c
# CHECK: r17 = cround(r21, #31)
0x91 0xdf 0xf5 0x8c
# CHECK: r17 = round(r21, #31)
0xd1 0xdf 0xf5 0x8c
# CHECK: r17 = round(r21, #31):sat
0x71 0xd5 0x1f 0xef
# CHECK: r17 += sub(r21, r31)
0x11 0xd5 0x3f 0xd5

View File

@ -64,6 +64,8 @@
# CHECK: r17 = clrbit(r21, r31)
0x91 0xdf 0x95 0xc6
# CHECK: r17 = togglebit(r21, r31)
0x90 0xdf 0xd5 0x88
# CHECK: r17:16 = bitsplit(r21, #31)
0xf1 0xcd 0x15 0x87
# CHECK: r17 = tableidxb(r21, #7, #13):raw
0xf1 0xcd 0x55 0x87