blob: 390e9100300fb6ee80855ad0bda86c631c13eee8 [file] [log] [blame]
Colin LeMahieufe03c9a2015-01-28 17:37:59 +00001//===- HexagonIntrinsicsV5.td - V4 Instruction intrinsics --*- tablegen -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
Colin LeMahieu4379d102015-01-28 22:08:16 +000010def : T_FF_pat<F2_sfadd, int_hexagon_F2_sfadd>;
11def : T_FF_pat<F2_sfsub, int_hexagon_F2_sfsub>;
12def : T_FF_pat<F2_sfmpy, int_hexagon_F2_sfmpy>;
13def : T_FF_pat<F2_sfmax, int_hexagon_F2_sfmax>;
14def : T_FF_pat<F2_sfmin, int_hexagon_F2_sfmin>;
15
16def : T_FF_pat<F2_sffixupn, int_hexagon_F2_sffixupn>;
17def : T_FF_pat<F2_sffixupd, int_hexagon_F2_sffixupd>;
18def : T_F_pat <F2_sffixupr, int_hexagon_F2_sffixupr>;
19
Colin LeMahieu16107302015-01-29 17:26:56 +000020def: qi_CRInst_qiqi_pat<C4_fastcorner9, int_hexagon_C4_fastcorner9>;
21def: qi_CRInst_qiqi_pat<C4_fastcorner9_not, int_hexagon_C4_fastcorner9_not>;
22
Colin LeMahieu4379d102015-01-28 22:08:16 +000023def : T_P_pat <S5_popcountp, int_hexagon_S5_popcountp>;
24def : T_PI_pat <S5_asrhub_sat, int_hexagon_S5_asrhub_sat>;
25
Colin LeMahieufe03c9a2015-01-28 17:37:59 +000026def : T_PI_pat <S2_asr_i_p_rnd, int_hexagon_S2_asr_i_p_rnd>;
27def : T_PI_pat <S2_asr_i_p_rnd_goodsyntax,
28 int_hexagon_S2_asr_i_p_rnd_goodsyntax>;
29
Colin LeMahieu4379d102015-01-28 22:08:16 +000030def : T_PI_pat <S5_asrhub_rnd_sat_goodsyntax,
31 int_hexagon_S5_asrhub_rnd_sat_goodsyntax>;
Sirish Pande83ccb6c2012-05-11 19:39:13 +000032
Colin LeMahieu4379d102015-01-28 22:08:16 +000033def : T_FFF_pat <F2_sffma, int_hexagon_F2_sffma>;
34def : T_FFF_pat <F2_sffms, int_hexagon_F2_sffms>;
35def : T_FFF_pat <F2_sffma_lib, int_hexagon_F2_sffma_lib>;
36def : T_FFF_pat <F2_sffms_lib, int_hexagon_F2_sffms_lib>;
37def : T_FFFQ_pat <F2_sffma_sc, int_hexagon_F2_sffma_sc>;
Sirish Pande83ccb6c2012-05-11 19:39:13 +000038
Colin LeMahieua749b3e2015-01-29 16:08:43 +000039// Compare floating-point value
40def : T_FF_pat <F2_sfcmpge, int_hexagon_F2_sfcmpge>;
41def : T_FF_pat <F2_sfcmpuo, int_hexagon_F2_sfcmpuo>;
42def : T_FF_pat <F2_sfcmpeq, int_hexagon_F2_sfcmpeq>;
43def : T_FF_pat <F2_sfcmpgt, int_hexagon_F2_sfcmpgt>;
44
45def : T_DD_pat <F2_dfcmpeq, int_hexagon_F2_dfcmpeq>;
46def : T_DD_pat <F2_dfcmpgt, int_hexagon_F2_dfcmpgt>;
47def : T_DD_pat <F2_dfcmpge, int_hexagon_F2_dfcmpge>;
48def : T_DD_pat <F2_dfcmpuo, int_hexagon_F2_dfcmpuo>;
49
Colin LeMahieu4379d102015-01-28 22:08:16 +000050// Create floating-point value
51def : T_I_pat <F2_sfimm_p, int_hexagon_F2_sfimm_p>;
52def : T_I_pat <F2_sfimm_n, int_hexagon_F2_sfimm_n>;
53def : T_I_pat <F2_dfimm_p, int_hexagon_F2_dfimm_p>;
54def : T_I_pat <F2_dfimm_n, int_hexagon_F2_dfimm_n>;
Sirish Pande83ccb6c2012-05-11 19:39:13 +000055
Colin LeMahieu4379d102015-01-28 22:08:16 +000056def : T_DI_pat <F2_dfclass, int_hexagon_F2_dfclass>;
57def : T_FI_pat <F2_sfclass, int_hexagon_F2_sfclass>;
58def : T_F_pat <F2_conv_sf2df, int_hexagon_F2_conv_sf2df>;
59def : T_D_pat <F2_conv_df2sf, int_hexagon_F2_conv_df2sf>;
60def : T_R_pat <F2_conv_uw2sf, int_hexagon_F2_conv_uw2sf>;
61def : T_R_pat <F2_conv_uw2df, int_hexagon_F2_conv_uw2df>;
62def : T_R_pat <F2_conv_w2sf, int_hexagon_F2_conv_w2sf>;
63def : T_R_pat <F2_conv_w2df, int_hexagon_F2_conv_w2df>;
64def : T_P_pat <F2_conv_ud2sf, int_hexagon_F2_conv_ud2sf>;
65def : T_P_pat <F2_conv_ud2df, int_hexagon_F2_conv_ud2df>;
66def : T_P_pat <F2_conv_d2sf, int_hexagon_F2_conv_d2sf>;
67def : T_P_pat <F2_conv_d2df, int_hexagon_F2_conv_d2df>;
68def : T_F_pat <F2_conv_sf2uw, int_hexagon_F2_conv_sf2uw>;
69def : T_F_pat <F2_conv_sf2w, int_hexagon_F2_conv_sf2w>;
70def : T_F_pat <F2_conv_sf2ud, int_hexagon_F2_conv_sf2ud>;
71def : T_F_pat <F2_conv_sf2d, int_hexagon_F2_conv_sf2d>;
72def : T_D_pat <F2_conv_df2uw, int_hexagon_F2_conv_df2uw>;
73def : T_D_pat <F2_conv_df2w, int_hexagon_F2_conv_df2w>;
74def : T_D_pat <F2_conv_df2ud, int_hexagon_F2_conv_df2ud>;
75def : T_D_pat <F2_conv_df2d, int_hexagon_F2_conv_df2d>;
76def : T_F_pat <F2_conv_sf2uw_chop, int_hexagon_F2_conv_sf2uw_chop>;
77def : T_F_pat <F2_conv_sf2w_chop, int_hexagon_F2_conv_sf2w_chop>;
78def : T_F_pat <F2_conv_sf2ud_chop, int_hexagon_F2_conv_sf2ud_chop>;
79def : T_F_pat <F2_conv_sf2d_chop, int_hexagon_F2_conv_sf2d_chop>;
80def : T_D_pat <F2_conv_df2uw_chop, int_hexagon_F2_conv_df2uw_chop>;
81def : T_D_pat <F2_conv_df2w_chop, int_hexagon_F2_conv_df2w_chop>;
82def : T_D_pat <F2_conv_df2ud_chop, int_hexagon_F2_conv_df2ud_chop>;
83def : T_D_pat <F2_conv_df2d_chop, int_hexagon_F2_conv_df2d_chop>;
Sirish Pande83ccb6c2012-05-11 19:39:13 +000084
85class qi_ALU64_dfdf<string opc, Intrinsic IntID>
86 : ALU64_rr<(outs PredRegs:$dst), (ins DoubleRegs:$src1, DoubleRegs:$src2),
87 !strconcat("$dst = ", !strconcat(opc , "($src1, $src2)")),
88 [(set PredRegs:$dst, (IntID DoubleRegs:$src1, DoubleRegs:$src2))]>;
89
90class qi_ALU64_dfu5<string opc, Intrinsic IntID>
91 : ALU64_ri<(outs PredRegs:$dst), (ins DoubleRegs:$src1, u5Imm:$src2),
92 !strconcat("$dst = ", !strconcat(opc , "($src1, #$src2)")),
93 [(set PredRegs:$dst, (IntID DoubleRegs:$src1, imm:$src2))]>;
94
Sirish Pande83ccb6c2012-05-11 19:39:13 +000095class qi_SInst_sfsf<string opc, Intrinsic IntID>
96 : SInst<(outs PredRegs:$dst), (ins IntRegs:$src1, IntRegs:$src2),
97 !strconcat("$dst = ", !strconcat(opc , "($src1, $src2)")),
98 [(set PredRegs:$dst, (IntID IntRegs:$src1, IntRegs:$src2))]>;
99
100class qi_SInst_sfu5<string opc, Intrinsic IntID>
101 : MInst<(outs PredRegs:$dst), (ins IntRegs:$src1, u5Imm:$src2),
102 !strconcat("$dst = ", !strconcat(opc , "($src1, #$src2)")),
103 [(set PredRegs:$dst, (IntID IntRegs:$src1, imm:$src2))]>;
104
Sirish Pande83ccb6c2012-05-11 19:39:13 +0000105class di_MInst_diu4_rnd<string opc, Intrinsic IntID>
106 : MInst<(outs DoubleRegs:$dst), (ins DoubleRegs:$src1, u4Imm:$src2),
107 !strconcat("$dst = ", !strconcat(opc , "($src1, #$src2):rnd")),
108 [(set DoubleRegs:$dst, (IntID DoubleRegs:$src1, imm:$src2))]>;
109
Sirish Pande83ccb6c2012-05-11 19:39:13 +0000110def HEXAGON_M5_vrmpybuu:
Bill Wendling723444e2012-07-19 00:25:04 +0000111 di_MInst_didi <"vrmpybu", int_hexagon_M5_vrmpybuu>;
Sirish Pande83ccb6c2012-05-11 19:39:13 +0000112def HEXAGON_M5_vrmacbuu:
Bill Wendling723444e2012-07-19 00:25:04 +0000113 di_MInst_dididi_acc <"vrmpybu", int_hexagon_M5_vrmacbuu>;
Sirish Pande83ccb6c2012-05-11 19:39:13 +0000114def HEXAGON_M5_vrmpybsu:
Bill Wendling723444e2012-07-19 00:25:04 +0000115 di_MInst_didi <"vrmpybsu", int_hexagon_M5_vrmpybsu>;
Sirish Pande83ccb6c2012-05-11 19:39:13 +0000116def HEXAGON_M5_vrmacbsu:
Bill Wendling723444e2012-07-19 00:25:04 +0000117 di_MInst_dididi_acc <"vrmpybsu", int_hexagon_M5_vrmacbsu>;
Sirish Pande83ccb6c2012-05-11 19:39:13 +0000118def HEXAGON_M5_vmpybuu:
Bill Wendling723444e2012-07-19 00:25:04 +0000119 di_MInst_sisi <"vmpybu", int_hexagon_M5_vmpybuu>;
Sirish Pande83ccb6c2012-05-11 19:39:13 +0000120def HEXAGON_M5_vmpybsu:
Bill Wendling723444e2012-07-19 00:25:04 +0000121 di_MInst_sisi <"vmpybsu", int_hexagon_M5_vmpybsu>;
Sirish Pande83ccb6c2012-05-11 19:39:13 +0000122def HEXAGON_M5_vmacbuu:
Bill Wendling723444e2012-07-19 00:25:04 +0000123 di_MInst_disisi_acc <"vmpybu", int_hexagon_M5_vmacbuu>;
Sirish Pande83ccb6c2012-05-11 19:39:13 +0000124def HEXAGON_M5_vmacbsu:
Bill Wendling723444e2012-07-19 00:25:04 +0000125 di_MInst_disisi_acc <"vmpybsu", int_hexagon_M5_vmacbsu>;
Sirish Pande83ccb6c2012-05-11 19:39:13 +0000126def HEXAGON_M5_vdmpybsu:
Bill Wendling723444e2012-07-19 00:25:04 +0000127 di_MInst_didi_sat <"vdmpybsu", int_hexagon_M5_vdmpybsu>;
Sirish Pande83ccb6c2012-05-11 19:39:13 +0000128def HEXAGON_M5_vdmacbsu:
Bill Wendling723444e2012-07-19 00:25:04 +0000129 di_MInst_dididi_acc_sat <"vdmpybsu", int_hexagon_M5_vdmacbsu>;
Sirish Pande83ccb6c2012-05-11 19:39:13 +0000130def HEXAGON_A5_vaddhubs:
Bill Wendling723444e2012-07-19 00:25:04 +0000131 si_SInst_didi_sat <"vaddhub", int_hexagon_A5_vaddhubs>;
Sirish Pande83ccb6c2012-05-11 19:39:13 +0000132def HEXAGON_S5_vasrhrnd_goodsyntax:
Bill Wendling723444e2012-07-19 00:25:04 +0000133 di_MInst_diu4_rnd <"vasrh", int_hexagon_S5_vasrhrnd_goodsyntax>;