1 //===-- VOP3Instructions.td - Vector Instruction Defintions ---------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 //===----------------------------------------------------------------------===//
11 //===----------------------------------------------------------------------===//
13 class getVOP3ModPat<VOPProfile P, SDPatternOperator node> {
14 dag src0 = !if(P.HasOMod,
15 (VOP3Mods0 P.Src0VT:$src0, i32:$src0_modifiers, i1:$clamp, i32:$omod),
16 (VOP3Mods0 P.Src0VT:$src0, i32:$src0_modifiers, i1:$clamp));
18 list<dag> ret3 = [(set P.DstVT:$vdst,
19 (DivergentFragOrOp<node, P>.ret (P.Src0VT src0),
20 (P.Src1VT (VOP3Mods P.Src1VT:$src1, i32:$src1_modifiers)),
21 (P.Src2VT (VOP3Mods P.Src2VT:$src2, i32:$src2_modifiers))))];
23 list<dag> ret2 = [(set P.DstVT:$vdst,
24 (DivergentFragOrOp<node, P>.ret (P.Src0VT src0),
25 (P.Src1VT (VOP3Mods P.Src1VT:$src1, i32:$src1_modifiers))))];
27 list<dag> ret1 = [(set P.DstVT:$vdst,
28 (DivergentFragOrOp<node, P>.ret (P.Src0VT src0)))];
30 list<dag> ret = !if(!eq(P.NumSrcArgs, 3), ret3,
31 !if(!eq(P.NumSrcArgs, 2), ret2,
35 class getVOP3PModPat<VOPProfile P, SDPatternOperator node> {
36 list<dag> ret3 = [(set P.DstVT:$vdst,
37 (DivergentFragOrOp<node, P>.ret (P.Src0VT !if(P.HasClamp, (VOP3PMods0 P.Src0VT:$src0, i32:$src0_modifiers, i1:$clamp),
38 (VOP3PMods P.Src0VT:$src0, i32:$src0_modifiers))),
39 (P.Src1VT (VOP3PMods P.Src1VT:$src1, i32:$src1_modifiers)),
40 (P.Src2VT (VOP3PMods P.Src2VT:$src2, i32:$src2_modifiers))))];
42 list<dag> ret2 = [(set P.DstVT:$vdst,
43 (DivergentFragOrOp<node, P>.ret !if(P.HasClamp, (P.Src0VT (VOP3PMods0 P.Src0VT:$src0, i32:$src0_modifiers, i1:$clamp)),
44 (P.Src0VT (VOP3PMods P.Src0VT:$src0, i32:$src0_modifiers))),
45 (P.Src1VT (VOP3PMods P.Src1VT:$src1, i32:$src1_modifiers))))];
47 list<dag> ret1 = [(set P.DstVT:$vdst,
48 (DivergentFragOrOp<node, P>.ret (P.Src0VT (VOP3PMods0 P.Src0VT:$src0, i32:$src0_modifiers, i1:$clamp))))];
50 list<dag> ret = !if(!eq(P.NumSrcArgs, 3), ret3,
51 !if(!eq(P.NumSrcArgs, 2), ret2,
55 class getVOP3OpSelPat<VOPProfile P, SDPatternOperator node> {
56 list<dag> ret3 = [(set P.DstVT:$vdst,
57 (DivergentFragOrOp<node, P>.ret (P.Src0VT !if(P.HasClamp, (VOP3OpSel0 P.Src0VT:$src0, i32:$src0_modifiers, i1:$clamp),
58 (VOP3OpSel P.Src0VT:$src0, i32:$src0_modifiers))),
59 (P.Src1VT (VOP3OpSel P.Src1VT:$src1, i32:$src1_modifiers)),
60 (P.Src2VT (VOP3OpSel P.Src2VT:$src2, i32:$src2_modifiers))))];
62 list<dag> ret2 = [(set P.DstVT:$vdst,
63 (DivergentFragOrOp<node, P>.ret !if(P.HasClamp, (P.Src0VT (VOP3OpSel0 P.Src0VT:$src0, i32:$src0_modifiers, i1:$clamp)),
64 (P.Src0VT (VOP3OpSel P.Src0VT:$src0, i32:$src0_modifiers))),
65 (P.Src1VT (VOP3OpSel P.Src1VT:$src1, i32:$src1_modifiers))))];
67 list<dag> ret1 = [(set P.DstVT:$vdst,
68 (DivergentFragOrOp<node, P>.ret (P.Src0VT (VOP3OpSel0 P.Src0VT:$src0, i32:$src0_modifiers, i1:$clamp))))];
70 list<dag> ret = !if(!eq(P.NumSrcArgs, 3), ret3,
71 !if(!eq(P.NumSrcArgs, 2), ret2,
75 class getVOP3OpSelModPat<VOPProfile P, SDPatternOperator node> {
76 list<dag> ret3 = [(set P.DstVT:$vdst,
77 (DivergentFragOrOp<node, P>.ret (P.Src0VT !if(P.HasClamp, (VOP3OpSelMods0 P.Src0VT:$src0, i32:$src0_modifiers, i1:$clamp),
78 (VOP3OpSelMods P.Src0VT:$src0, i32:$src0_modifiers))),
79 (P.Src1VT (VOP3OpSelMods P.Src1VT:$src1, i32:$src1_modifiers)),
80 (P.Src2VT (VOP3OpSelMods P.Src2VT:$src2, i32:$src2_modifiers))))];
82 list<dag> ret2 = [(set P.DstVT:$vdst,
83 (DivergentFragOrOp<node, P>.ret !if(P.HasClamp, (P.Src0VT (VOP3OpSelMods0 P.Src0VT:$src0, i32:$src0_modifiers, i1:$clamp)),
84 (P.Src0VT (VOP3OpSelMods P.Src0VT:$src0, i32:$src0_modifiers))),
85 (P.Src1VT (VOP3OpSelMods P.Src1VT:$src1, i32:$src1_modifiers))))];
87 list<dag> ret1 = [(set P.DstVT:$vdst,
88 (DivergentFragOrOp<node, P>.ret (P.Src0VT (VOP3OpSelMods0 P.Src0VT:$src0, i32:$src0_modifiers, i1:$clamp))))];
90 list<dag> ret = !if(!eq(P.NumSrcArgs, 3), ret3,
91 !if(!eq(P.NumSrcArgs, 2), ret2,
95 class getVOP3Pat<VOPProfile P, SDPatternOperator node> {
96 list<dag> ret3 = [(set P.DstVT:$vdst, (DivergentFragOrOp<node, P>.ret P.Src0VT:$src0, P.Src1VT:$src1, P.Src2VT:$src2))];
97 list<dag> ret2 = [(set P.DstVT:$vdst, (DivergentFragOrOp<node, P>.ret P.Src0VT:$src0, P.Src1VT:$src1))];
98 list<dag> ret1 = [(set P.DstVT:$vdst, (DivergentFragOrOp<node, P>.ret P.Src0VT:$src0))];
99 list<dag> ret = !if(!eq(P.NumSrcArgs, 3), ret3,
100 !if(!eq(P.NumSrcArgs, 2), ret2,
104 class getVOP3ClampPat<VOPProfile P, SDPatternOperator node> {
105 list<dag> ret3 = [(set P.DstVT:$vdst, (node P.Src0VT:$src0, P.Src1VT:$src1, P.Src2VT:$src2, i1:$clamp))];
106 list<dag> ret2 = [(set P.DstVT:$vdst, (node P.Src0VT:$src0, P.Src1VT:$src1, i1:$clamp))];
107 list<dag> ret1 = [(set P.DstVT:$vdst, (node P.Src0VT:$src0, i1:$clamp))];
108 list<dag> ret = !if(!eq(P.NumSrcArgs, 3), ret3,
109 !if(!eq(P.NumSrcArgs, 2), ret2,
113 class getVOP3MAIPat<VOPProfile P, SDPatternOperator node> {
114 list<dag> ret = [(set P.DstVT:$vdst, (node P.Src0VT:$src0, P.Src1VT:$src1, P.Src2VT:$src2,
115 timm:$cbsz, timm:$abid, timm:$blgp))];
118 class VOP3Inst<string OpName, VOPProfile P, SDPatternOperator node = null_frag, bit VOP3Only = 0> :
119 VOP3_Pseudo<OpName, P,
122 getVOP3OpSelModPat<P, node>.ret,
123 getVOP3OpSelPat<P, node>.ret),
125 getVOP3ModPat<P, node>.ret,
127 getVOP3ClampPat<P, node>.ret,
129 getVOP3MAIPat<P, node>.ret,
130 getVOP3Pat<P, node>.ret)))),
131 VOP3Only, 0, P.HasOpSel> {
133 let IntClamp = P.HasIntClamp;
134 let AsmMatchConverter =
137 !if(!or(P.HasModifiers, !or(P.HasOMod, P.HasIntClamp)),
142 // Special case for v_div_fmas_{f32|f64}, since it seems to be the
143 // only VOP instruction that implicitly reads VCC.
144 let Asm64 = " $vdst, $src0_modifiers, $src1_modifiers, $src2_modifiers$clamp$omod" in {
145 def VOP_F32_F32_F32_F32_VCC : VOPProfile<[f32, f32, f32, f32]> {
146 let Outs64 = (outs DstRC.RegClass:$vdst);
148 def VOP_F64_F64_F64_F64_VCC : VOPProfile<[f64, f64, f64, f64]> {
149 let Outs64 = (outs DstRC.RegClass:$vdst);
153 class VOP3Features<bit Clamp, bit OpSel, bit Packed, bit MAI> {
154 bit HasClamp = Clamp;
155 bit HasOpSel = OpSel;
156 bit IsPacked = Packed;
160 def VOP3_REGULAR : VOP3Features<0, 0, 0, 0>;
161 def VOP3_CLAMP : VOP3Features<1, 0, 0, 0>;
162 def VOP3_OPSEL : VOP3Features<1, 1, 0, 0>;
163 def VOP3_PACKED : VOP3Features<1, 1, 1, 0>;
164 def VOP3_MAI : VOP3Features<0, 0, 0, 1>;
166 class VOP3_Profile<VOPProfile P, VOP3Features Features = VOP3_REGULAR> : VOPProfile<P.ArgVT> {
168 let HasClamp = !if(Features.HasClamp, 1, P.HasClamp);
169 let HasOpSel = !if(Features.HasOpSel, 1, P.HasOpSel);
170 let IsMAI = !if(Features.IsMAI, 1, P.IsMAI);
171 let IsPacked = !if(Features.IsPacked, 1, P.IsPacked);
173 let HasModifiers = !if(Features.IsPacked, !if(Features.IsMAI, 0, 1), P.HasModifiers);
175 // FIXME: Hack to stop printing _e64
176 let Outs64 = (outs DstRC.RegClass:$vdst);
178 " " # !if(Features.HasOpSel,
179 getAsmVOP3OpSel<NumSrcArgs,
183 HasSrc2FloatMods>.ret,
184 !if(Features.HasClamp,
185 getAsm64<HasDst, NumSrcArgs, HasIntClamp,
186 HasModifiers, HasOMod, DstVT>.ret,
188 let NeedPatGen = P.NeedPatGen;
191 class VOP3b_Profile<ValueType vt> : VOPProfile<[vt, vt, vt, vt]> {
192 // v_div_scale_{f32|f64} do not support input modifiers.
193 let HasModifiers = 0;
196 let Outs64 = (outs DstRC:$vdst, VOPDstS64orS32:$sdst);
197 let Asm64 = " $vdst, $sdst, $src0, $src1, $src2";
200 def VOP3b_F32_I1_F32_F32_F32 : VOP3b_Profile<f32> {
201 // FIXME: Hack to stop printing _e64
202 let DstRC = RegisterOperand<VGPR_32>;
205 def VOP3b_F64_I1_F64_F64_F64 : VOP3b_Profile<f64> {
206 // FIXME: Hack to stop printing _e64
207 let DstRC = RegisterOperand<VReg_64>;
210 def VOP3b_I64_I1_I32_I32_I64 : VOPProfile<[i64, i32, i32, i64]> {
213 // FIXME: Hack to stop printing _e64
214 let DstRC = RegisterOperand<VReg_64>;
216 let Outs64 = (outs DstRC:$vdst, VOPDstS64orS32:$sdst);
217 let Asm64 = " $vdst, $sdst, $src0, $src1, $src2$clamp";
220 //===----------------------------------------------------------------------===//
222 //===----------------------------------------------------------------------===//
224 class VOP3Interp<string OpName, VOPProfile P, list<dag> pattern = []> :
225 VOP3_Pseudo<OpName, P, pattern> {
226 let AsmMatchConverter = "cvtVOP3Interp";
229 def VOP3_INTERP : VOPProfile<[f32, f32, i32, untyped]> {
230 let Ins64 = (ins Src0Mod:$src0_modifiers, VRegSrc_32:$src0,
231 Attr:$attr, AttrChan:$attrchan,
232 clampmod:$clamp, omod:$omod);
234 let Asm64 = "$vdst, $src0_modifiers, $attr$attrchan$clamp$omod";
237 def VOP3_INTERP_MOV : VOPProfile<[f32, i32, i32, untyped]> {
238 let Ins64 = (ins InterpSlot:$src0,
239 Attr:$attr, AttrChan:$attrchan,
240 clampmod:$clamp, omod:$omod);
242 let Asm64 = "$vdst, $src0, $attr$attrchan$clamp$omod";
247 class getInterp16Asm <bit HasSrc2, bit HasOMod> {
248 string src2 = !if(HasSrc2, ", $src2_modifiers", "");
249 string omod = !if(HasOMod, "$omod", "");
251 " $vdst, $src0_modifiers, $attr$attrchan"#src2#"$high$clamp"#omod;
254 class getInterp16Ins <bit HasSrc2, bit HasOMod,
255 Operand Src0Mod, Operand Src2Mod> {
256 dag ret = !if(HasSrc2,
258 (ins Src0Mod:$src0_modifiers, VRegSrc_32:$src0,
259 Attr:$attr, AttrChan:$attrchan,
260 Src2Mod:$src2_modifiers, VRegSrc_32:$src2,
261 highmod:$high, clampmod:$clamp, omod:$omod),
262 (ins Src0Mod:$src0_modifiers, VRegSrc_32:$src0,
263 Attr:$attr, AttrChan:$attrchan,
264 Src2Mod:$src2_modifiers, VRegSrc_32:$src2,
265 highmod:$high, clampmod:$clamp)
267 (ins Src0Mod:$src0_modifiers, VRegSrc_32:$src0,
268 Attr:$attr, AttrChan:$attrchan,
269 highmod:$high, clampmod:$clamp, omod:$omod)
273 class VOP3_INTERP16 <list<ValueType> ArgVT> : VOPProfile<ArgVT> {
275 let HasOMod = !if(!eq(DstVT.Value, f16.Value), 0, 1);
278 let Outs64 = (outs VGPR_32:$vdst);
279 let Ins64 = getInterp16Ins<HasSrc2, HasOMod, Src0Mod, Src2Mod>.ret;
280 let Asm64 = getInterp16Asm<HasSrc2, HasOMod>.ret;
283 //===----------------------------------------------------------------------===//
285 //===----------------------------------------------------------------------===//
287 let isCommutable = 1 in {
289 def V_MAD_LEGACY_F32 : VOP3Inst <"v_mad_legacy_f32", VOP3_Profile<VOP_F32_F32_F32_F32>>;
290 def V_MAD_F32 : VOP3Inst <"v_mad_f32", VOP3_Profile<VOP_F32_F32_F32_F32>, fmad>;
291 def V_MAD_I32_I24 : VOP3Inst <"v_mad_i32_i24", VOP3_Profile<VOP_I32_I32_I32_I32, VOP3_CLAMP>>;
292 def V_MAD_U32_U24 : VOP3Inst <"v_mad_u32_u24", VOP3_Profile<VOP_I32_I32_I32_I32, VOP3_CLAMP>>;
293 def V_FMA_F32 : VOP3Inst <"v_fma_f32", VOP3_Profile<VOP_F32_F32_F32_F32>, fma>;
294 def V_LERP_U8 : VOP3Inst <"v_lerp_u8", VOP3_Profile<VOP_I32_I32_I32_I32>, int_amdgcn_lerp>;
296 let SchedRW = [WriteDoubleAdd] in {
297 let FPDPRounding = 1 in {
298 def V_FMA_F64 : VOP3Inst <"v_fma_f64", VOP3_Profile<VOP_F64_F64_F64_F64>, fma>;
299 def V_ADD_F64 : VOP3Inst <"v_add_f64", VOP3_Profile<VOP_F64_F64_F64>, fadd, 1>;
300 def V_MUL_F64 : VOP3Inst <"v_mul_f64", VOP3_Profile<VOP_F64_F64_F64>, fmul, 1>;
301 } // End FPDPRounding = 1
302 def V_MIN_F64 : VOP3Inst <"v_min_f64", VOP3_Profile<VOP_F64_F64_F64>, fminnum_like, 1>;
303 def V_MAX_F64 : VOP3Inst <"v_max_f64", VOP3_Profile<VOP_F64_F64_F64>, fmaxnum_like, 1>;
304 } // End SchedRW = [WriteDoubleAdd]
306 let SchedRW = [WriteQuarterRate32] in {
307 def V_MUL_LO_U32 : VOP3Inst <"v_mul_lo_u32", VOP3_Profile<VOP_I32_I32_I32>, mul>;
308 def V_MUL_HI_U32 : VOP3Inst <"v_mul_hi_u32", VOP3_Profile<VOP_I32_I32_I32>, mulhu>;
309 def V_MUL_LO_I32 : VOP3Inst <"v_mul_lo_i32", VOP3_Profile<VOP_I32_I32_I32>>;
310 def V_MUL_HI_I32 : VOP3Inst <"v_mul_hi_i32", VOP3_Profile<VOP_I32_I32_I32>, mulhs>;
311 } // End SchedRW = [WriteQuarterRate32]
313 let Uses = [VCC, EXEC] in {
315 // result = src0 * src1 + src2
319 def V_DIV_FMAS_F32 : VOP3_Pseudo <"v_div_fmas_f32", VOP_F32_F32_F32_F32_VCC, []> {
320 let SchedRW = [WriteFloatFMA];
323 // result = src0 * src1 + src2
327 def V_DIV_FMAS_F64 : VOP3_Pseudo <"v_div_fmas_f64", VOP_F64_F64_F64_F64_VCC, []> {
328 let SchedRW = [WriteDouble];
329 let FPDPRounding = 1;
331 } // End Uses = [VCC, EXEC]
333 } // End isCommutable = 1
335 def V_CUBEID_F32 : VOP3Inst <"v_cubeid_f32", VOP3_Profile<VOP_F32_F32_F32_F32>, int_amdgcn_cubeid>;
336 def V_CUBESC_F32 : VOP3Inst <"v_cubesc_f32", VOP3_Profile<VOP_F32_F32_F32_F32>, int_amdgcn_cubesc>;
337 def V_CUBETC_F32 : VOP3Inst <"v_cubetc_f32", VOP3_Profile<VOP_F32_F32_F32_F32>, int_amdgcn_cubetc>;
338 def V_CUBEMA_F32 : VOP3Inst <"v_cubema_f32", VOP3_Profile<VOP_F32_F32_F32_F32>, int_amdgcn_cubema>;
339 def V_BFE_U32 : VOP3Inst <"v_bfe_u32", VOP3_Profile<VOP_I32_I32_I32_I32>, AMDGPUbfe_u32>;
340 def V_BFE_I32 : VOP3Inst <"v_bfe_i32", VOP3_Profile<VOP_I32_I32_I32_I32>, AMDGPUbfe_i32>;
341 def V_BFI_B32 : VOP3Inst <"v_bfi_b32", VOP3_Profile<VOP_I32_I32_I32_I32>, AMDGPUbfi>;
342 def V_ALIGNBIT_B32 : VOP3Inst <"v_alignbit_b32", VOP3_Profile<VOP_I32_I32_I32_I32>, int_amdgcn_alignbit>;
343 def V_ALIGNBYTE_B32 : VOP3Inst <"v_alignbyte_b32", VOP3_Profile<VOP_I32_I32_I32_I32>, int_amdgcn_alignbyte>;
344 def V_MIN3_F32 : VOP3Inst <"v_min3_f32", VOP3_Profile<VOP_F32_F32_F32_F32>, AMDGPUfmin3>;
345 def V_MIN3_I32 : VOP3Inst <"v_min3_i32", VOP3_Profile<VOP_I32_I32_I32_I32>, AMDGPUsmin3>;
346 def V_MIN3_U32 : VOP3Inst <"v_min3_u32", VOP3_Profile<VOP_I32_I32_I32_I32>, AMDGPUumin3>;
347 def V_MAX3_F32 : VOP3Inst <"v_max3_f32", VOP3_Profile<VOP_F32_F32_F32_F32>, AMDGPUfmax3>;
348 def V_MAX3_I32 : VOP3Inst <"v_max3_i32", VOP3_Profile<VOP_I32_I32_I32_I32>, AMDGPUsmax3>;
349 def V_MAX3_U32 : VOP3Inst <"v_max3_u32", VOP3_Profile<VOP_I32_I32_I32_I32>, AMDGPUumax3>;
350 def V_MED3_F32 : VOP3Inst <"v_med3_f32", VOP3_Profile<VOP_F32_F32_F32_F32>, AMDGPUfmed3>;
351 def V_MED3_I32 : VOP3Inst <"v_med3_i32", VOP3_Profile<VOP_I32_I32_I32_I32>, AMDGPUsmed3>;
352 def V_MED3_U32 : VOP3Inst <"v_med3_u32", VOP3_Profile<VOP_I32_I32_I32_I32>, AMDGPUumed3>;
353 def V_SAD_U8 : VOP3Inst <"v_sad_u8", VOP3_Profile<VOP_I32_I32_I32_I32, VOP3_CLAMP>>;
354 def V_SAD_HI_U8 : VOP3Inst <"v_sad_hi_u8", VOP3_Profile<VOP_I32_I32_I32_I32, VOP3_CLAMP>>;
355 def V_SAD_U16 : VOP3Inst <"v_sad_u16", VOP3_Profile<VOP_I32_I32_I32_I32, VOP3_CLAMP>>;
356 def V_SAD_U32 : VOP3Inst <"v_sad_u32", VOP3_Profile<VOP_I32_I32_I32_I32, VOP3_CLAMP>>;
357 def V_CVT_PK_U8_F32 : VOP3Inst<"v_cvt_pk_u8_f32", VOP3_Profile<VOP_I32_F32_I32_I32>, int_amdgcn_cvt_pk_u8_f32>;
358 def V_DIV_FIXUP_F32 : VOP3Inst <"v_div_fixup_f32", VOP3_Profile<VOP_F32_F32_F32_F32>, AMDGPUdiv_fixup>;
360 let SchedRW = [WriteDoubleAdd], FPDPRounding = 1 in {
361 def V_DIV_FIXUP_F64 : VOP3Inst <"v_div_fixup_f64", VOP3_Profile<VOP_F64_F64_F64_F64>, AMDGPUdiv_fixup>;
362 def V_LDEXP_F64 : VOP3Inst <"v_ldexp_f64", VOP3_Profile<VOP_F64_F64_I32>, AMDGPUldexp, 1>;
363 } // End SchedRW = [WriteDoubleAdd], FPDPRounding = 1
365 def V_DIV_SCALE_F32 : VOP3_Pseudo <"v_div_scale_f32", VOP3b_F32_I1_F32_F32_F32, [], 1> {
366 let SchedRW = [WriteFloatFMA, WriteSALU];
367 let AsmMatchConverter = "";
370 // Double precision division pre-scale.
371 def V_DIV_SCALE_F64 : VOP3_Pseudo <"v_div_scale_f64", VOP3b_F64_I1_F64_F64_F64, [], 1> {
372 let SchedRW = [WriteDouble, WriteSALU];
373 let AsmMatchConverter = "";
374 let FPDPRounding = 1;
377 def V_MSAD_U8 : VOP3Inst <"v_msad_u8", VOP3_Profile<VOP_I32_I32_I32_I32, VOP3_CLAMP>>;
379 let Constraints = "@earlyclobber $vdst" in {
380 def V_MQSAD_PK_U16_U8 : VOP3Inst <"v_mqsad_pk_u16_u8", VOP3_Profile<VOP_I64_I64_I32_I64, VOP3_CLAMP>>;
381 } // End Constraints = "@earlyclobber $vdst"
383 def V_TRIG_PREOP_F64 : VOP3Inst <"v_trig_preop_f64", VOP3_Profile<VOP_F64_F64_I32>, AMDGPUtrig_preop> {
384 let SchedRW = [WriteDouble];
387 let SchedRW = [Write64Bit] in {
388 let SubtargetPredicate = isGFX6GFX7GFX10 in {
389 def V_LSHL_B64 : VOP3Inst <"v_lshl_b64", VOP3_Profile<VOP_I64_I64_I32>, shl>;
390 def V_LSHR_B64 : VOP3Inst <"v_lshr_b64", VOP3_Profile<VOP_I64_I64_I32>, srl>;
391 def V_ASHR_I64 : VOP3Inst <"v_ashr_i64", VOP3_Profile<VOP_I64_I64_I32>, sra>;
392 def V_MULLIT_F32 : VOP3Inst <"v_mullit_f32", VOP3_Profile<VOP_F32_F32_F32_F32>>;
393 } // End SubtargetPredicate = isGFX6GFX7GFX10
395 let SubtargetPredicate = isGFX8Plus in {
396 def V_LSHLREV_B64 : VOP3Inst <"v_lshlrev_b64", VOP3_Profile<VOP_I64_I32_I64>, lshl_rev>;
397 def V_LSHRREV_B64 : VOP3Inst <"v_lshrrev_b64", VOP3_Profile<VOP_I64_I32_I64>, lshr_rev>;
398 def V_ASHRREV_I64 : VOP3Inst <"v_ashrrev_i64", VOP3_Profile<VOP_I64_I32_I64>, ashr_rev>;
399 } // End SubtargetPredicate = isGFX8Plus
400 } // End SchedRW = [Write64Bit]
403 let SchedRW = [Write32Bit] in {
404 let SubtargetPredicate = isGFX8Plus in {
405 def V_PERM_B32 : VOP3Inst <"v_perm_b32", VOP3_Profile<VOP_I32_I32_I32_I32>, AMDGPUperm>;
406 } // End SubtargetPredicate = isGFX8Plus
407 } // End SchedRW = [Write32Bit]
409 let SubtargetPredicate = isGFX7Plus in {
411 let Constraints = "@earlyclobber $vdst", SchedRW = [WriteQuarterRate32] in {
412 def V_QSAD_PK_U16_U8 : VOP3Inst <"v_qsad_pk_u16_u8", VOP3_Profile<VOP_I64_I64_I32_I64, VOP3_CLAMP>>;
413 def V_MQSAD_U32_U8 : VOP3Inst <"v_mqsad_u32_u8", VOP3_Profile<VOP_V4I32_I64_I32_V4I32, VOP3_CLAMP>>;
414 } // End Constraints = "@earlyclobber $vdst", SchedRW = [WriteQuarterRate32]
416 let isCommutable = 1 in {
417 let SchedRW = [WriteQuarterRate32, WriteSALU] in {
418 def V_MAD_U64_U32 : VOP3Inst <"v_mad_u64_u32", VOP3b_I64_I1_I32_I32_I64>;
419 def V_MAD_I64_I32 : VOP3Inst <"v_mad_i64_i32", VOP3b_I64_I1_I32_I32_I64>;
420 } // End SchedRW = [WriteDouble, WriteSALU]
421 } // End isCommutable = 1
423 } // End SubtargetPredicate = isGFX7Plus
426 def V_DIV_FIXUP_F16 : VOP3Inst <"v_div_fixup_f16", VOP3_Profile<VOP_F16_F16_F16_F16>, AMDGPUdiv_fixup> {
427 let Predicates = [Has16BitInsts, isGFX8Only];
428 let FPDPRounding = 1;
430 def V_DIV_FIXUP_F16_gfx9 : VOP3Inst <"v_div_fixup_f16_gfx9",
431 VOP3_Profile<VOP_F16_F16_F16_F16, VOP3_OPSEL>, AMDGPUdiv_fixup> {
432 let renamedInGFX9 = 1;
433 let Predicates = [Has16BitInsts, isGFX9Plus];
434 let FPDPRounding = 1;
437 def V_FMA_F16 : VOP3Inst <"v_fma_f16", VOP3_Profile<VOP_F16_F16_F16_F16>, fma> {
438 let Predicates = [Has16BitInsts, isGFX8Only];
439 let FPDPRounding = 1;
441 def V_FMA_F16_gfx9 : VOP3Inst <"v_fma_f16_gfx9", VOP3_Profile<VOP_F16_F16_F16_F16, VOP3_OPSEL>, fma> {
442 let renamedInGFX9 = 1;
443 let Predicates = [Has16BitInsts, isGFX9Plus];
444 let FPDPRounding = 1;
447 let SubtargetPredicate = Has16BitInsts, isCommutable = 1 in {
449 let renamedInGFX9 = 1 in {
450 def V_MAD_U16 : VOP3Inst <"v_mad_u16", VOP3_Profile<VOP_I16_I16_I16_I16, VOP3_CLAMP>>;
451 def V_MAD_I16 : VOP3Inst <"v_mad_i16", VOP3_Profile<VOP_I16_I16_I16_I16, VOP3_CLAMP>>;
452 let FPDPRounding = 1 in {
453 def V_MAD_F16 : VOP3Inst <"v_mad_f16", VOP3_Profile<VOP_F16_F16_F16_F16>, fmad>;
454 let Uses = [M0, EXEC] in {
455 def V_INTERP_P2_F16 : VOP3Interp <"v_interp_p2_f16", VOP3_INTERP16<[f16, f32, i32, f32]>,
456 [(set f16:$vdst, (AMDGPUinterp_p2_f16 f32:$src0, (i32 timm:$attrchan),
458 (i32 timm:$src0_modifiers),
459 (f32 VRegSrc_32:$src2),
460 (i32 timm:$src2_modifiers),
462 (i1 timm:$clamp)))]>;
463 } // End Uses = [M0, EXEC]
464 } // End FPDPRounding = 1
465 } // End renamedInGFX9 = 1
467 let SubtargetPredicate = isGFX9Only in {
468 def V_MAD_F16_gfx9 : VOP3Inst <"v_mad_f16_gfx9", VOP3_Profile<VOP_F16_F16_F16_F16, VOP3_OPSEL>> {
469 let FPDPRounding = 1;
471 } // End SubtargetPredicate = isGFX9Only
473 let SubtargetPredicate = isGFX9Plus in {
474 def V_MAD_U16_gfx9 : VOP3Inst <"v_mad_u16_gfx9", VOP3_Profile<VOP_I16_I16_I16_I16, VOP3_OPSEL>>;
475 def V_MAD_I16_gfx9 : VOP3Inst <"v_mad_i16_gfx9", VOP3_Profile<VOP_I16_I16_I16_I16, VOP3_OPSEL>>;
476 def V_INTERP_P2_F16_gfx9 : VOP3Interp <"v_interp_p2_f16_gfx9", VOP3_INTERP16<[f16, f32, i32, f32]>>;
477 } // End SubtargetPredicate = isGFX9Plus
479 let Uses = [M0, EXEC], FPDPRounding = 1 in {
480 def V_INTERP_P1LL_F16 : VOP3Interp <"v_interp_p1ll_f16", VOP3_INTERP16<[f32, f32, i32, untyped]>,
481 [(set f32:$vdst, (AMDGPUinterp_p1ll_f16 f32:$src0, (i32 timm:$attrchan),
483 (i32 timm:$src0_modifiers),
486 (i32 timm:$omod)))]>;
487 def V_INTERP_P1LV_F16 : VOP3Interp <"v_interp_p1lv_f16", VOP3_INTERP16<[f32, f32, i32, f16]>,
488 [(set f32:$vdst, (AMDGPUinterp_p1lv_f16 f32:$src0, (i32 timm:$attrchan),
490 (i32 timm:$src0_modifiers),
491 (f32 VRegSrc_32:$src2),
492 (i32 timm:$src2_modifiers),
495 (i32 timm:$omod)))]>;
496 } // End Uses = [M0, EXEC], FPDPRounding = 1
498 } // End SubtargetPredicate = Has16BitInsts, isCommutable = 1
500 let SubtargetPredicate = isGFX8GFX9 in {
501 def V_INTERP_P1_F32_e64 : VOP3Interp <"v_interp_p1_f32", VOP3_INTERP>;
502 def V_INTERP_P2_F32_e64 : VOP3Interp <"v_interp_p2_f32", VOP3_INTERP>;
503 def V_INTERP_MOV_F32_e64 : VOP3Interp <"v_interp_mov_f32", VOP3_INTERP_MOV>;
504 } // End SubtargetPredicate = isGFX8GFX9
506 let Predicates = [Has16BitInsts, isGFX6GFX7GFX8GFX9] in {
508 multiclass Ternary_i16_Pats <SDPatternOperator op1, SDPatternOperator op2,
509 Instruction inst, SDPatternOperator op3> {
511 (op2 (op1 i16:$src0, i16:$src1), i16:$src2),
512 (inst i16:$src0, i16:$src1, i16:$src2, (i1 0))
517 defm: Ternary_i16_Pats<mul, add, V_MAD_U16, zext>;
518 defm: Ternary_i16_Pats<mul, add, V_MAD_I16, sext>;
520 } // End Predicates = [Has16BitInsts, isGFX6GFX7GFX8GFX9]
522 let Predicates = [Has16BitInsts, isGFX10Plus] in {
524 multiclass Ternary_i16_Pats_gfx9<SDPatternOperator op1, SDPatternOperator op2,
525 Instruction inst, SDPatternOperator op3> {
527 (op2 (op1 i16:$src0, i16:$src1), i16:$src2),
528 (inst SRCMODS.NONE, $src0, SRCMODS.NONE, $src1, SRCMODS.NONE, $src2, DSTCLAMP.NONE)
533 defm: Ternary_i16_Pats_gfx9<mul, add, V_MAD_U16_gfx9, zext>;
534 defm: Ternary_i16_Pats_gfx9<mul, add, V_MAD_I16_gfx9, sext>;
536 } // End Predicates = [Has16BitInsts, isGFX10Plus]
538 class ThreeOpFrag<SDPatternOperator op1, SDPatternOperator op2> : PatFrag<
539 (ops node:$x, node:$y, node:$z),
540 // When the inner operation is used multiple times, selecting 3-op
541 // instructions may still be beneficial -- if the other users can be
542 // combined similarly. Let's be conservative for now.
543 (op2 (HasOneUseBinOp<op1> node:$x, node:$y), node:$z),
545 // Only use VALU ops when the result is divergent.
546 if (!N->isDivergent())
549 // Check constant bus limitations.
551 // Note: Use !isDivergent as a conservative proxy for whether the value
552 // is in an SGPR (uniform values can end up in VGPRs as well).
553 unsigned ConstantBusUses = 0;
554 for (unsigned i = 0; i < 3; ++i) {
555 if (!Operands[i]->isDivergent() &&
556 !isInlineImmediate(Operands[i].getNode())) {
558 // This uses AMDGPU::V_ADD3_U32, but all three operand instructions
559 // have the same constant bus limit.
560 if (ConstantBusUses > Subtarget->getConstantBusLimit(AMDGPU::V_ADD3_U32))
568 let PredicateCodeUsesOperands = 1;
571 let SubtargetPredicate = isGFX9Plus in {
572 def V_PACK_B32_F16 : VOP3Inst <"v_pack_b32_f16", VOP3_Profile<VOP_B32_F16_F16, VOP3_OPSEL>>;
573 def V_LSHL_ADD_U32 : VOP3Inst <"v_lshl_add_u32", VOP3_Profile<VOP_I32_I32_I32_I32>>;
574 def V_ADD_LSHL_U32 : VOP3Inst <"v_add_lshl_u32", VOP3_Profile<VOP_I32_I32_I32_I32>>;
575 def V_ADD3_U32 : VOP3Inst <"v_add3_u32", VOP3_Profile<VOP_I32_I32_I32_I32>>;
576 def V_LSHL_OR_B32 : VOP3Inst <"v_lshl_or_b32", VOP3_Profile<VOP_I32_I32_I32_I32>>;
577 def V_AND_OR_B32 : VOP3Inst <"v_and_or_b32", VOP3_Profile<VOP_I32_I32_I32_I32>>;
578 def V_OR3_B32 : VOP3Inst <"v_or3_b32", VOP3_Profile<VOP_I32_I32_I32_I32>>;
580 def V_XAD_U32 : VOP3Inst <"v_xad_u32", VOP3_Profile<VOP_I32_I32_I32_I32>>;
582 def V_MED3_F16 : VOP3Inst <"v_med3_f16", VOP3_Profile<VOP_F16_F16_F16_F16, VOP3_OPSEL>, AMDGPUfmed3>;
583 def V_MED3_I16 : VOP3Inst <"v_med3_i16", VOP3_Profile<VOP_I16_I16_I16_I16, VOP3_OPSEL>, AMDGPUsmed3>;
584 def V_MED3_U16 : VOP3Inst <"v_med3_u16", VOP3_Profile<VOP_I16_I16_I16_I16, VOP3_OPSEL>, AMDGPUumed3>;
586 def V_MIN3_F16 : VOP3Inst <"v_min3_f16", VOP3_Profile<VOP_F16_F16_F16_F16, VOP3_OPSEL>, AMDGPUfmin3>;
587 def V_MIN3_I16 : VOP3Inst <"v_min3_i16", VOP3_Profile<VOP_I16_I16_I16_I16, VOP3_OPSEL>, AMDGPUsmin3>;
588 def V_MIN3_U16 : VOP3Inst <"v_min3_u16", VOP3_Profile<VOP_I16_I16_I16_I16, VOP3_OPSEL>, AMDGPUumin3>;
590 def V_MAX3_F16 : VOP3Inst <"v_max3_f16", VOP3_Profile<VOP_F16_F16_F16_F16, VOP3_OPSEL>, AMDGPUfmax3>;
591 def V_MAX3_I16 : VOP3Inst <"v_max3_i16", VOP3_Profile<VOP_I16_I16_I16_I16, VOP3_OPSEL>, AMDGPUsmax3>;
592 def V_MAX3_U16 : VOP3Inst <"v_max3_u16", VOP3_Profile<VOP_I16_I16_I16_I16, VOP3_OPSEL>, AMDGPUumax3>;
594 def V_ADD_I16 : VOP3Inst <"v_add_i16", VOP3_Profile<VOP_I16_I16_I16, VOP3_OPSEL>>;
595 def V_SUB_I16 : VOP3Inst <"v_sub_i16", VOP3_Profile<VOP_I16_I16_I16, VOP3_OPSEL>>;
597 def V_MAD_U32_U16 : VOP3Inst <"v_mad_u32_u16", VOP3_Profile<VOP_I32_I16_I16_I32, VOP3_OPSEL>>;
598 def V_MAD_I32_I16 : VOP3Inst <"v_mad_i32_i16", VOP3_Profile<VOP_I32_I16_I16_I32, VOP3_OPSEL>>;
600 def V_CVT_PKNORM_I16_F16 : VOP3Inst <"v_cvt_pknorm_i16_f16", VOP3_Profile<VOP_B32_F16_F16, VOP3_OPSEL>>;
601 def V_CVT_PKNORM_U16_F16 : VOP3Inst <"v_cvt_pknorm_u16_f16", VOP3_Profile<VOP_B32_F16_F16, VOP3_OPSEL>>;
603 def V_ADD_I32_gfx9 : VOP3Inst <"v_add_i32_gfx9", VOP3_Profile<VOP_I32_I32_I32>>;
604 def V_SUB_I32_gfx9 : VOP3Inst <"v_sub_i32_gfx9", VOP3_Profile<VOP_I32_I32_I32>>;
607 class ThreeOp_i32_Pats <SDPatternOperator op1, SDPatternOperator op2, Instruction inst> : GCNPat <
608 // This matches (op2 (op1 i32:$src0, i32:$src1), i32:$src2) with conditions.
609 (ThreeOpFrag<op1, op2> i32:$src0, i32:$src1, i32:$src2),
610 (inst i32:$src0, i32:$src1, i32:$src2)
613 def : ThreeOp_i32_Pats<shl, add, V_LSHL_ADD_U32>;
614 def : ThreeOp_i32_Pats<add, shl, V_ADD_LSHL_U32>;
615 def : ThreeOp_i32_Pats<add, add, V_ADD3_U32>;
616 def : ThreeOp_i32_Pats<shl, or, V_LSHL_OR_B32>;
617 def : ThreeOp_i32_Pats<and, or, V_AND_OR_B32>;
618 def : ThreeOp_i32_Pats<or, or, V_OR3_B32>;
619 def : ThreeOp_i32_Pats<xor, add, V_XAD_U32>;
621 } // End SubtargetPredicate = isGFX9Plus
623 def VOP3_PERMLANE_Profile : VOP3_Profile<VOPProfile <[i32, i32, i32, i32]>, VOP3_OPSEL> {
624 let Src0RC64 = VRegSrc_32;
625 let Src1RC64 = SCSrc_b32;
626 let Src2RC64 = SCSrc_b32;
627 let InsVOP3OpSel = (ins IntOpSelMods:$src0_modifiers, VRegSrc_32:$src0,
628 IntOpSelMods:$src1_modifiers, SCSrc_b32:$src1,
629 IntOpSelMods:$src2_modifiers, SCSrc_b32:$src2,
630 VGPR_32:$vdst_in, op_sel:$op_sel);
635 let SubtargetPredicate = isGFX10Plus in {
636 def V_XOR3_B32 : VOP3Inst <"v_xor3_b32", VOP3_Profile<VOP_I32_I32_I32_I32>>;
637 def : ThreeOp_i32_Pats<xor, xor, V_XOR3_B32>;
639 let Constraints = "$vdst = $vdst_in", DisableEncoding="$vdst_in" in {
640 def V_PERMLANE16_B32 : VOP3Inst <"v_permlane16_b32", VOP3_PERMLANE_Profile>;
641 def V_PERMLANEX16_B32 : VOP3Inst <"v_permlanex16_b32", VOP3_PERMLANE_Profile>;
642 } // End $vdst = $vdst_in, DisableEncoding $vdst_in
645 (int_amdgcn_permlane16 i32:$vdst_in, i32:$src0, i32:$src1, i32:$src2, timm:$fi, timm:$bc),
646 (V_PERMLANE16_B32 (as_i1imm $fi), $src0, (as_i1imm $bc), $src1, 0, $src2, $vdst_in)
649 (int_amdgcn_permlanex16 i32:$vdst_in, i32:$src0, i32:$src1, i32:$src2, timm:$fi, timm:$bc),
650 (V_PERMLANEX16_B32 (as_i1imm $fi), $src0, (as_i1imm $bc), $src1, 0, $src2, $vdst_in)
652 } // End SubtargetPredicate = isGFX10Plus
654 //===----------------------------------------------------------------------===//
655 // Integer Clamp Patterns
656 //===----------------------------------------------------------------------===//
658 class getClampPat<VOPProfile P, SDPatternOperator node> {
659 dag ret3 = (P.DstVT (node P.Src0VT:$src0, P.Src1VT:$src1, P.Src2VT:$src2));
660 dag ret2 = (P.DstVT (node P.Src0VT:$src0, P.Src1VT:$src1));
661 dag ret1 = (P.DstVT (node P.Src0VT:$src0));
662 dag ret = !if(!eq(P.NumSrcArgs, 3), ret3,
663 !if(!eq(P.NumSrcArgs, 2), ret2,
667 class getClampRes<VOPProfile P, Instruction inst> {
668 dag ret3 = (inst P.Src0VT:$src0, P.Src1VT:$src1, P.Src2VT:$src2, (i1 0));
669 dag ret2 = (inst P.Src0VT:$src0, P.Src1VT:$src1, (i1 0));
670 dag ret1 = (inst P.Src0VT:$src0, (i1 0));
671 dag ret = !if(!eq(P.NumSrcArgs, 3), ret3,
672 !if(!eq(P.NumSrcArgs, 2), ret2,
676 class IntClampPat<VOP3Inst inst, SDPatternOperator node> : GCNPat<
677 getClampPat<inst.Pfl, node>.ret,
678 getClampRes<inst.Pfl, inst>.ret
681 def : IntClampPat<V_MAD_I32_I24, AMDGPUmad_i24>;
682 def : IntClampPat<V_MAD_U32_U24, AMDGPUmad_u24>;
684 def : IntClampPat<V_SAD_U8, int_amdgcn_sad_u8>;
685 def : IntClampPat<V_SAD_HI_U8, int_amdgcn_sad_hi_u8>;
686 def : IntClampPat<V_SAD_U16, int_amdgcn_sad_u16>;
688 def : IntClampPat<V_MSAD_U8, int_amdgcn_msad_u8>;
689 def : IntClampPat<V_MQSAD_PK_U16_U8, int_amdgcn_mqsad_pk_u16_u8>;
691 def : IntClampPat<V_QSAD_PK_U16_U8, int_amdgcn_qsad_pk_u16_u8>;
692 def : IntClampPat<V_MQSAD_U32_U8, int_amdgcn_mqsad_u32_u8>;
695 //===----------------------------------------------------------------------===//
696 // Target-specific instruction encodings.
697 //===----------------------------------------------------------------------===//
699 //===----------------------------------------------------------------------===//
701 //===----------------------------------------------------------------------===//
703 let AssemblerPredicate = isGFX10Plus, DecoderNamespace = "GFX10" in {
704 multiclass VOP3_Real_gfx10<bits<10> op> {
706 VOP3_Real<!cast<VOP_Pseudo>(NAME), SIEncodingFamily.GFX10>,
707 VOP3e_gfx10<op, !cast<VOP_Pseudo>(NAME).Pfl>;
709 multiclass VOP3_Real_gfx10_with_name<bits<10> op, string opName,
712 VOP3_Real<!cast<VOP3_Pseudo>(opName), SIEncodingFamily.GFX10>,
713 VOP3e_gfx10<op, !cast<VOP3_Pseudo>(opName).Pfl> {
714 VOP3_Pseudo ps = !cast<VOP3_Pseudo>(opName);
715 let AsmString = asmName # ps.AsmOperands;
718 multiclass VOP3be_Real_gfx10<bits<10> op> {
720 VOP3_Real<!cast<VOP3_Pseudo>(NAME), SIEncodingFamily.GFX10>,
721 VOP3be_gfx10<op, !cast<VOP3_Pseudo>(NAME).Pfl>;
723 multiclass VOP3Interp_Real_gfx10<bits<10> op> {
725 VOP3_Real<!cast<VOP3_Pseudo>(NAME), SIEncodingFamily.GFX10>,
726 VOP3Interp_gfx10<op, !cast<VOP3_Pseudo>(NAME).Pfl>;
728 multiclass VOP3OpSel_Real_gfx10<bits<10> op> {
730 VOP3_Real<!cast<VOP3_Pseudo>(NAME), SIEncodingFamily.GFX10>,
731 VOP3OpSel_gfx10<op, !cast<VOP3_Pseudo>(NAME).Pfl>;
733 multiclass VOP3OpSel_Real_gfx10_with_name<bits<10> op, string opName,
736 VOP3_Real<!cast<VOP3_Pseudo>(opName), SIEncodingFamily.GFX10>,
737 VOP3OpSel_gfx10<op, !cast<VOP3_Pseudo>(opName).Pfl> {
738 VOP3_Pseudo ps = !cast<VOP3_Pseudo>(opName);
739 let AsmString = asmName # ps.AsmOperands;
742 } // End AssemblerPredicate = isGFX10Plus, DecoderNamespace = "GFX10"
744 defm V_READLANE_B32 : VOP3_Real_gfx10<0x360>;
746 let InOperandList = (ins SSrcOrLds_b32:$src0, SCSrc_b32:$src1, VSrc_b32:$vdst_in) in {
747 defm V_WRITELANE_B32 : VOP3_Real_gfx10<0x361>;
748 } // End InOperandList = (ins SSrcOrLds_b32:$src0, SCSrc_b32:$src1, VSrc_b32:$vdst_in)
750 defm V_XOR3_B32 : VOP3_Real_gfx10<0x178>;
751 defm V_LSHLREV_B64 : VOP3_Real_gfx10<0x2ff>;
752 defm V_LSHRREV_B64 : VOP3_Real_gfx10<0x300>;
753 defm V_ASHRREV_I64 : VOP3_Real_gfx10<0x301>;
754 defm V_PERM_B32 : VOP3_Real_gfx10<0x344>;
755 defm V_XAD_U32 : VOP3_Real_gfx10<0x345>;
756 defm V_LSHL_ADD_U32 : VOP3_Real_gfx10<0x346>;
757 defm V_ADD_LSHL_U32 : VOP3_Real_gfx10<0x347>;
758 defm V_ADD3_U32 : VOP3_Real_gfx10<0x36d>;
759 defm V_LSHL_OR_B32 : VOP3_Real_gfx10<0x36f>;
760 defm V_AND_OR_B32 : VOP3_Real_gfx10<0x371>;
761 defm V_OR3_B32 : VOP3_Real_gfx10<0x372>;
763 // TODO-GFX10: add MC tests for v_add/sub_nc_i16
765 VOP3OpSel_Real_gfx10_with_name<0x30d, "V_ADD_I16", "v_add_nc_i16">;
767 VOP3OpSel_Real_gfx10_with_name<0x30e, "V_SUB_I16", "v_sub_nc_i16">;
769 VOP3_Real_gfx10_with_name<0x376, "V_SUB_I32_gfx9", "v_sub_nc_i32">;
771 VOP3_Real_gfx10_with_name<0x37f, "V_ADD_I32_gfx9", "v_add_nc_i32">;
773 defm V_INTERP_P1LL_F16 : VOP3Interp_Real_gfx10<0x342>;
774 defm V_INTERP_P1LV_F16 : VOP3Interp_Real_gfx10<0x343>;
775 defm V_INTERP_P2_F16 : VOP3Interp_Real_gfx10<0x35a>;
777 defm V_PACK_B32_F16 : VOP3OpSel_Real_gfx10<0x311>;
778 defm V_CVT_PKNORM_I16_F16 : VOP3OpSel_Real_gfx10<0x312>;
779 defm V_CVT_PKNORM_U16_F16 : VOP3OpSel_Real_gfx10<0x313>;
781 defm V_MIN3_F16 : VOP3OpSel_Real_gfx10<0x351>;
782 defm V_MIN3_I16 : VOP3OpSel_Real_gfx10<0x352>;
783 defm V_MIN3_U16 : VOP3OpSel_Real_gfx10<0x353>;
784 defm V_MAX3_F16 : VOP3OpSel_Real_gfx10<0x354>;
785 defm V_MAX3_I16 : VOP3OpSel_Real_gfx10<0x355>;
786 defm V_MAX3_U16 : VOP3OpSel_Real_gfx10<0x356>;
787 defm V_MED3_F16 : VOP3OpSel_Real_gfx10<0x357>;
788 defm V_MED3_I16 : VOP3OpSel_Real_gfx10<0x358>;
789 defm V_MED3_U16 : VOP3OpSel_Real_gfx10<0x359>;
790 defm V_MAD_U32_U16 : VOP3OpSel_Real_gfx10<0x373>;
791 defm V_MAD_I32_I16 : VOP3OpSel_Real_gfx10<0x375>;
794 VOP3OpSel_Real_gfx10_with_name<0x340, "V_MAD_U16_gfx9", "v_mad_u16">;
796 VOP3OpSel_Real_gfx10_with_name<0x34b, "V_FMA_F16_gfx9", "v_fma_f16">;
798 VOP3OpSel_Real_gfx10_with_name<0x35e, "V_MAD_I16_gfx9", "v_mad_i16">;
799 defm V_DIV_FIXUP_F16 :
800 VOP3OpSel_Real_gfx10_with_name<0x35f, "V_DIV_FIXUP_F16_gfx9", "v_div_fixup_f16">;
802 // FIXME-GFX10-OPSEL: Need to add "selective" opsel support to some of these
803 // (they do not support SDWA or DPP).
804 defm V_ADD_NC_U16 : VOP3_Real_gfx10_with_name<0x303, "V_ADD_U16_e64", "v_add_nc_u16">;
805 defm V_SUB_NC_U16 : VOP3_Real_gfx10_with_name<0x304, "V_SUB_U16_e64", "v_sub_nc_u16">;
806 defm V_MUL_LO_U16 : VOP3_Real_gfx10_with_name<0x305, "V_MUL_LO_U16_e64", "v_mul_lo_u16">;
807 defm V_LSHRREV_B16 : VOP3_Real_gfx10_with_name<0x307, "V_LSHRREV_B16_e64", "v_lshrrev_b16">;
808 defm V_ASHRREV_I16 : VOP3_Real_gfx10_with_name<0x308, "V_ASHRREV_I16_e64", "v_ashrrev_i16">;
809 defm V_MAX_U16 : VOP3_Real_gfx10_with_name<0x309, "V_MAX_U16_e64", "v_max_u16">;
810 defm V_MAX_I16 : VOP3_Real_gfx10_with_name<0x30a, "V_MAX_I16_e64", "v_max_i16">;
811 defm V_MIN_U16 : VOP3_Real_gfx10_with_name<0x30b, "V_MIN_U16_e64", "v_min_u16">;
812 defm V_MIN_I16 : VOP3_Real_gfx10_with_name<0x30c, "V_MIN_I16_e64", "v_min_i16">;
813 defm V_LSHLREV_B16 : VOP3_Real_gfx10_with_name<0x314, "V_LSHLREV_B16_e64", "v_lshlrev_b16">;
814 defm V_PERMLANE16_B32 : VOP3OpSel_Real_gfx10<0x377>;
815 defm V_PERMLANEX16_B32 : VOP3OpSel_Real_gfx10<0x378>;
817 //===----------------------------------------------------------------------===//
819 //===----------------------------------------------------------------------===//
821 let AssemblerPredicate = isGFX7Only, DecoderNamespace = "GFX7" in {
822 multiclass VOP3_Real_gfx7<bits<10> op> {
824 VOP3_Real<!cast<VOP3_Pseudo>(NAME), SIEncodingFamily.SI>,
825 VOP3e_gfx6_gfx7<op{8-0}, !cast<VOP3_Pseudo>(NAME).Pfl>;
827 multiclass VOP3be_Real_gfx7<bits<10> op> {
829 VOP3_Real<!cast<VOP3_Pseudo>(NAME), SIEncodingFamily.SI>,
830 VOP3be_gfx6_gfx7<op{8-0}, !cast<VOP3_Pseudo>(NAME).Pfl>;
832 } // End AssemblerPredicate = isGFX7Only, DecoderNamespace = "GFX7"
834 multiclass VOP3_Real_gfx7_gfx10<bits<10> op> :
835 VOP3_Real_gfx7<op>, VOP3_Real_gfx10<op>;
837 multiclass VOP3be_Real_gfx7_gfx10<bits<10> op> :
838 VOP3be_Real_gfx7<op>, VOP3be_Real_gfx10<op>;
840 defm V_QSAD_PK_U16_U8 : VOP3_Real_gfx7_gfx10<0x172>;
841 defm V_MQSAD_U32_U8 : VOP3_Real_gfx7_gfx10<0x175>;
842 defm V_MAD_U64_U32 : VOP3be_Real_gfx7_gfx10<0x176>;
843 defm V_MAD_I64_I32 : VOP3be_Real_gfx7_gfx10<0x177>;
845 //===----------------------------------------------------------------------===//
846 // GFX6, GFX7, GFX10.
847 //===----------------------------------------------------------------------===//
849 let AssemblerPredicate = isGFX6GFX7, DecoderNamespace = "GFX6GFX7" in {
850 multiclass VOP3_Real_gfx6_gfx7<bits<10> op> {
852 VOP3_Real<!cast<VOP3_Pseudo>(NAME), SIEncodingFamily.SI>,
853 VOP3e_gfx6_gfx7<op{8-0}, !cast<VOP3_Pseudo>(NAME).Pfl>;
855 multiclass VOP3be_Real_gfx6_gfx7<bits<10> op> {
857 VOP3_Real<!cast<VOP3_Pseudo>(NAME), SIEncodingFamily.SI>,
858 VOP3be_gfx6_gfx7<op{8-0}, !cast<VOP3_Pseudo>(NAME).Pfl>;
860 } // End AssemblerPredicate = isGFX6GFX7, DecoderNamespace = "GFX6GFX7"
862 multiclass VOP3_Real_gfx6_gfx7_gfx10<bits<10> op> :
863 VOP3_Real_gfx6_gfx7<op>, VOP3_Real_gfx10<op>;
865 multiclass VOP3be_Real_gfx6_gfx7_gfx10<bits<10> op> :
866 VOP3be_Real_gfx6_gfx7<op>, VOP3be_Real_gfx10<op>;
868 defm V_LSHL_B64 : VOP3_Real_gfx6_gfx7<0x161>;
869 defm V_LSHR_B64 : VOP3_Real_gfx6_gfx7<0x162>;
870 defm V_ASHR_I64 : VOP3_Real_gfx6_gfx7<0x163>;
872 defm V_MAD_LEGACY_F32 : VOP3_Real_gfx6_gfx7_gfx10<0x140>;
873 defm V_MAD_F32 : VOP3_Real_gfx6_gfx7_gfx10<0x141>;
874 defm V_MAD_I32_I24 : VOP3_Real_gfx6_gfx7_gfx10<0x142>;
875 defm V_MAD_U32_U24 : VOP3_Real_gfx6_gfx7_gfx10<0x143>;
876 defm V_CUBEID_F32 : VOP3_Real_gfx6_gfx7_gfx10<0x144>;
877 defm V_CUBESC_F32 : VOP3_Real_gfx6_gfx7_gfx10<0x145>;
878 defm V_CUBETC_F32 : VOP3_Real_gfx6_gfx7_gfx10<0x146>;
879 defm V_CUBEMA_F32 : VOP3_Real_gfx6_gfx7_gfx10<0x147>;
880 defm V_BFE_U32 : VOP3_Real_gfx6_gfx7_gfx10<0x148>;
881 defm V_BFE_I32 : VOP3_Real_gfx6_gfx7_gfx10<0x149>;
882 defm V_BFI_B32 : VOP3_Real_gfx6_gfx7_gfx10<0x14a>;
883 defm V_FMA_F32 : VOP3_Real_gfx6_gfx7_gfx10<0x14b>;
884 defm V_FMA_F64 : VOP3_Real_gfx6_gfx7_gfx10<0x14c>;
885 defm V_LERP_U8 : VOP3_Real_gfx6_gfx7_gfx10<0x14d>;
886 defm V_ALIGNBIT_B32 : VOP3_Real_gfx6_gfx7_gfx10<0x14e>;
887 defm V_ALIGNBYTE_B32 : VOP3_Real_gfx6_gfx7_gfx10<0x14f>;
888 defm V_MULLIT_F32 : VOP3_Real_gfx6_gfx7_gfx10<0x150>;
889 defm V_MIN3_F32 : VOP3_Real_gfx6_gfx7_gfx10<0x151>;
890 defm V_MIN3_I32 : VOP3_Real_gfx6_gfx7_gfx10<0x152>;
891 defm V_MIN3_U32 : VOP3_Real_gfx6_gfx7_gfx10<0x153>;
892 defm V_MAX3_F32 : VOP3_Real_gfx6_gfx7_gfx10<0x154>;
893 defm V_MAX3_I32 : VOP3_Real_gfx6_gfx7_gfx10<0x155>;
894 defm V_MAX3_U32 : VOP3_Real_gfx6_gfx7_gfx10<0x156>;
895 defm V_MED3_F32 : VOP3_Real_gfx6_gfx7_gfx10<0x157>;
896 defm V_MED3_I32 : VOP3_Real_gfx6_gfx7_gfx10<0x158>;
897 defm V_MED3_U32 : VOP3_Real_gfx6_gfx7_gfx10<0x159>;
898 defm V_SAD_U8 : VOP3_Real_gfx6_gfx7_gfx10<0x15a>;
899 defm V_SAD_HI_U8 : VOP3_Real_gfx6_gfx7_gfx10<0x15b>;
900 defm V_SAD_U16 : VOP3_Real_gfx6_gfx7_gfx10<0x15c>;
901 defm V_SAD_U32 : VOP3_Real_gfx6_gfx7_gfx10<0x15d>;
902 defm V_CVT_PK_U8_F32 : VOP3_Real_gfx6_gfx7_gfx10<0x15e>;
903 defm V_DIV_FIXUP_F32 : VOP3_Real_gfx6_gfx7_gfx10<0x15f>;
904 defm V_DIV_FIXUP_F64 : VOP3_Real_gfx6_gfx7_gfx10<0x160>;
905 defm V_ADD_F64 : VOP3_Real_gfx6_gfx7_gfx10<0x164>;
906 defm V_MUL_F64 : VOP3_Real_gfx6_gfx7_gfx10<0x165>;
907 defm V_MIN_F64 : VOP3_Real_gfx6_gfx7_gfx10<0x166>;
908 defm V_MAX_F64 : VOP3_Real_gfx6_gfx7_gfx10<0x167>;
909 defm V_LDEXP_F64 : VOP3_Real_gfx6_gfx7_gfx10<0x168>;
910 defm V_MUL_LO_U32 : VOP3_Real_gfx6_gfx7_gfx10<0x169>;
911 defm V_MUL_HI_U32 : VOP3_Real_gfx6_gfx7_gfx10<0x16a>;
912 defm V_MUL_LO_I32 : VOP3_Real_gfx6_gfx7_gfx10<0x16b>;
913 defm V_MUL_HI_I32 : VOP3_Real_gfx6_gfx7_gfx10<0x16c>;
914 defm V_DIV_FMAS_F32 : VOP3_Real_gfx6_gfx7_gfx10<0x16f>;
915 defm V_DIV_FMAS_F64 : VOP3_Real_gfx6_gfx7_gfx10<0x170>;
916 defm V_MSAD_U8 : VOP3_Real_gfx6_gfx7_gfx10<0x171>;
917 defm V_MQSAD_PK_U16_U8 : VOP3_Real_gfx6_gfx7_gfx10<0x173>;
918 defm V_TRIG_PREOP_F64 : VOP3_Real_gfx6_gfx7_gfx10<0x174>;
919 defm V_DIV_SCALE_F32 : VOP3be_Real_gfx6_gfx7_gfx10<0x16d>;
920 defm V_DIV_SCALE_F64 : VOP3be_Real_gfx6_gfx7_gfx10<0x16e>;
922 //===----------------------------------------------------------------------===//
924 //===----------------------------------------------------------------------===//
926 let AssemblerPredicates = [isGFX8GFX9], DecoderNamespace = "GFX8" in {
928 multiclass VOP3_Real_vi<bits<10> op> {
929 def _vi : VOP3_Real<!cast<VOP_Pseudo>(NAME), SIEncodingFamily.VI>,
930 VOP3e_vi <op, !cast<VOP_Pseudo>(NAME).Pfl>;
933 multiclass VOP3be_Real_vi<bits<10> op> {
934 def _vi : VOP3_Real<!cast<VOP_Pseudo>(NAME), SIEncodingFamily.VI>,
935 VOP3be_vi <op, !cast<VOP_Pseudo>(NAME).Pfl>;
938 multiclass VOP3OpSel_Real_gfx9<bits<10> op> {
939 def _vi : VOP3_Real<!cast<VOP_Pseudo>(NAME), SIEncodingFamily.VI>,
940 VOP3OpSel_gfx9 <op, !cast<VOP_Pseudo>(NAME).Pfl>;
943 multiclass VOP3Interp_Real_vi<bits<10> op> {
944 def _vi : VOP3_Real<!cast<VOP_Pseudo>(NAME), SIEncodingFamily.VI>,
945 VOP3Interp_vi <op, !cast<VOP_Pseudo>(NAME).Pfl>;
948 } // End AssemblerPredicates = [isGFX8GFX9], DecoderNamespace = "GFX8"
950 let AssemblerPredicates = [isGFX8Only], DecoderNamespace = "GFX8" in {
952 multiclass VOP3_F16_Real_vi<bits<10> op> {
953 def _vi : VOP3_Real<!cast<VOP3_Pseudo>(NAME), SIEncodingFamily.VI>,
954 VOP3e_vi <op, !cast<VOP3_Pseudo>(NAME).Pfl>;
957 multiclass VOP3Interp_F16_Real_vi<bits<10> op> {
958 def _vi : VOP3_Real<!cast<VOP3_Pseudo>(NAME), SIEncodingFamily.VI>,
959 VOP3Interp_vi <op, !cast<VOP3_Pseudo>(NAME).Pfl>;
962 } // End AssemblerPredicates = [isGFX8Only], DecoderNamespace = "GFX8"
964 let AssemblerPredicates = [isGFX9Only], DecoderNamespace = "GFX9" in {
966 multiclass VOP3_F16_Real_gfx9<bits<10> op, string OpName, string AsmName> {
967 def _gfx9 : VOP3_Real<!cast<VOP3_Pseudo>(OpName), SIEncodingFamily.GFX9>,
968 VOP3e_vi <op, !cast<VOP3_Pseudo>(OpName).Pfl> {
969 VOP3_Pseudo ps = !cast<VOP3_Pseudo>(OpName);
970 let AsmString = AsmName # ps.AsmOperands;
974 multiclass VOP3OpSel_F16_Real_gfx9<bits<10> op, string AsmName> {
975 def _gfx9 : VOP3_Real<!cast<VOP3_Pseudo>(NAME), SIEncodingFamily.GFX9>,
976 VOP3OpSel_gfx9 <op, !cast<VOP3_Pseudo>(NAME).Pfl> {
977 VOP3_Pseudo ps = !cast<VOP3_Pseudo>(NAME);
978 let AsmString = AsmName # ps.AsmOperands;
982 multiclass VOP3Interp_F16_Real_gfx9<bits<10> op, string OpName, string AsmName> {
983 def _gfx9 : VOP3_Real<!cast<VOP3_Pseudo>(OpName), SIEncodingFamily.GFX9>,
984 VOP3Interp_vi <op, !cast<VOP3_Pseudo>(OpName).Pfl> {
985 VOP3_Pseudo ps = !cast<VOP3_Pseudo>(OpName);
986 let AsmString = AsmName # ps.AsmOperands;
990 multiclass VOP3_Real_gfx9<bits<10> op, string AsmName> {
991 def _gfx9 : VOP3_Real<!cast<VOP_Pseudo>(NAME), SIEncodingFamily.GFX9>,
992 VOP3e_vi <op, !cast<VOP_Pseudo>(NAME).Pfl> {
993 VOP_Pseudo ps = !cast<VOP_Pseudo>(NAME);
994 let AsmString = AsmName # ps.AsmOperands;
998 } // End AssemblerPredicates = [isGFX9Only], DecoderNamespace = "GFX9"
1000 defm V_MAD_U64_U32 : VOP3be_Real_vi <0x1E8>;
1001 defm V_MAD_I64_I32 : VOP3be_Real_vi <0x1E9>;
1003 defm V_MAD_LEGACY_F32 : VOP3_Real_vi <0x1c0>;
1004 defm V_MAD_F32 : VOP3_Real_vi <0x1c1>;
1005 defm V_MAD_I32_I24 : VOP3_Real_vi <0x1c2>;
1006 defm V_MAD_U32_U24 : VOP3_Real_vi <0x1c3>;
1007 defm V_CUBEID_F32 : VOP3_Real_vi <0x1c4>;
1008 defm V_CUBESC_F32 : VOP3_Real_vi <0x1c5>;
1009 defm V_CUBETC_F32 : VOP3_Real_vi <0x1c6>;
1010 defm V_CUBEMA_F32 : VOP3_Real_vi <0x1c7>;
1011 defm V_BFE_U32 : VOP3_Real_vi <0x1c8>;
1012 defm V_BFE_I32 : VOP3_Real_vi <0x1c9>;
1013 defm V_BFI_B32 : VOP3_Real_vi <0x1ca>;
1014 defm V_FMA_F32 : VOP3_Real_vi <0x1cb>;
1015 defm V_FMA_F64 : VOP3_Real_vi <0x1cc>;
1016 defm V_LERP_U8 : VOP3_Real_vi <0x1cd>;
1017 defm V_ALIGNBIT_B32 : VOP3_Real_vi <0x1ce>;
1018 defm V_ALIGNBYTE_B32 : VOP3_Real_vi <0x1cf>;
1019 defm V_MIN3_F32 : VOP3_Real_vi <0x1d0>;
1020 defm V_MIN3_I32 : VOP3_Real_vi <0x1d1>;
1021 defm V_MIN3_U32 : VOP3_Real_vi <0x1d2>;
1022 defm V_MAX3_F32 : VOP3_Real_vi <0x1d3>;
1023 defm V_MAX3_I32 : VOP3_Real_vi <0x1d4>;
1024 defm V_MAX3_U32 : VOP3_Real_vi <0x1d5>;
1025 defm V_MED3_F32 : VOP3_Real_vi <0x1d6>;
1026 defm V_MED3_I32 : VOP3_Real_vi <0x1d7>;
1027 defm V_MED3_U32 : VOP3_Real_vi <0x1d8>;
1028 defm V_SAD_U8 : VOP3_Real_vi <0x1d9>;
1029 defm V_SAD_HI_U8 : VOP3_Real_vi <0x1da>;
1030 defm V_SAD_U16 : VOP3_Real_vi <0x1db>;
1031 defm V_SAD_U32 : VOP3_Real_vi <0x1dc>;
1032 defm V_CVT_PK_U8_F32 : VOP3_Real_vi <0x1dd>;
1033 defm V_DIV_FIXUP_F32 : VOP3_Real_vi <0x1de>;
1034 defm V_DIV_FIXUP_F64 : VOP3_Real_vi <0x1df>;
1035 defm V_DIV_SCALE_F32 : VOP3be_Real_vi <0x1e0>;
1036 defm V_DIV_SCALE_F64 : VOP3be_Real_vi <0x1e1>;
1037 defm V_DIV_FMAS_F32 : VOP3_Real_vi <0x1e2>;
1038 defm V_DIV_FMAS_F64 : VOP3_Real_vi <0x1e3>;
1039 defm V_MSAD_U8 : VOP3_Real_vi <0x1e4>;
1040 defm V_QSAD_PK_U16_U8 : VOP3_Real_vi <0x1e5>;
1041 defm V_MQSAD_PK_U16_U8 : VOP3_Real_vi <0x1e6>;
1042 defm V_MQSAD_U32_U8 : VOP3_Real_vi <0x1e7>;
1044 defm V_PERM_B32 : VOP3_Real_vi <0x1ed>;
1046 defm V_MAD_F16 : VOP3_F16_Real_vi <0x1ea>;
1047 defm V_MAD_U16 : VOP3_F16_Real_vi <0x1eb>;
1048 defm V_MAD_I16 : VOP3_F16_Real_vi <0x1ec>;
1049 defm V_FMA_F16 : VOP3_F16_Real_vi <0x1ee>;
1050 defm V_DIV_FIXUP_F16 : VOP3_F16_Real_vi <0x1ef>;
1051 defm V_INTERP_P2_F16 : VOP3Interp_F16_Real_vi <0x276>;
1053 let FPDPRounding = 1 in {
1054 defm V_MAD_LEGACY_F16 : VOP3_F16_Real_gfx9 <0x1ea, "V_MAD_F16", "v_mad_legacy_f16">;
1055 defm V_FMA_LEGACY_F16 : VOP3_F16_Real_gfx9 <0x1ee, "V_FMA_F16", "v_fma_legacy_f16">;
1056 defm V_DIV_FIXUP_LEGACY_F16 : VOP3_F16_Real_gfx9 <0x1ef, "V_DIV_FIXUP_F16", "v_div_fixup_legacy_f16">;
1057 defm V_INTERP_P2_LEGACY_F16 : VOP3Interp_F16_Real_gfx9 <0x276, "V_INTERP_P2_F16", "v_interp_p2_legacy_f16">;
1058 } // End FPDPRounding = 1
1060 defm V_MAD_LEGACY_U16 : VOP3_F16_Real_gfx9 <0x1eb, "V_MAD_U16", "v_mad_legacy_u16">;
1061 defm V_MAD_LEGACY_I16 : VOP3_F16_Real_gfx9 <0x1ec, "V_MAD_I16", "v_mad_legacy_i16">;
1063 defm V_MAD_F16_gfx9 : VOP3OpSel_F16_Real_gfx9 <0x203, "v_mad_f16">;
1064 defm V_MAD_U16_gfx9 : VOP3OpSel_F16_Real_gfx9 <0x204, "v_mad_u16">;
1065 defm V_MAD_I16_gfx9 : VOP3OpSel_F16_Real_gfx9 <0x205, "v_mad_i16">;
1066 defm V_FMA_F16_gfx9 : VOP3OpSel_F16_Real_gfx9 <0x206, "v_fma_f16">;
1067 defm V_DIV_FIXUP_F16_gfx9 : VOP3OpSel_F16_Real_gfx9 <0x207, "v_div_fixup_f16">;
1068 defm V_INTERP_P2_F16_gfx9 : VOP3Interp_F16_Real_gfx9 <0x277, "V_INTERP_P2_F16_gfx9", "v_interp_p2_f16">;
1070 defm V_ADD_I32_gfx9 : VOP3_Real_gfx9 <0x29c, "v_add_i32">;
1071 defm V_SUB_I32_gfx9 : VOP3_Real_gfx9 <0x29d, "v_sub_i32">;
1073 defm V_INTERP_P1_F32_e64 : VOP3Interp_Real_vi <0x270>;
1074 defm V_INTERP_P2_F32_e64 : VOP3Interp_Real_vi <0x271>;
1075 defm V_INTERP_MOV_F32_e64 : VOP3Interp_Real_vi <0x272>;
1077 defm V_INTERP_P1LL_F16 : VOP3Interp_Real_vi <0x274>;
1078 defm V_INTERP_P1LV_F16 : VOP3Interp_Real_vi <0x275>;
1079 defm V_ADD_F64 : VOP3_Real_vi <0x280>;
1080 defm V_MUL_F64 : VOP3_Real_vi <0x281>;
1081 defm V_MIN_F64 : VOP3_Real_vi <0x282>;
1082 defm V_MAX_F64 : VOP3_Real_vi <0x283>;
1083 defm V_LDEXP_F64 : VOP3_Real_vi <0x284>;
1084 defm V_MUL_LO_U32 : VOP3_Real_vi <0x285>;
1086 // removed from VI as identical to V_MUL_LO_U32
1087 let isAsmParserOnly = 1 in {
1088 defm V_MUL_LO_I32 : VOP3_Real_vi <0x285>;
1091 defm V_MUL_HI_U32 : VOP3_Real_vi <0x286>;
1092 defm V_MUL_HI_I32 : VOP3_Real_vi <0x287>;
1094 defm V_READLANE_B32 : VOP3_Real_vi <0x289>;
1095 defm V_WRITELANE_B32 : VOP3_Real_vi <0x28a>;
1097 defm V_LSHLREV_B64 : VOP3_Real_vi <0x28f>;
1098 defm V_LSHRREV_B64 : VOP3_Real_vi <0x290>;
1099 defm V_ASHRREV_I64 : VOP3_Real_vi <0x291>;
1100 defm V_TRIG_PREOP_F64 : VOP3_Real_vi <0x292>;
1102 defm V_LSHL_ADD_U32 : VOP3_Real_vi <0x1fd>;
1103 defm V_ADD_LSHL_U32 : VOP3_Real_vi <0x1fe>;
1104 defm V_ADD3_U32 : VOP3_Real_vi <0x1ff>;
1105 defm V_LSHL_OR_B32 : VOP3_Real_vi <0x200>;
1106 defm V_AND_OR_B32 : VOP3_Real_vi <0x201>;
1107 defm V_OR3_B32 : VOP3_Real_vi <0x202>;
1108 defm V_PACK_B32_F16 : VOP3OpSel_Real_gfx9 <0x2a0>;
1110 defm V_XAD_U32 : VOP3_Real_vi <0x1f3>;
1112 defm V_MIN3_F16 : VOP3OpSel_Real_gfx9 <0x1f4>;
1113 defm V_MIN3_I16 : VOP3OpSel_Real_gfx9 <0x1f5>;
1114 defm V_MIN3_U16 : VOP3OpSel_Real_gfx9 <0x1f6>;
1116 defm V_MAX3_F16 : VOP3OpSel_Real_gfx9 <0x1f7>;
1117 defm V_MAX3_I16 : VOP3OpSel_Real_gfx9 <0x1f8>;
1118 defm V_MAX3_U16 : VOP3OpSel_Real_gfx9 <0x1f9>;
1120 defm V_MED3_F16 : VOP3OpSel_Real_gfx9 <0x1fa>;
1121 defm V_MED3_I16 : VOP3OpSel_Real_gfx9 <0x1fb>;
1122 defm V_MED3_U16 : VOP3OpSel_Real_gfx9 <0x1fc>;
1124 defm V_ADD_I16 : VOP3OpSel_Real_gfx9 <0x29e>;
1125 defm V_SUB_I16 : VOP3OpSel_Real_gfx9 <0x29f>;
1127 defm V_MAD_U32_U16 : VOP3OpSel_Real_gfx9 <0x1f1>;
1128 defm V_MAD_I32_I16 : VOP3OpSel_Real_gfx9 <0x1f2>;
1130 defm V_CVT_PKNORM_I16_F16 : VOP3OpSel_Real_gfx9 <0x299>;
1131 defm V_CVT_PKNORM_U16_F16 : VOP3OpSel_Real_gfx9 <0x29a>;