blob: 83e95b55380447f54fe7dd9acac1b60d5bfb4e3a [file] [log] [blame]
Matt Arsenault9be7b0d2017-02-27 18:49:11 +00001//===-- 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
14class 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
Dmitry Preobrazhenskyb2d24e22017-07-07 14:29:06 +000019// Non-packed instructions that use the VOP3P encoding.
20// VOP3 neg/abs and VOP3P opsel/opsel_hi modifiers are allowed.
Matt Arsenaulte135c4c2017-09-20 20:53:49 +000021class VOP3_VOP3PInst<string OpName, VOPProfile P, bit UseTiedOutput = 0,
22 SDPatternOperator node = null_frag> :
Dmitry Preobrazhenskyb2d24e22017-07-07 14:29:06 +000023 VOP3P_Pseudo<OpName, P> {
Matt Arsenaultc8f8cda2017-08-30 22:18:40 +000024 // These operands are only sort of f16 operands. Depending on
25 // op_sel_hi, these may be interpreted as f32. The inline immediate
26 // values are really f16 converted to f32, so we treat these as f16
27 // operands.
Dmitry Preobrazhenskyb2d24e22017-07-07 14:29:06 +000028 let InOperandList =
Matt Arsenaulte135c4c2017-09-20 20:53:49 +000029 !con(
30 !con(
31 (ins FP16InputMods:$src0_modifiers, VCSrc_f16:$src0,
32 FP16InputMods:$src1_modifiers, VCSrc_f16:$src1,
33 FP16InputMods:$src2_modifiers, VCSrc_f16:$src2,
34 clampmod:$clamp),
35 !if(UseTiedOutput, (ins VGPR_32:$vdst_in), (ins))),
36 (ins op_sel:$op_sel, op_sel_hi:$op_sel_hi));
37
38 let Constraints = !if(UseTiedOutput, "$vdst = $vdst_in", "");
39 let DisableEncoding = !if(UseTiedOutput, "$vdst_in", "");
Dmitry Preobrazhenskyb2d24e22017-07-07 14:29:06 +000040 let AsmOperands =
41 " $vdst, $src0_modifiers, $src1_modifiers, $src2_modifiers$op_sel$op_sel_hi$clamp";
42}
Matt Arsenault9be7b0d2017-02-27 18:49:11 +000043
44let isCommutable = 1 in {
Matt Arsenaulteb522e62017-02-27 22:15:25 +000045def V_PK_FMA_F16 : VOP3PInst<"v_pk_fma_f16", VOP3_Profile<VOP_V2F16_V2F16_V2F16_V2F16>, fma>;
Dmitry Preobrazhensky095ec3da2017-07-18 09:24:10 +000046def V_PK_MAD_I16 : VOP3PInst<"v_pk_mad_i16", VOP3_Profile<VOP_V2I16_V2I16_V2I16_V2I16>>;
47def V_PK_MAD_U16 : VOP3PInst<"v_pk_mad_u16", VOP3_Profile<VOP_V2I16_V2I16_V2I16_V2I16>>;
48
Matt Arsenaulteb522e62017-02-27 22:15:25 +000049def V_PK_ADD_F16 : VOP3PInst<"v_pk_add_f16", VOP3_Profile<VOP_V2F16_V2F16_V2F16>, fadd>;
50def V_PK_MUL_F16 : VOP3PInst<"v_pk_mul_f16", VOP3_Profile<VOP_V2F16_V2F16_V2F16>, fmul>;
51def V_PK_MAX_F16 : VOP3PInst<"v_pk_max_f16", VOP3_Profile<VOP_V2F16_V2F16_V2F16>, fmaxnum>;
52def V_PK_MIN_F16 : VOP3PInst<"v_pk_min_f16", VOP3_Profile<VOP_V2F16_V2F16_V2F16>, fminnum>;
Matt Arsenault9be7b0d2017-02-27 18:49:11 +000053
Matt Arsenaulteb522e62017-02-27 22:15:25 +000054def V_PK_ADD_U16 : VOP3PInst<"v_pk_add_u16", VOP3_Profile<VOP_V2I16_V2I16_V2I16>, add>;
Matt Arsenault9be7b0d2017-02-27 18:49:11 +000055def V_PK_ADD_I16 : VOP3PInst<"v_pk_add_i16", VOP3_Profile<VOP_V2I16_V2I16_V2I16>>;
Matt Arsenaulteb522e62017-02-27 22:15:25 +000056def V_PK_MUL_LO_U16 : VOP3PInst<"v_pk_mul_lo_u16", VOP3_Profile<VOP_V2I16_V2I16_V2I16>, mul>;
Matt Arsenault9be7b0d2017-02-27 18:49:11 +000057
Matt Arsenaulteb522e62017-02-27 22:15:25 +000058def V_PK_MIN_I16 : VOP3PInst<"v_pk_min_i16", VOP3_Profile<VOP_V2I16_V2I16_V2I16>, smin>;
59def V_PK_MIN_U16 : VOP3PInst<"v_pk_min_u16", VOP3_Profile<VOP_V2I16_V2I16_V2I16>, umin>;
60def V_PK_MAX_I16 : VOP3PInst<"v_pk_max_i16", VOP3_Profile<VOP_V2I16_V2I16_V2I16>, smax>;
61def V_PK_MAX_U16 : VOP3PInst<"v_pk_max_u16", VOP3_Profile<VOP_V2I16_V2I16_V2I16>, umax>;
Matt Arsenault9be7b0d2017-02-27 18:49:11 +000062}
63
Dmitry Preobrazhensky095ec3da2017-07-18 09:24:10 +000064def V_PK_SUB_U16 : VOP3PInst<"v_pk_sub_u16", VOP3_Profile<VOP_V2I16_V2I16_V2I16>>;
65def V_PK_SUB_I16 : VOP3PInst<"v_pk_sub_i16", VOP3_Profile<VOP_V2I16_V2I16_V2I16>, sub>;
66
Matt Arsenaulteb522e62017-02-27 22:15:25 +000067def V_PK_LSHLREV_B16 : VOP3PInst<"v_pk_lshlrev_b16", VOP3_Profile<VOP_V2I16_V2I16_V2I16>, lshl_rev>;
68def V_PK_ASHRREV_I16 : VOP3PInst<"v_pk_ashrrev_i16", VOP3_Profile<VOP_V2I16_V2I16_V2I16>, ashr_rev>;
69def V_PK_LSHRREV_B16 : VOP3PInst<"v_pk_lshrrev_b16", VOP3_Profile<VOP_V2I16_V2I16_V2I16>, lshr_rev>;
Matt Arsenault9be7b0d2017-02-27 18:49:11 +000070
Matt Arsenault0084adc2018-04-30 19:08:16 +000071multiclass MadFmaMixPats<SDPatternOperator fma_like,
72 Instruction mix_inst,
73 Instruction mixlo_inst,
74 Instruction mixhi_inst> {
75 def : GCNPat <
76 (f16 (fpround (fma_like (f32 (VOP3PMadMixMods f16:$src0, i32:$src0_modifiers)),
77 (f32 (VOP3PMadMixMods f16:$src1, i32:$src1_modifiers)),
78 (f32 (VOP3PMadMixMods f16:$src2, i32:$src2_modifiers))))),
79 (mixlo_inst $src0_modifiers, $src0,
80 $src1_modifiers, $src1,
81 $src2_modifiers, $src2,
82 DSTCLAMP.NONE,
83 (i32 (IMPLICIT_DEF)))
84 >;
85
86 // FIXME: Special case handling for maxhi (especially for clamp)
87 // because dealing with the write to high half of the register is
88 // difficult.
89 def : GCNPat <
90 (build_vector f16:$elt0, (fpround (fma_like (f32 (VOP3PMadMixMods f16:$src0, i32:$src0_modifiers)),
91 (f32 (VOP3PMadMixMods f16:$src1, i32:$src1_modifiers)),
92 (f32 (VOP3PMadMixMods f16:$src2, i32:$src2_modifiers))))),
93 (v2f16 (mixhi_inst $src0_modifiers, $src0,
94 $src1_modifiers, $src1,
95 $src2_modifiers, $src2,
96 DSTCLAMP.NONE,
97 $elt0))
98 >;
99
100 def : GCNPat <
101 (build_vector
102 f16:$elt0,
103 (AMDGPUclamp (fpround (fma_like (f32 (VOP3PMadMixMods f16:$src0, i32:$src0_modifiers)),
104 (f32 (VOP3PMadMixMods f16:$src1, i32:$src1_modifiers)),
105 (f32 (VOP3PMadMixMods f16:$src2, i32:$src2_modifiers)))))),
106 (v2f16 (mixhi_inst $src0_modifiers, $src0,
107 $src1_modifiers, $src1,
108 $src2_modifiers, $src2,
109 DSTCLAMP.ENABLE,
110 $elt0))
111 >;
112
113 def : GCNPat <
114 (AMDGPUclamp (build_vector
115 (fpround (fma_like (f32 (VOP3PMadMixMods f16:$lo_src0, i32:$lo_src0_modifiers)),
116 (f32 (VOP3PMadMixMods f16:$lo_src1, i32:$lo_src1_modifiers)),
117 (f32 (VOP3PMadMixMods f16:$lo_src2, i32:$lo_src2_modifiers)))),
118 (fpround (fma_like (f32 (VOP3PMadMixMods f16:$hi_src0, i32:$hi_src0_modifiers)),
119 (f32 (VOP3PMadMixMods f16:$hi_src1, i32:$hi_src1_modifiers)),
120 (f32 (VOP3PMadMixMods f16:$hi_src2, i32:$hi_src2_modifiers)))))),
121 (v2f16 (mixhi_inst $hi_src0_modifiers, $hi_src0,
122 $hi_src1_modifiers, $hi_src1,
123 $hi_src2_modifiers, $hi_src2,
124 DSTCLAMP.ENABLE,
125 (mixlo_inst $lo_src0_modifiers, $lo_src0,
126 $lo_src1_modifiers, $lo_src1,
127 $lo_src2_modifiers, $lo_src2,
128 DSTCLAMP.ENABLE,
129 (i32 (IMPLICIT_DEF)))))
130 >;
131}
Matt Arsenault28f52e52017-10-25 07:00:51 +0000132
133let SubtargetPredicate = HasMadMixInsts in {
Dmitry Preobrazhenskyb2d24e22017-07-07 14:29:06 +0000134// These are VOP3a-like opcodes which accept no omod.
135// Size of src arguments (16/32) is controlled by op_sel.
136// For 16-bit src arguments their location (hi/lo) are controlled by op_sel_hi.
Matt Arsenaultc8f8cda2017-08-30 22:18:40 +0000137let isCommutable = 1 in {
Matt Arsenault644883f2017-09-20 19:09:28 +0000138def V_MAD_MIX_F32 : VOP3_VOP3PInst<"v_mad_mix_f32", VOP3_Profile<VOP_F32_F16_F16_F16, VOP3_OPSEL>>;
Matt Arsenault76935122017-09-20 20:28:39 +0000139
140// Clamp modifier is applied after conversion to f16.
Matt Arsenaulte135c4c2017-09-20 20:53:49 +0000141def V_MAD_MIXLO_F16 : VOP3_VOP3PInst<"v_mad_mixlo_f16", VOP3_Profile<VOP_F16_F16_F16_F16, VOP3_OPSEL>, 1>;
Matt Arsenault8cbb4882017-09-20 21:01:24 +0000142
143let ClampLo = 0, ClampHi = 1 in {
Matt Arsenaulte135c4c2017-09-20 20:53:49 +0000144def V_MAD_MIXHI_F16 : VOP3_VOP3PInst<"v_mad_mixhi_f16", VOP3_Profile<VOP_F16_F16_F16_F16, VOP3_OPSEL>, 1>;
Matt Arsenaultc8f8cda2017-08-30 22:18:40 +0000145}
Matt Arsenault8cbb4882017-09-20 21:01:24 +0000146}
Matt Arsenault9be7b0d2017-02-27 18:49:11 +0000147
Matt Arsenault0084adc2018-04-30 19:08:16 +0000148defm : MadFmaMixPats<fmad, V_MAD_MIX_F32, V_MAD_MIXLO_F16, V_MAD_MIXHI_F16>;
149} // End SubtargetPredicate = HasMadMixInsts
Matt Arsenault76935122017-09-20 20:28:39 +0000150
Matt Arsenault8cbb4882017-09-20 21:01:24 +0000151
Matt Arsenault0084adc2018-04-30 19:08:16 +0000152// Essentially the same as the mad_mix versions
153let SubtargetPredicate = HasFmaMixInsts in {
154let isCommutable = 1 in {
155def V_FMA_MIX_F32 : VOP3_VOP3PInst<"v_fma_mix_f32", VOP3_Profile<VOP_F32_F16_F16_F16, VOP3_OPSEL>>;
Matt Arsenault8cbb4882017-09-20 21:01:24 +0000156
Matt Arsenault0084adc2018-04-30 19:08:16 +0000157// Clamp modifier is applied after conversion to f16.
158def V_FMA_MIXLO_F16 : VOP3_VOP3PInst<"v_fma_mixlo_f16", VOP3_Profile<VOP_F16_F16_F16_F16, VOP3_OPSEL>, 1>;
Matt Arsenault8cbb4882017-09-20 21:01:24 +0000159
Matt Arsenault0084adc2018-04-30 19:08:16 +0000160let ClampLo = 0, ClampHi = 1 in {
161def V_FMA_MIXHI_F16 : VOP3_VOP3PInst<"v_fma_mixhi_f16", VOP3_Profile<VOP_F16_F16_F16_F16, VOP3_OPSEL>, 1>;
162}
163}
164
165defm : MadFmaMixPats<fma, V_FMA_MIX_F32, V_FMA_MIXLO_F16, V_FMA_MIXHI_F16>;
166}
167
Farhana Aleen9250c922018-08-29 16:31:18 +0000168class Srl<int N> : PatFrag<(ops node:$src),
169 (srl node:$src, (i32 N))>;
170
Farhana Aleenf5a28482018-09-18 16:59:48 +0000171foreach Bits = 1-7 in
172 def srl#!shl(Bits, 2) : Srl<!shl(Bits, 2)>;
Farhana Aleen9250c922018-08-29 16:31:18 +0000173
Farhana Aleenf5a28482018-09-18 16:59:48 +0000174class Extract_U<int FromBitIndex, int BitMask> : PatFrag<
175 (ops node:$src),
176 !if (!or (!and (!eq (BitMask, 255), !eq (FromBitIndex, 24)),
177 !and (!eq (BitMask, 15), !eq (FromBitIndex, 28))), // last element
Farhana Aleen9250c922018-08-29 16:31:18 +0000178 (!cast<Srl>("srl"#FromBitIndex) node:$src),
179 !if (!eq (FromBitIndex, 0), // first element
Farhana Aleenf5a28482018-09-18 16:59:48 +0000180 (and node:$src, (i32 BitMask)),
181 (and (!cast<Srl>("srl"#FromBitIndex) node:$src), (i32 BitMask))))>;
Farhana Aleen9250c922018-08-29 16:31:18 +0000182
Farhana Aleenf5a28482018-09-18 16:59:48 +0000183foreach Index = 0-3 in {
184 // Defines patterns that extract each Index'ed 8bit from an unsigned
185 // 32bit scalar value;
186 def U#Index#"_8bit" : Extract_U<!shl(Index, 3),
187 255>;
Farhana Aleen9250c922018-08-29 16:31:18 +0000188
Farhana Aleenf5a28482018-09-18 16:59:48 +0000189 // Defines multiplication patterns where the multiplication is happening on each
190 // Index'ed 8bit of a 32bit scalar value.
Farhana Aleen9250c922018-08-29 16:31:18 +0000191 def MulU_Elt#Index : PatFrag<
192 (ops node:$src0, node:$src1),
Farhana Aleenf5a28482018-09-18 16:59:48 +0000193 (AMDGPUmul_u24_oneuse (!cast<Extract_U>("U"#Index#"_8bit") node:$src0),
194 (!cast<Extract_U>("U"#Index#"_8bit") node:$src1))>;
195}
196
197// Different variants of dot8 patterns cause a huge increase in the compile time.
198// Define non-associative/commutative add/mul to prevent permutation in the dot8
199// pattern.
200def NonACAdd : SDNode<"ISD::ADD" , SDTIntBinOp>;
201def NonACAdd_oneuse : HasOneUseBinOp<NonACAdd>;
202
203def NonACAMDGPUmul_u24 : SDNode<"AMDGPUISD::MUL_U24" , SDTIntBinOp>;
204def NonACAMDGPUmul_u24_oneuse : HasOneUseBinOp<NonACAMDGPUmul_u24>;
205
206foreach Index = 0-7 in {
207 // Defines patterns that extract each Index'ed 4bit from an unsigned
208 // 32bit scalar value;
209 def U#Index#"_4bit" : Extract_U<!shl(Index, 2),
210 15>;
211
212 // Defines multiplication patterns where the multiplication is happening on each
213 // Index'ed 8bit of a 32bit scalar value.
214 def MulU#Index#"_4bit" : PatFrag<
215 (ops node:$src0, node:$src1),
216 (NonACAMDGPUmul_u24_oneuse (!cast<Extract_U>("U"#Index#"_4bit") node:$src0),
217 (!cast<Extract_U>("U"#Index#"_4bit") node:$src1))>;
Farhana Aleen9250c922018-08-29 16:31:18 +0000218}
219
Farhana Aleen3528c802018-08-21 16:21:15 +0000220class UDot2Pat<Instruction Inst> : GCNPat <
221 (add (add_oneuse (AMDGPUmul_u24_oneuse (srl i32:$src0, (i32 16)),
222 (srl i32:$src1, (i32 16))), i32:$src2),
223 (AMDGPUmul_u24_oneuse (and i32:$src0, (i32 65535)),
224 (and i32:$src1, (i32 65535)))
225 ),
226 (Inst (i32 8), $src0, (i32 8), $src1, (i32 8), $src2, (i1 0))
227>;
228
229class SDot2Pat<Instruction Inst> : GCNPat <
230 (add (add_oneuse (AMDGPUmul_i24_oneuse (sra i32:$src0, (i32 16)),
231 (sra i32:$src1, (i32 16))), i32:$src2),
232 (AMDGPUmul_i24_oneuse (sext_inreg i32:$src0, i16),
233 (sext_inreg i32:$src1, i16))),
234 (Inst (i32 8), $src0, (i32 8), $src1, (i32 8), $src2, (i1 0))
235>;
236
Matt Arsenault0084adc2018-04-30 19:08:16 +0000237let SubtargetPredicate = HasDLInsts in {
238
Konstantin Zhuravlyovbb30ef72018-08-01 01:31:30 +0000239def V_DOT2_F32_F16 : VOP3PInst<"v_dot2_f32_f16", VOP3_Profile<VOP_F32_V2F16_V2F16_F32>>;
240def V_DOT2_I32_I16 : VOP3PInst<"v_dot2_i32_i16", VOP3_Profile<VOP_I32_V2I16_V2I16_I32>>;
241def V_DOT2_U32_U16 : VOP3PInst<"v_dot2_u32_u16", VOP3_Profile<VOP_I32_V2I16_V2I16_I32>>;
242def V_DOT4_I32_I8 : VOP3PInst<"v_dot4_i32_i8", VOP3_Profile<VOP_I32_I32_I32_I32, VOP3_PACKED>>;
243def V_DOT4_U32_U8 : VOP3PInst<"v_dot4_u32_u8", VOP3_Profile<VOP_I32_I32_I32_I32, VOP3_PACKED>>;
244def V_DOT8_I32_I4 : VOP3PInst<"v_dot8_i32_i4", VOP3_Profile<VOP_I32_I32_I32_I32, VOP3_PACKED>>;
245def V_DOT8_U32_U4 : VOP3PInst<"v_dot8_u32_u4", VOP3_Profile<VOP_I32_I32_I32_I32, VOP3_PACKED>>;
246
247multiclass DotPats<SDPatternOperator dot_op,
248 VOP3PInst dot_inst> {
249 def : GCNPat <
250 (dot_op (dot_inst.Pfl.Src0VT (VOP3PMods0 dot_inst.Pfl.Src0VT:$src0, i32:$src0_modifiers)),
251 (dot_inst.Pfl.Src1VT (VOP3PMods dot_inst.Pfl.Src1VT:$src1, i32:$src1_modifiers)),
252 (dot_inst.Pfl.Src2VT (VOP3PMods dot_inst.Pfl.Src2VT:$src2, i32:$src2_modifiers)), i1:$clamp),
253 (dot_inst $src0_modifiers, $src0, $src1_modifiers, $src1, $src2_modifiers, $src2, (as_i1imm $clamp))>;
254}
255
256defm : DotPats<AMDGPUfdot2, V_DOT2_F32_F16>;
257defm : DotPats<int_amdgcn_sdot2, V_DOT2_I32_I16>;
258defm : DotPats<int_amdgcn_udot2, V_DOT2_U32_U16>;
259defm : DotPats<int_amdgcn_sdot4, V_DOT4_I32_I8>;
260defm : DotPats<int_amdgcn_udot4, V_DOT4_U32_U8>;
261defm : DotPats<int_amdgcn_sdot8, V_DOT8_I32_I4>;
262defm : DotPats<int_amdgcn_udot8, V_DOT8_U32_U4>;
Matt Arsenault0084adc2018-04-30 19:08:16 +0000263
Farhana Aleen3528c802018-08-21 16:21:15 +0000264def : UDot2Pat<V_DOT2_U32_U16>;
265def : SDot2Pat<V_DOT2_I32_I16>;
266
Farhana Aleen9250c922018-08-29 16:31:18 +0000267def : GCNPat <
Farhana Aleenf5a28482018-09-18 16:59:48 +0000268 !cast<dag>(!foldl((i32 i32:$src2), [0, 1, 2, 3], lhs, y,
Farhana Aleen9250c922018-08-29 16:31:18 +0000269 (add_oneuse lhs, (!cast<PatFrag>("MulU_Elt"#y) i32:$src0, i32:$src1)))),
270 (V_DOT4_U32_U8 (i32 8), $src0, (i32 8), $src1, (i32 8), $src2, (i1 0))
271>;
272
Farhana Aleenf5a28482018-09-18 16:59:48 +0000273def : GCNPat <
274 !cast<dag>(!foldl((add_oneuse i32:$src2, (MulU0_4bit i32:$src0, i32:$src1)), [1, 2, 3, 4, 5, 6, 7], lhs, y,
275 (NonACAdd_oneuse lhs, (!cast<PatFrag>("MulU"#y#"_4bit") i32:$src0, i32:$src1)))),
276 (V_DOT8_U32_U4 (i32 8), $src0, (i32 8), $src1, (i32 8), $src2, (i1 0))
277>;
278
Matt Arsenault0084adc2018-04-30 19:08:16 +0000279} // End SubtargetPredicate = HasDLInsts
Matt Arsenault76935122017-09-20 20:28:39 +0000280
Matt Arsenault9be7b0d2017-02-27 18:49:11 +0000281multiclass VOP3P_Real_vi<bits<10> op> {
Nicolai Haehnle4f850ea2018-03-26 13:56:53 +0000282 def _vi : VOP3P_Real<!cast<VOP3_Pseudo>(NAME), SIEncodingFamily.VI>,
283 VOP3Pe <op, !cast<VOP3_Pseudo>(NAME).Pfl> {
Matt Arsenault9be7b0d2017-02-27 18:49:11 +0000284 let AssemblerPredicates = [HasVOP3PInsts];
285 let DecoderNamespace = "VI";
286 }
287}
288
Dmitry Preobrazhensky095ec3da2017-07-18 09:24:10 +0000289defm V_PK_MAD_I16 : VOP3P_Real_vi <0x380>;
Matt Arsenault9be7b0d2017-02-27 18:49:11 +0000290defm V_PK_MUL_LO_U16 : VOP3P_Real_vi <0x381>;
291defm V_PK_ADD_I16 : VOP3P_Real_vi <0x382>;
292defm V_PK_SUB_I16 : VOP3P_Real_vi <0x383>;
293defm V_PK_LSHLREV_B16 : VOP3P_Real_vi <0x384>;
294defm V_PK_LSHRREV_B16 : VOP3P_Real_vi <0x385>;
295defm V_PK_ASHRREV_I16 : VOP3P_Real_vi <0x386>;
296defm V_PK_MAX_I16 : VOP3P_Real_vi <0x387>;
297defm V_PK_MIN_I16 : VOP3P_Real_vi <0x388>;
Dmitry Preobrazhensky095ec3da2017-07-18 09:24:10 +0000298defm V_PK_MAD_U16 : VOP3P_Real_vi <0x389>;
Matt Arsenault9be7b0d2017-02-27 18:49:11 +0000299
300defm V_PK_ADD_U16 : VOP3P_Real_vi <0x38a>;
Dmitry Preobrazhensky095ec3da2017-07-18 09:24:10 +0000301defm V_PK_SUB_U16 : VOP3P_Real_vi <0x38b>;
Matt Arsenault9be7b0d2017-02-27 18:49:11 +0000302defm V_PK_MAX_U16 : VOP3P_Real_vi <0x38c>;
303defm V_PK_MIN_U16 : VOP3P_Real_vi <0x38d>;
304defm V_PK_FMA_F16 : VOP3P_Real_vi <0x38e>;
305defm V_PK_ADD_F16 : VOP3P_Real_vi <0x38f>;
306defm V_PK_MUL_F16 : VOP3P_Real_vi <0x390>;
307defm V_PK_MIN_F16 : VOP3P_Real_vi <0x391>;
308defm V_PK_MAX_F16 : VOP3P_Real_vi <0x392>;
309
Matt Arsenault0084adc2018-04-30 19:08:16 +0000310
311let SubtargetPredicate = HasMadMixInsts in {
Matt Arsenault9be7b0d2017-02-27 18:49:11 +0000312defm V_MAD_MIX_F32 : VOP3P_Real_vi <0x3a0>;
313defm V_MAD_MIXLO_F16 : VOP3P_Real_vi <0x3a1>;
314defm V_MAD_MIXHI_F16 : VOP3P_Real_vi <0x3a2>;
Matt Arsenault0084adc2018-04-30 19:08:16 +0000315}
316
317let SubtargetPredicate = HasFmaMixInsts in {
318let DecoderNamespace = "GFX9_DL" in {
319// The mad_mix instructions were renamed and their behaviors changed,
320// but the opcode stayed the same so we need to put these in a
321// different DecoderNamespace to avoid the ambiguity.
322defm V_FMA_MIX_F32 : VOP3P_Real_vi <0x3a0>;
323defm V_FMA_MIXLO_F16 : VOP3P_Real_vi <0x3a1>;
324defm V_FMA_MIXHI_F16 : VOP3P_Real_vi <0x3a2>;
325}
326}
327
328
329let SubtargetPredicate = HasDLInsts in {
330
331defm V_DOT2_F32_F16 : VOP3P_Real_vi <0x3a3>;
332defm V_DOT2_I32_I16 : VOP3P_Real_vi <0x3a6>;
333defm V_DOT2_U32_U16 : VOP3P_Real_vi <0x3a7>;
334defm V_DOT4_I32_I8 : VOP3P_Real_vi <0x3a8>;
335defm V_DOT4_U32_U8 : VOP3P_Real_vi <0x3a9>;
336defm V_DOT8_I32_I4 : VOP3P_Real_vi <0x3aa>;
337defm V_DOT8_U32_U4 : VOP3P_Real_vi <0x3ab>;
338
339} // End SubtargetPredicate = HasDLInsts