]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/lib/Target/AMDGPU/VOP3PInstructions.td
Merge ^/head r320042 through r320397.
[FreeBSD/FreeBSD.git] / contrib / llvm / lib / Target / AMDGPU / VOP3PInstructions.td
1 //===-- VOP3PInstructions.td - Vector Instruction Defintions --------------===//
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
10 //===----------------------------------------------------------------------===//
11 // VOP3P Classes
12 //===----------------------------------------------------------------------===//
13
14 class VOP3PInst<string OpName, VOPProfile P, SDPatternOperator node = null_frag> :
15   VOP3P_Pseudo<OpName, P,
16     !if(P.HasModifiers, getVOP3PModPat<P, node>.ret, getVOP3Pat<P, node>.ret)
17 >;
18
19 // Non-packed instructions that use the VOP3P encoding. i.e. where
20 // omod/abs are used.
21 class VOP3_VOP3PInst<string OpName, VOPProfile P, SDPatternOperator node = null_frag> :
22   VOP3P_Pseudo<OpName, P,
23     !if(P.HasModifiers, getVOP3ModPat<P, node>.ret, getVOP3Pat<P, node>.ret)
24 >;
25
26 let isCommutable = 1 in {
27 def V_PK_FMA_F16 : VOP3PInst<"v_pk_fma_f16", VOP3_Profile<VOP_V2F16_V2F16_V2F16_V2F16>, fma>;
28 def V_PK_ADD_F16 : VOP3PInst<"v_pk_add_f16", VOP3_Profile<VOP_V2F16_V2F16_V2F16>, fadd>;
29 def V_PK_MUL_F16 : VOP3PInst<"v_pk_mul_f16", VOP3_Profile<VOP_V2F16_V2F16_V2F16>, fmul>;
30 def V_PK_MAX_F16 : VOP3PInst<"v_pk_max_f16", VOP3_Profile<VOP_V2F16_V2F16_V2F16>, fmaxnum>;
31 def V_PK_MIN_F16 : VOP3PInst<"v_pk_min_f16", VOP3_Profile<VOP_V2F16_V2F16_V2F16>, fminnum>;
32
33 def V_PK_ADD_U16 : VOP3PInst<"v_pk_add_u16", VOP3_Profile<VOP_V2I16_V2I16_V2I16>, add>;
34 def V_PK_ADD_I16 : VOP3PInst<"v_pk_add_i16", VOP3_Profile<VOP_V2I16_V2I16_V2I16>>;
35 def V_PK_SUB_I16 : VOP3PInst<"v_pk_sub_i16", VOP3_Profile<VOP_V2I16_V2I16_V2I16>, sub>;
36 def V_PK_MUL_LO_U16 : VOP3PInst<"v_pk_mul_lo_u16", VOP3_Profile<VOP_V2I16_V2I16_V2I16>, mul>;
37
38 def V_PK_MIN_I16 : VOP3PInst<"v_pk_min_i16", VOP3_Profile<VOP_V2I16_V2I16_V2I16>, smin>;
39 def V_PK_MIN_U16 : VOP3PInst<"v_pk_min_u16", VOP3_Profile<VOP_V2I16_V2I16_V2I16>, umin>;
40 def V_PK_MAX_I16 : VOP3PInst<"v_pk_max_i16", VOP3_Profile<VOP_V2I16_V2I16_V2I16>, smax>;
41 def V_PK_MAX_U16 : VOP3PInst<"v_pk_max_u16", VOP3_Profile<VOP_V2I16_V2I16_V2I16>, umax>;
42 }
43
44 def V_PK_LSHLREV_B16 : VOP3PInst<"v_pk_lshlrev_b16", VOP3_Profile<VOP_V2I16_V2I16_V2I16>, lshl_rev>;
45 def V_PK_ASHRREV_I16 : VOP3PInst<"v_pk_ashrrev_i16", VOP3_Profile<VOP_V2I16_V2I16_V2I16>, ashr_rev>;
46 def V_PK_LSHRREV_B16 : VOP3PInst<"v_pk_lshrrev_b16", VOP3_Profile<VOP_V2I16_V2I16_V2I16>, lshr_rev>;
47
48 // XXX - Commutable?
49 def V_MAD_MIX_F32 : VOP3_VOP3PInst<"v_mad_mix_f32", VOP3_Profile<VOP_F32_F32_F32_F32>>;
50 def V_MAD_MIXLO_F16 : VOP3_VOP3PInst<"v_mad_mixlo_f16", VOP3_Profile<VOP_F16_F16_F16_F16>>;
51 def V_MAD_MIXHI_F16 : VOP3_VOP3PInst<"v_mad_mixhi_f16", VOP3_Profile<VOP_F16_F16_F16_F16>>;
52
53
54 multiclass VOP3P_Real_vi<bits<10> op> {
55   def _vi : VOP3P_Real<!cast<VOP3P_Pseudo>(NAME), SIEncodingFamily.VI>,
56             VOP3Pe <op, !cast<VOP3P_Pseudo>(NAME).Pfl> {
57     let AssemblerPredicates = [HasVOP3PInsts];
58     let DecoderNamespace = "VI";
59   }
60 }
61
62 defm V_PK_MUL_LO_U16 : VOP3P_Real_vi <0x381>;
63 defm V_PK_ADD_I16 : VOP3P_Real_vi <0x382>;
64 defm V_PK_SUB_I16 : VOP3P_Real_vi <0x383>;
65 defm V_PK_LSHLREV_B16 : VOP3P_Real_vi <0x384>;
66 defm V_PK_LSHRREV_B16 : VOP3P_Real_vi <0x385>;
67 defm V_PK_ASHRREV_I16 : VOP3P_Real_vi <0x386>;
68 defm V_PK_MAX_I16 : VOP3P_Real_vi <0x387>;
69 defm V_PK_MIN_I16 : VOP3P_Real_vi <0x388>;
70
71 defm V_PK_ADD_U16 : VOP3P_Real_vi <0x38a>;
72 defm V_PK_MAX_U16 : VOP3P_Real_vi <0x38c>;
73 defm V_PK_MIN_U16 : VOP3P_Real_vi <0x38d>;
74 defm V_PK_FMA_F16 : VOP3P_Real_vi <0x38e>;
75 defm V_PK_ADD_F16 : VOP3P_Real_vi <0x38f>;
76 defm V_PK_MUL_F16 : VOP3P_Real_vi <0x390>;
77 defm V_PK_MIN_F16 : VOP3P_Real_vi <0x391>;
78 defm V_PK_MAX_F16 : VOP3P_Real_vi <0x392>;
79
80 defm V_MAD_MIX_F32 : VOP3P_Real_vi <0x3a0>;
81 defm V_MAD_MIXLO_F16 : VOP3P_Real_vi <0x3a1>;
82 defm V_MAD_MIXHI_F16 : VOP3P_Real_vi <0x3a2>;