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 imm:$cbsz, imm:$abid, imm:$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, Predicates = [isGFX6GFX7GFX10] in {
389 def V_LSHL_B64 : VOP3Inst <"v_lshl_b64", VOP3_Profile<VOP_PAT_GEN<VOP_I64_I64_I32>>, shl>;
390 def V_LSHR_B64 : VOP3Inst <"v_lshr_b64", VOP3_Profile<VOP_PAT_GEN<VOP_I64_I64_I32>>, srl>;
391 def V_ASHR_I64 : VOP3Inst <"v_ashr_i64", VOP3_Profile<VOP_PAT_GEN<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, Predicates = [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]
402 let Predicates = [isGFX8Plus] in {
404 (getDivergentFrag<shl>.ret i64:$x, i32:$y),
405 (V_LSHLREV_B64 $y, $x)
408 (getDivergentFrag<srl>.ret i64:$x, i32:$y),
409 (V_LSHRREV_B64 $y, $x)
412 (getDivergentFrag<sra>.ret i64:$x, i32:$y),
413 (V_ASHRREV_I64 $y, $x)
418 let SchedRW = [Write32Bit] in {
419 let SubtargetPredicate = isGFX8Plus in {
420 def V_PERM_B32 : VOP3Inst <"v_perm_b32", VOP3_Profile<VOP_I32_I32_I32_I32>, AMDGPUperm>;
421 } // End SubtargetPredicate = isGFX8Plus
422 } // End SchedRW = [Write32Bit]
424 let SubtargetPredicate = isGFX7Plus in {
426 let Constraints = "@earlyclobber $vdst", SchedRW = [WriteQuarterRate32] in {
427 def V_QSAD_PK_U16_U8 : VOP3Inst <"v_qsad_pk_u16_u8", VOP3_Profile<VOP_I64_I64_I32_I64, VOP3_CLAMP>>;
428 def V_MQSAD_U32_U8 : VOP3Inst <"v_mqsad_u32_u8", VOP3_Profile<VOP_V4I32_I64_I32_V4I32, VOP3_CLAMP>>;
429 } // End Constraints = "@earlyclobber $vdst", SchedRW = [WriteQuarterRate32]
431 let isCommutable = 1 in {
432 let SchedRW = [WriteQuarterRate32, WriteSALU] in {
433 def V_MAD_U64_U32 : VOP3Inst <"v_mad_u64_u32", VOP3b_I64_I1_I32_I32_I64>;
434 def V_MAD_I64_I32 : VOP3Inst <"v_mad_i64_i32", VOP3b_I64_I1_I32_I32_I64>;
435 } // End SchedRW = [WriteDouble, WriteSALU]
436 } // End isCommutable = 1
438 } // End SubtargetPredicate = isGFX7Plus
441 def V_DIV_FIXUP_F16 : VOP3Inst <"v_div_fixup_f16", VOP3_Profile<VOP_F16_F16_F16_F16>, AMDGPUdiv_fixup> {
442 let Predicates = [Has16BitInsts, isGFX8Only];
443 let FPDPRounding = 1;
445 def V_DIV_FIXUP_F16_gfx9 : VOP3Inst <"v_div_fixup_f16_gfx9",
446 VOP3_Profile<VOP_F16_F16_F16_F16, VOP3_OPSEL>, AMDGPUdiv_fixup> {
447 let renamedInGFX9 = 1;
448 let Predicates = [Has16BitInsts, isGFX9Plus];
449 let FPDPRounding = 1;
452 def V_FMA_F16 : VOP3Inst <"v_fma_f16", VOP3_Profile<VOP_F16_F16_F16_F16>, fma> {
453 let Predicates = [Has16BitInsts, isGFX8Only];
454 let FPDPRounding = 1;
456 def V_FMA_F16_gfx9 : VOP3Inst <"v_fma_f16_gfx9", VOP3_Profile<VOP_F16_F16_F16_F16, VOP3_OPSEL>, fma> {
457 let renamedInGFX9 = 1;
458 let Predicates = [Has16BitInsts, isGFX9Plus];
459 let FPDPRounding = 1;
462 let SubtargetPredicate = Has16BitInsts, isCommutable = 1 in {
464 let renamedInGFX9 = 1 in {
465 def V_MAD_U16 : VOP3Inst <"v_mad_u16", VOP3_Profile<VOP_I16_I16_I16_I16, VOP3_CLAMP>>;
466 def V_MAD_I16 : VOP3Inst <"v_mad_i16", VOP3_Profile<VOP_I16_I16_I16_I16, VOP3_CLAMP>>;
467 let FPDPRounding = 1 in {
468 def V_MAD_F16 : VOP3Inst <"v_mad_f16", VOP3_Profile<VOP_F16_F16_F16_F16>, fmad>;
469 let Uses = [M0, EXEC] in {
470 def V_INTERP_P2_F16 : VOP3Interp <"v_interp_p2_f16", VOP3_INTERP16<[f16, f32, i32, f32]>,
471 [(set f16:$vdst, (AMDGPUinterp_p2_f16 f32:$src0, (i32 imm:$attrchan),
473 (i32 imm:$src0_modifiers),
474 (f32 VRegSrc_32:$src2),
475 (i32 imm:$src2_modifiers),
478 } // End Uses = [M0, EXEC]
479 } // End FPDPRounding = 1
480 } // End renamedInGFX9 = 1
482 let SubtargetPredicate = isGFX9Only in {
483 def V_MAD_F16_gfx9 : VOP3Inst <"v_mad_f16_gfx9", VOP3_Profile<VOP_F16_F16_F16_F16, VOP3_OPSEL>> {
484 let FPDPRounding = 1;
486 } // End SubtargetPredicate = isGFX9Only
488 let SubtargetPredicate = isGFX9Plus in {
489 def V_MAD_U16_gfx9 : VOP3Inst <"v_mad_u16_gfx9", VOP3_Profile<VOP_I16_I16_I16_I16, VOP3_OPSEL>>;
490 def V_MAD_I16_gfx9 : VOP3Inst <"v_mad_i16_gfx9", VOP3_Profile<VOP_I16_I16_I16_I16, VOP3_OPSEL>>;
491 def V_INTERP_P2_F16_gfx9 : VOP3Interp <"v_interp_p2_f16_gfx9", VOP3_INTERP16<[f16, f32, i32, f32]>>;
492 } // End SubtargetPredicate = isGFX9Plus
494 let Uses = [M0, EXEC], FPDPRounding = 1 in {
495 def V_INTERP_P1LL_F16 : VOP3Interp <"v_interp_p1ll_f16", VOP3_INTERP16<[f32, f32, i32, untyped]>,
496 [(set f32:$vdst, (AMDGPUinterp_p1ll_f16 f32:$src0, (i32 imm:$attrchan),
498 (i32 imm:$src0_modifiers),
502 def V_INTERP_P1LV_F16 : VOP3Interp <"v_interp_p1lv_f16", VOP3_INTERP16<[f32, f32, i32, f16]>,
503 [(set f32:$vdst, (AMDGPUinterp_p1lv_f16 f32:$src0, (i32 imm:$attrchan),
505 (i32 imm:$src0_modifiers),
506 (f32 VRegSrc_32:$src2),
507 (i32 imm:$src2_modifiers),
511 } // End Uses = [M0, EXEC], FPDPRounding = 1
513 } // End SubtargetPredicate = Has16BitInsts, isCommutable = 1
515 let SubtargetPredicate = isGFX8GFX9 in {
516 def V_INTERP_P1_F32_e64 : VOP3Interp <"v_interp_p1_f32", VOP3_INTERP>;
517 def V_INTERP_P2_F32_e64 : VOP3Interp <"v_interp_p2_f32", VOP3_INTERP>;
518 def V_INTERP_MOV_F32_e64 : VOP3Interp <"v_interp_mov_f32", VOP3_INTERP_MOV>;
519 } // End SubtargetPredicate = isGFX8GFX9
521 let Predicates = [Has16BitInsts, isGFX6GFX7GFX8GFX9] in {
523 multiclass Ternary_i16_Pats <SDPatternOperator op1, SDPatternOperator op2,
524 Instruction inst, SDPatternOperator op3> {
526 (op2 (op1 i16:$src0, i16:$src1), i16:$src2),
527 (inst i16:$src0, i16:$src1, i16:$src2, (i1 0))
532 defm: Ternary_i16_Pats<mul, add, V_MAD_U16, zext>;
533 defm: Ternary_i16_Pats<mul, add, V_MAD_I16, sext>;
535 } // End Predicates = [Has16BitInsts, isGFX6GFX7GFX8GFX9]
537 let Predicates = [Has16BitInsts, isGFX10Plus] in {
539 multiclass Ternary_i16_Pats_gfx9<SDPatternOperator op1, SDPatternOperator op2,
540 Instruction inst, SDPatternOperator op3> {
542 (op2 (op1 i16:$src0, i16:$src1), i16:$src2),
543 (inst SRCMODS.NONE, $src0, SRCMODS.NONE, $src1, SRCMODS.NONE, $src2, DSTCLAMP.NONE)
548 defm: Ternary_i16_Pats_gfx9<mul, add, V_MAD_U16_gfx9, zext>;
549 defm: Ternary_i16_Pats_gfx9<mul, add, V_MAD_I16_gfx9, sext>;
551 } // End Predicates = [Has16BitInsts, isGFX10Plus]
553 class ThreeOpFrag<SDPatternOperator op1, SDPatternOperator op2> : PatFrag<
554 (ops node:$x, node:$y, node:$z),
555 // When the inner operation is used multiple times, selecting 3-op
556 // instructions may still be beneficial -- if the other users can be
557 // combined similarly. Let's be conservative for now.
558 (op2 (HasOneUseBinOp<op1> node:$x, node:$y), node:$z),
560 // Only use VALU ops when the result is divergent.
561 if (!N->isDivergent())
564 // Check constant bus limitations.
566 // Note: Use !isDivergent as a conservative proxy for whether the value
567 // is in an SGPR (uniform values can end up in VGPRs as well).
568 unsigned ConstantBusUses = 0;
569 for (unsigned i = 0; i < 3; ++i) {
570 if (!Operands[i]->isDivergent() &&
571 !isInlineImmediate(Operands[i].getNode())) {
573 // This uses AMDGPU::V_ADD3_U32, but all three operand instructions
574 // have the same constant bus limit.
575 if (ConstantBusUses > Subtarget->getConstantBusLimit(AMDGPU::V_ADD3_U32))
583 let PredicateCodeUsesOperands = 1;
586 let SubtargetPredicate = isGFX9Plus in {
587 def V_PACK_B32_F16 : VOP3Inst <"v_pack_b32_f16", VOP3_Profile<VOP_B32_F16_F16, VOP3_OPSEL>>;
588 def V_LSHL_ADD_U32 : VOP3Inst <"v_lshl_add_u32", VOP3_Profile<VOP_I32_I32_I32_I32>>;
589 def V_ADD_LSHL_U32 : VOP3Inst <"v_add_lshl_u32", VOP3_Profile<VOP_I32_I32_I32_I32>>;
590 def V_ADD3_U32 : VOP3Inst <"v_add3_u32", VOP3_Profile<VOP_I32_I32_I32_I32>>;
591 def V_LSHL_OR_B32 : VOP3Inst <"v_lshl_or_b32", VOP3_Profile<VOP_I32_I32_I32_I32>>;
592 def V_AND_OR_B32 : VOP3Inst <"v_and_or_b32", VOP3_Profile<VOP_I32_I32_I32_I32>>;
593 def V_OR3_B32 : VOP3Inst <"v_or3_b32", VOP3_Profile<VOP_I32_I32_I32_I32>>;
595 def V_XAD_U32 : VOP3Inst <"v_xad_u32", VOP3_Profile<VOP_I32_I32_I32_I32>>;
597 def V_MED3_F16 : VOP3Inst <"v_med3_f16", VOP3_Profile<VOP_F16_F16_F16_F16, VOP3_OPSEL>, AMDGPUfmed3>;
598 def V_MED3_I16 : VOP3Inst <"v_med3_i16", VOP3_Profile<VOP_I16_I16_I16_I16, VOP3_OPSEL>, AMDGPUsmed3>;
599 def V_MED3_U16 : VOP3Inst <"v_med3_u16", VOP3_Profile<VOP_I16_I16_I16_I16, VOP3_OPSEL>, AMDGPUumed3>;
601 def V_MIN3_F16 : VOP3Inst <"v_min3_f16", VOP3_Profile<VOP_F16_F16_F16_F16, VOP3_OPSEL>, AMDGPUfmin3>;
602 def V_MIN3_I16 : VOP3Inst <"v_min3_i16", VOP3_Profile<VOP_I16_I16_I16_I16, VOP3_OPSEL>, AMDGPUsmin3>;
603 def V_MIN3_U16 : VOP3Inst <"v_min3_u16", VOP3_Profile<VOP_I16_I16_I16_I16, VOP3_OPSEL>, AMDGPUumin3>;
605 def V_MAX3_F16 : VOP3Inst <"v_max3_f16", VOP3_Profile<VOP_F16_F16_F16_F16, VOP3_OPSEL>, AMDGPUfmax3>;
606 def V_MAX3_I16 : VOP3Inst <"v_max3_i16", VOP3_Profile<VOP_I16_I16_I16_I16, VOP3_OPSEL>, AMDGPUsmax3>;
607 def V_MAX3_U16 : VOP3Inst <"v_max3_u16", VOP3_Profile<VOP_I16_I16_I16_I16, VOP3_OPSEL>, AMDGPUumax3>;
609 def V_ADD_I16 : VOP3Inst <"v_add_i16", VOP3_Profile<VOP_I16_I16_I16, VOP3_OPSEL>>;
610 def V_SUB_I16 : VOP3Inst <"v_sub_i16", VOP3_Profile<VOP_I16_I16_I16, VOP3_OPSEL>>;
612 def V_MAD_U32_U16 : VOP3Inst <"v_mad_u32_u16", VOP3_Profile<VOP_I32_I16_I16_I32, VOP3_OPSEL>>;
613 def V_MAD_I32_I16 : VOP3Inst <"v_mad_i32_i16", VOP3_Profile<VOP_I32_I16_I16_I32, VOP3_OPSEL>>;
615 def V_CVT_PKNORM_I16_F16 : VOP3Inst <"v_cvt_pknorm_i16_f16", VOP3_Profile<VOP_B32_F16_F16, VOP3_OPSEL>>;
616 def V_CVT_PKNORM_U16_F16 : VOP3Inst <"v_cvt_pknorm_u16_f16", VOP3_Profile<VOP_B32_F16_F16, VOP3_OPSEL>>;
618 def V_ADD_I32_gfx9 : VOP3Inst <"v_add_i32_gfx9", VOP3_Profile<VOP_I32_I32_I32>>;
619 def V_SUB_I32_gfx9 : VOP3Inst <"v_sub_i32_gfx9", VOP3_Profile<VOP_I32_I32_I32>>;
622 class ThreeOp_i32_Pats <SDPatternOperator op1, SDPatternOperator op2, Instruction inst> : GCNPat <
623 // This matches (op2 (op1 i32:$src0, i32:$src1), i32:$src2) with conditions.
624 (ThreeOpFrag<op1, op2> i32:$src0, i32:$src1, i32:$src2),
625 (inst i32:$src0, i32:$src1, i32:$src2)
628 def : ThreeOp_i32_Pats<shl, add, V_LSHL_ADD_U32>;
629 def : ThreeOp_i32_Pats<add, shl, V_ADD_LSHL_U32>;
630 def : ThreeOp_i32_Pats<add, add, V_ADD3_U32>;
631 def : ThreeOp_i32_Pats<shl, or, V_LSHL_OR_B32>;
632 def : ThreeOp_i32_Pats<and, or, V_AND_OR_B32>;
633 def : ThreeOp_i32_Pats<or, or, V_OR3_B32>;
634 def : ThreeOp_i32_Pats<xor, add, V_XAD_U32>;
636 } // End SubtargetPredicate = isGFX9Plus
638 def VOP3_PERMLANE_Profile : VOP3_Profile<VOPProfile <[i32, i32, i32, i32]>, VOP3_OPSEL> {
639 let Src0RC64 = VRegSrc_32;
640 let Src1RC64 = SCSrc_b32;
641 let Src2RC64 = SCSrc_b32;
642 let InsVOP3OpSel = (ins IntOpSelMods:$src0_modifiers, VRegSrc_32:$src0,
643 IntOpSelMods:$src1_modifiers, SCSrc_b32:$src1,
644 IntOpSelMods:$src2_modifiers, SCSrc_b32:$src2,
645 VGPR_32:$vdst_in, op_sel:$op_sel);
650 let SubtargetPredicate = isGFX10Plus in {
651 def V_XOR3_B32 : VOP3Inst <"v_xor3_b32", VOP3_Profile<VOP_I32_I32_I32_I32>>;
652 def : ThreeOp_i32_Pats<xor, xor, V_XOR3_B32>;
654 let Constraints = "$vdst = $vdst_in", DisableEncoding="$vdst_in" in {
655 def V_PERMLANE16_B32 : VOP3Inst <"v_permlane16_b32", VOP3_PERMLANE_Profile>;
656 def V_PERMLANEX16_B32 : VOP3Inst <"v_permlanex16_b32", VOP3_PERMLANE_Profile>;
657 } // End $vdst = $vdst_in, DisableEncoding $vdst_in
660 (int_amdgcn_permlane16 i32:$vdst_in, i32:$src0, i32:$src1, i32:$src2, imm:$fi, imm:$bc),
661 (V_PERMLANE16_B32 (as_i1imm $fi), $src0, (as_i1imm $bc), $src1, 0, $src2, $vdst_in)
664 (int_amdgcn_permlanex16 i32:$vdst_in, i32:$src0, i32:$src1, i32:$src2, imm:$fi, imm:$bc),
665 (V_PERMLANEX16_B32 (as_i1imm $fi), $src0, (as_i1imm $bc), $src1, 0, $src2, $vdst_in)
667 } // End SubtargetPredicate = isGFX10Plus
669 //===----------------------------------------------------------------------===//
670 // Integer Clamp Patterns
671 //===----------------------------------------------------------------------===//
673 class getClampPat<VOPProfile P, SDPatternOperator node> {
674 dag ret3 = (P.DstVT (node P.Src0VT:$src0, P.Src1VT:$src1, P.Src2VT:$src2));
675 dag ret2 = (P.DstVT (node P.Src0VT:$src0, P.Src1VT:$src1));
676 dag ret1 = (P.DstVT (node P.Src0VT:$src0));
677 dag ret = !if(!eq(P.NumSrcArgs, 3), ret3,
678 !if(!eq(P.NumSrcArgs, 2), ret2,
682 class getClampRes<VOPProfile P, Instruction inst> {
683 dag ret3 = (inst P.Src0VT:$src0, P.Src1VT:$src1, P.Src2VT:$src2, (i1 0));
684 dag ret2 = (inst P.Src0VT:$src0, P.Src1VT:$src1, (i1 0));
685 dag ret1 = (inst P.Src0VT:$src0, (i1 0));
686 dag ret = !if(!eq(P.NumSrcArgs, 3), ret3,
687 !if(!eq(P.NumSrcArgs, 2), ret2,
691 class IntClampPat<VOP3Inst inst, SDPatternOperator node> : GCNPat<
692 getClampPat<inst.Pfl, node>.ret,
693 getClampRes<inst.Pfl, inst>.ret
696 def : IntClampPat<V_MAD_I32_I24, AMDGPUmad_i24>;
697 def : IntClampPat<V_MAD_U32_U24, AMDGPUmad_u24>;
699 def : IntClampPat<V_SAD_U8, int_amdgcn_sad_u8>;
700 def : IntClampPat<V_SAD_HI_U8, int_amdgcn_sad_hi_u8>;
701 def : IntClampPat<V_SAD_U16, int_amdgcn_sad_u16>;
703 def : IntClampPat<V_MSAD_U8, int_amdgcn_msad_u8>;
704 def : IntClampPat<V_MQSAD_PK_U16_U8, int_amdgcn_mqsad_pk_u16_u8>;
706 def : IntClampPat<V_QSAD_PK_U16_U8, int_amdgcn_qsad_pk_u16_u8>;
707 def : IntClampPat<V_MQSAD_U32_U8, int_amdgcn_mqsad_u32_u8>;
710 //===----------------------------------------------------------------------===//
711 // Target-specific instruction encodings.
712 //===----------------------------------------------------------------------===//
714 //===----------------------------------------------------------------------===//
716 //===----------------------------------------------------------------------===//
718 let AssemblerPredicate = isGFX10Plus, DecoderNamespace = "GFX10" in {
719 multiclass VOP3_Real_gfx10<bits<10> op> {
721 VOP3_Real<!cast<VOP_Pseudo>(NAME), SIEncodingFamily.GFX10>,
722 VOP3e_gfx10<op, !cast<VOP_Pseudo>(NAME).Pfl>;
724 multiclass VOP3_Real_gfx10_with_name<bits<10> op, string opName,
727 VOP3_Real<!cast<VOP3_Pseudo>(opName), SIEncodingFamily.GFX10>,
728 VOP3e_gfx10<op, !cast<VOP3_Pseudo>(opName).Pfl> {
729 VOP3_Pseudo ps = !cast<VOP3_Pseudo>(opName);
730 let AsmString = asmName # ps.AsmOperands;
733 multiclass VOP3be_Real_gfx10<bits<10> op> {
735 VOP3_Real<!cast<VOP3_Pseudo>(NAME), SIEncodingFamily.GFX10>,
736 VOP3be_gfx10<op, !cast<VOP3_Pseudo>(NAME).Pfl>;
738 multiclass VOP3Interp_Real_gfx10<bits<10> op> {
740 VOP3_Real<!cast<VOP3_Pseudo>(NAME), SIEncodingFamily.GFX10>,
741 VOP3Interp_gfx10<op, !cast<VOP3_Pseudo>(NAME).Pfl>;
743 multiclass VOP3OpSel_Real_gfx10<bits<10> op> {
745 VOP3_Real<!cast<VOP3_Pseudo>(NAME), SIEncodingFamily.GFX10>,
746 VOP3OpSel_gfx10<op, !cast<VOP3_Pseudo>(NAME).Pfl>;
748 multiclass VOP3OpSel_Real_gfx10_with_name<bits<10> op, string opName,
751 VOP3_Real<!cast<VOP3_Pseudo>(opName), SIEncodingFamily.GFX10>,
752 VOP3OpSel_gfx10<op, !cast<VOP3_Pseudo>(opName).Pfl> {
753 VOP3_Pseudo ps = !cast<VOP3_Pseudo>(opName);
754 let AsmString = asmName # ps.AsmOperands;
757 } // End AssemblerPredicate = isGFX10Plus, DecoderNamespace = "GFX10"
759 defm V_READLANE_B32 : VOP3_Real_gfx10<0x360>;
761 let InOperandList = (ins SSrcOrLds_b32:$src0, SCSrc_b32:$src1, VSrc_b32:$vdst_in) in {
762 defm V_WRITELANE_B32 : VOP3_Real_gfx10<0x361>;
763 } // End InOperandList = (ins SSrcOrLds_b32:$src0, SCSrc_b32:$src1, VSrc_b32:$vdst_in)
765 defm V_XOR3_B32 : VOP3_Real_gfx10<0x178>;
766 defm V_LSHLREV_B64 : VOP3_Real_gfx10<0x2ff>;
767 defm V_LSHRREV_B64 : VOP3_Real_gfx10<0x300>;
768 defm V_ASHRREV_I64 : VOP3_Real_gfx10<0x301>;
769 defm V_PERM_B32 : VOP3_Real_gfx10<0x344>;
770 defm V_XAD_U32 : VOP3_Real_gfx10<0x345>;
771 defm V_LSHL_ADD_U32 : VOP3_Real_gfx10<0x346>;
772 defm V_ADD_LSHL_U32 : VOP3_Real_gfx10<0x347>;
773 defm V_ADD3_U32 : VOP3_Real_gfx10<0x36d>;
774 defm V_LSHL_OR_B32 : VOP3_Real_gfx10<0x36f>;
775 defm V_AND_OR_B32 : VOP3_Real_gfx10<0x371>;
776 defm V_OR3_B32 : VOP3_Real_gfx10<0x372>;
778 // TODO-GFX10: add MC tests for v_add/sub_nc_i16
780 VOP3OpSel_Real_gfx10_with_name<0x30d, "V_ADD_I16", "v_add_nc_i16">;
782 VOP3OpSel_Real_gfx10_with_name<0x30e, "V_SUB_I16", "v_sub_nc_i16">;
784 VOP3_Real_gfx10_with_name<0x376, "V_SUB_I32_gfx9", "v_sub_nc_i32">;
786 VOP3_Real_gfx10_with_name<0x37f, "V_ADD_I32_gfx9", "v_add_nc_i32">;
788 defm V_INTERP_P1LL_F16 : VOP3Interp_Real_gfx10<0x342>;
789 defm V_INTERP_P1LV_F16 : VOP3Interp_Real_gfx10<0x343>;
790 defm V_INTERP_P2_F16 : VOP3Interp_Real_gfx10<0x35a>;
792 defm V_PACK_B32_F16 : VOP3OpSel_Real_gfx10<0x311>;
793 defm V_CVT_PKNORM_I16_F16 : VOP3OpSel_Real_gfx10<0x312>;
794 defm V_CVT_PKNORM_U16_F16 : VOP3OpSel_Real_gfx10<0x313>;
796 defm V_MIN3_F16 : VOP3OpSel_Real_gfx10<0x351>;
797 defm V_MIN3_I16 : VOP3OpSel_Real_gfx10<0x352>;
798 defm V_MIN3_U16 : VOP3OpSel_Real_gfx10<0x353>;
799 defm V_MAX3_F16 : VOP3OpSel_Real_gfx10<0x354>;
800 defm V_MAX3_I16 : VOP3OpSel_Real_gfx10<0x355>;
801 defm V_MAX3_U16 : VOP3OpSel_Real_gfx10<0x356>;
802 defm V_MED3_F16 : VOP3OpSel_Real_gfx10<0x357>;
803 defm V_MED3_I16 : VOP3OpSel_Real_gfx10<0x358>;
804 defm V_MED3_U16 : VOP3OpSel_Real_gfx10<0x359>;
805 defm V_MAD_U32_U16 : VOP3OpSel_Real_gfx10<0x373>;
806 defm V_MAD_I32_I16 : VOP3OpSel_Real_gfx10<0x375>;
809 VOP3OpSel_Real_gfx10_with_name<0x340, "V_MAD_U16_gfx9", "v_mad_u16">;
811 VOP3OpSel_Real_gfx10_with_name<0x34b, "V_FMA_F16_gfx9", "v_fma_f16">;
813 VOP3OpSel_Real_gfx10_with_name<0x35e, "V_MAD_I16_gfx9", "v_mad_i16">;
814 defm V_DIV_FIXUP_F16 :
815 VOP3OpSel_Real_gfx10_with_name<0x35f, "V_DIV_FIXUP_F16_gfx9", "v_div_fixup_f16">;
817 // FIXME-GFX10-OPSEL: Need to add "selective" opsel support to some of these
818 // (they do not support SDWA or DPP).
819 defm V_ADD_NC_U16 : VOP3_Real_gfx10_with_name<0x303, "V_ADD_U16_e64", "v_add_nc_u16">;
820 defm V_SUB_NC_U16 : VOP3_Real_gfx10_with_name<0x304, "V_SUB_U16_e64", "v_sub_nc_u16">;
821 defm V_MUL_LO_U16 : VOP3_Real_gfx10_with_name<0x305, "V_MUL_LO_U16_e64", "v_mul_lo_u16">;
822 defm V_LSHRREV_B16 : VOP3_Real_gfx10_with_name<0x307, "V_LSHRREV_B16_e64", "v_lshrrev_b16">;
823 defm V_ASHRREV_I16 : VOP3_Real_gfx10_with_name<0x308, "V_ASHRREV_I16_e64", "v_ashrrev_i16">;
824 defm V_MAX_U16 : VOP3_Real_gfx10_with_name<0x309, "V_MAX_U16_e64", "v_max_u16">;
825 defm V_MAX_I16 : VOP3_Real_gfx10_with_name<0x30a, "V_MAX_I16_e64", "v_max_i16">;
826 defm V_MIN_U16 : VOP3_Real_gfx10_with_name<0x30b, "V_MIN_U16_e64", "v_min_u16">;
827 defm V_MIN_I16 : VOP3_Real_gfx10_with_name<0x30c, "V_MIN_I16_e64", "v_min_i16">;
828 defm V_LSHLREV_B16 : VOP3_Real_gfx10_with_name<0x314, "V_LSHLREV_B16_e64", "v_lshlrev_b16">;
829 defm V_PERMLANE16_B32 : VOP3OpSel_Real_gfx10<0x377>;
830 defm V_PERMLANEX16_B32 : VOP3OpSel_Real_gfx10<0x378>;
832 //===----------------------------------------------------------------------===//
834 //===----------------------------------------------------------------------===//
836 let AssemblerPredicate = isGFX7Only, DecoderNamespace = "GFX7" in {
837 multiclass VOP3_Real_gfx7<bits<10> op> {
839 VOP3_Real<!cast<VOP3_Pseudo>(NAME), SIEncodingFamily.SI>,
840 VOP3e_gfx6_gfx7<op{8-0}, !cast<VOP3_Pseudo>(NAME).Pfl>;
842 multiclass VOP3be_Real_gfx7<bits<10> op> {
844 VOP3_Real<!cast<VOP3_Pseudo>(NAME), SIEncodingFamily.SI>,
845 VOP3be_gfx6_gfx7<op{8-0}, !cast<VOP3_Pseudo>(NAME).Pfl>;
847 } // End AssemblerPredicate = isGFX7Only, DecoderNamespace = "GFX7"
849 multiclass VOP3_Real_gfx7_gfx10<bits<10> op> :
850 VOP3_Real_gfx7<op>, VOP3_Real_gfx10<op>;
852 multiclass VOP3be_Real_gfx7_gfx10<bits<10> op> :
853 VOP3be_Real_gfx7<op>, VOP3be_Real_gfx10<op>;
855 defm V_QSAD_PK_U16_U8 : VOP3_Real_gfx7_gfx10<0x172>;
856 defm V_MQSAD_U32_U8 : VOP3_Real_gfx7_gfx10<0x175>;
857 defm V_MAD_U64_U32 : VOP3be_Real_gfx7_gfx10<0x176>;
858 defm V_MAD_I64_I32 : VOP3be_Real_gfx7_gfx10<0x177>;
860 //===----------------------------------------------------------------------===//
861 // GFX6, GFX7, GFX10.
862 //===----------------------------------------------------------------------===//
864 let AssemblerPredicate = isGFX6GFX7, DecoderNamespace = "GFX6GFX7" in {
865 multiclass VOP3_Real_gfx6_gfx7<bits<10> op> {
867 VOP3_Real<!cast<VOP3_Pseudo>(NAME), SIEncodingFamily.SI>,
868 VOP3e_gfx6_gfx7<op{8-0}, !cast<VOP3_Pseudo>(NAME).Pfl>;
870 multiclass VOP3be_Real_gfx6_gfx7<bits<10> op> {
872 VOP3_Real<!cast<VOP3_Pseudo>(NAME), SIEncodingFamily.SI>,
873 VOP3be_gfx6_gfx7<op{8-0}, !cast<VOP3_Pseudo>(NAME).Pfl>;
875 } // End AssemblerPredicate = isGFX6GFX7, DecoderNamespace = "GFX6GFX7"
877 multiclass VOP3_Real_gfx6_gfx7_gfx10<bits<10> op> :
878 VOP3_Real_gfx6_gfx7<op>, VOP3_Real_gfx10<op>;
880 multiclass VOP3be_Real_gfx6_gfx7_gfx10<bits<10> op> :
881 VOP3be_Real_gfx6_gfx7<op>, VOP3be_Real_gfx10<op>;
883 defm V_LSHL_B64 : VOP3_Real_gfx6_gfx7<0x161>;
884 defm V_LSHR_B64 : VOP3_Real_gfx6_gfx7<0x162>;
885 defm V_ASHR_I64 : VOP3_Real_gfx6_gfx7<0x163>;
887 defm V_MAD_LEGACY_F32 : VOP3_Real_gfx6_gfx7_gfx10<0x140>;
888 defm V_MAD_F32 : VOP3_Real_gfx6_gfx7_gfx10<0x141>;
889 defm V_MAD_I32_I24 : VOP3_Real_gfx6_gfx7_gfx10<0x142>;
890 defm V_MAD_U32_U24 : VOP3_Real_gfx6_gfx7_gfx10<0x143>;
891 defm V_CUBEID_F32 : VOP3_Real_gfx6_gfx7_gfx10<0x144>;
892 defm V_CUBESC_F32 : VOP3_Real_gfx6_gfx7_gfx10<0x145>;
893 defm V_CUBETC_F32 : VOP3_Real_gfx6_gfx7_gfx10<0x146>;
894 defm V_CUBEMA_F32 : VOP3_Real_gfx6_gfx7_gfx10<0x147>;
895 defm V_BFE_U32 : VOP3_Real_gfx6_gfx7_gfx10<0x148>;
896 defm V_BFE_I32 : VOP3_Real_gfx6_gfx7_gfx10<0x149>;
897 defm V_BFI_B32 : VOP3_Real_gfx6_gfx7_gfx10<0x14a>;
898 defm V_FMA_F32 : VOP3_Real_gfx6_gfx7_gfx10<0x14b>;
899 defm V_FMA_F64 : VOP3_Real_gfx6_gfx7_gfx10<0x14c>;
900 defm V_LERP_U8 : VOP3_Real_gfx6_gfx7_gfx10<0x14d>;
901 defm V_ALIGNBIT_B32 : VOP3_Real_gfx6_gfx7_gfx10<0x14e>;
902 defm V_ALIGNBYTE_B32 : VOP3_Real_gfx6_gfx7_gfx10<0x14f>;
903 defm V_MULLIT_F32 : VOP3_Real_gfx6_gfx7_gfx10<0x150>;
904 defm V_MIN3_F32 : VOP3_Real_gfx6_gfx7_gfx10<0x151>;
905 defm V_MIN3_I32 : VOP3_Real_gfx6_gfx7_gfx10<0x152>;
906 defm V_MIN3_U32 : VOP3_Real_gfx6_gfx7_gfx10<0x153>;
907 defm V_MAX3_F32 : VOP3_Real_gfx6_gfx7_gfx10<0x154>;
908 defm V_MAX3_I32 : VOP3_Real_gfx6_gfx7_gfx10<0x155>;
909 defm V_MAX3_U32 : VOP3_Real_gfx6_gfx7_gfx10<0x156>;
910 defm V_MED3_F32 : VOP3_Real_gfx6_gfx7_gfx10<0x157>;
911 defm V_MED3_I32 : VOP3_Real_gfx6_gfx7_gfx10<0x158>;
912 defm V_MED3_U32 : VOP3_Real_gfx6_gfx7_gfx10<0x159>;
913 defm V_SAD_U8 : VOP3_Real_gfx6_gfx7_gfx10<0x15a>;
914 defm V_SAD_HI_U8 : VOP3_Real_gfx6_gfx7_gfx10<0x15b>;
915 defm V_SAD_U16 : VOP3_Real_gfx6_gfx7_gfx10<0x15c>;
916 defm V_SAD_U32 : VOP3_Real_gfx6_gfx7_gfx10<0x15d>;
917 defm V_CVT_PK_U8_F32 : VOP3_Real_gfx6_gfx7_gfx10<0x15e>;
918 defm V_DIV_FIXUP_F32 : VOP3_Real_gfx6_gfx7_gfx10<0x15f>;
919 defm V_DIV_FIXUP_F64 : VOP3_Real_gfx6_gfx7_gfx10<0x160>;
920 defm V_ADD_F64 : VOP3_Real_gfx6_gfx7_gfx10<0x164>;
921 defm V_MUL_F64 : VOP3_Real_gfx6_gfx7_gfx10<0x165>;
922 defm V_MIN_F64 : VOP3_Real_gfx6_gfx7_gfx10<0x166>;
923 defm V_MAX_F64 : VOP3_Real_gfx6_gfx7_gfx10<0x167>;
924 defm V_LDEXP_F64 : VOP3_Real_gfx6_gfx7_gfx10<0x168>;
925 defm V_MUL_LO_U32 : VOP3_Real_gfx6_gfx7_gfx10<0x169>;
926 defm V_MUL_HI_U32 : VOP3_Real_gfx6_gfx7_gfx10<0x16a>;
927 defm V_MUL_LO_I32 : VOP3_Real_gfx6_gfx7_gfx10<0x16b>;
928 defm V_MUL_HI_I32 : VOP3_Real_gfx6_gfx7_gfx10<0x16c>;
929 defm V_DIV_FMAS_F32 : VOP3_Real_gfx6_gfx7_gfx10<0x16f>;
930 defm V_DIV_FMAS_F64 : VOP3_Real_gfx6_gfx7_gfx10<0x170>;
931 defm V_MSAD_U8 : VOP3_Real_gfx6_gfx7_gfx10<0x171>;
932 defm V_MQSAD_PK_U16_U8 : VOP3_Real_gfx6_gfx7_gfx10<0x173>;
933 defm V_TRIG_PREOP_F64 : VOP3_Real_gfx6_gfx7_gfx10<0x174>;
934 defm V_DIV_SCALE_F32 : VOP3be_Real_gfx6_gfx7_gfx10<0x16d>;
935 defm V_DIV_SCALE_F64 : VOP3be_Real_gfx6_gfx7_gfx10<0x16e>;
937 //===----------------------------------------------------------------------===//
939 //===----------------------------------------------------------------------===//
941 let AssemblerPredicates = [isGFX8GFX9], DecoderNamespace = "GFX8" in {
943 multiclass VOP3_Real_vi<bits<10> op> {
944 def _vi : VOP3_Real<!cast<VOP_Pseudo>(NAME), SIEncodingFamily.VI>,
945 VOP3e_vi <op, !cast<VOP_Pseudo>(NAME).Pfl>;
948 multiclass VOP3be_Real_vi<bits<10> op> {
949 def _vi : VOP3_Real<!cast<VOP_Pseudo>(NAME), SIEncodingFamily.VI>,
950 VOP3be_vi <op, !cast<VOP_Pseudo>(NAME).Pfl>;
953 multiclass VOP3OpSel_Real_gfx9<bits<10> op> {
954 def _vi : VOP3_Real<!cast<VOP_Pseudo>(NAME), SIEncodingFamily.VI>,
955 VOP3OpSel_gfx9 <op, !cast<VOP_Pseudo>(NAME).Pfl>;
958 multiclass VOP3Interp_Real_vi<bits<10> op> {
959 def _vi : VOP3_Real<!cast<VOP_Pseudo>(NAME), SIEncodingFamily.VI>,
960 VOP3Interp_vi <op, !cast<VOP_Pseudo>(NAME).Pfl>;
963 } // End AssemblerPredicates = [isGFX8GFX9], DecoderNamespace = "GFX8"
965 let AssemblerPredicates = [isGFX8Only], DecoderNamespace = "GFX8" in {
967 multiclass VOP3_F16_Real_vi<bits<10> op> {
968 def _vi : VOP3_Real<!cast<VOP3_Pseudo>(NAME), SIEncodingFamily.VI>,
969 VOP3e_vi <op, !cast<VOP3_Pseudo>(NAME).Pfl>;
972 multiclass VOP3Interp_F16_Real_vi<bits<10> op> {
973 def _vi : VOP3_Real<!cast<VOP3_Pseudo>(NAME), SIEncodingFamily.VI>,
974 VOP3Interp_vi <op, !cast<VOP3_Pseudo>(NAME).Pfl>;
977 } // End AssemblerPredicates = [isGFX8Only], DecoderNamespace = "GFX8"
979 let AssemblerPredicates = [isGFX9Only], DecoderNamespace = "GFX9" in {
981 multiclass VOP3_F16_Real_gfx9<bits<10> op, string OpName, string AsmName> {
982 def _gfx9 : VOP3_Real<!cast<VOP3_Pseudo>(OpName), SIEncodingFamily.GFX9>,
983 VOP3e_vi <op, !cast<VOP3_Pseudo>(OpName).Pfl> {
984 VOP3_Pseudo ps = !cast<VOP3_Pseudo>(OpName);
985 let AsmString = AsmName # ps.AsmOperands;
989 multiclass VOP3OpSel_F16_Real_gfx9<bits<10> op, string AsmName> {
990 def _gfx9 : VOP3_Real<!cast<VOP3_Pseudo>(NAME), SIEncodingFamily.GFX9>,
991 VOP3OpSel_gfx9 <op, !cast<VOP3_Pseudo>(NAME).Pfl> {
992 VOP3_Pseudo ps = !cast<VOP3_Pseudo>(NAME);
993 let AsmString = AsmName # ps.AsmOperands;
997 multiclass VOP3Interp_F16_Real_gfx9<bits<10> op, string OpName, string AsmName> {
998 def _gfx9 : VOP3_Real<!cast<VOP3_Pseudo>(OpName), SIEncodingFamily.GFX9>,
999 VOP3Interp_vi <op, !cast<VOP3_Pseudo>(OpName).Pfl> {
1000 VOP3_Pseudo ps = !cast<VOP3_Pseudo>(OpName);
1001 let AsmString = AsmName # ps.AsmOperands;
1005 multiclass VOP3_Real_gfx9<bits<10> op, string AsmName> {
1006 def _gfx9 : VOP3_Real<!cast<VOP_Pseudo>(NAME), SIEncodingFamily.GFX9>,
1007 VOP3e_vi <op, !cast<VOP_Pseudo>(NAME).Pfl> {
1008 VOP_Pseudo ps = !cast<VOP_Pseudo>(NAME);
1009 let AsmString = AsmName # ps.AsmOperands;
1013 } // End AssemblerPredicates = [isGFX9Only], DecoderNamespace = "GFX9"
1015 defm V_MAD_U64_U32 : VOP3be_Real_vi <0x1E8>;
1016 defm V_MAD_I64_I32 : VOP3be_Real_vi <0x1E9>;
1018 defm V_MAD_LEGACY_F32 : VOP3_Real_vi <0x1c0>;
1019 defm V_MAD_F32 : VOP3_Real_vi <0x1c1>;
1020 defm V_MAD_I32_I24 : VOP3_Real_vi <0x1c2>;
1021 defm V_MAD_U32_U24 : VOP3_Real_vi <0x1c3>;
1022 defm V_CUBEID_F32 : VOP3_Real_vi <0x1c4>;
1023 defm V_CUBESC_F32 : VOP3_Real_vi <0x1c5>;
1024 defm V_CUBETC_F32 : VOP3_Real_vi <0x1c6>;
1025 defm V_CUBEMA_F32 : VOP3_Real_vi <0x1c7>;
1026 defm V_BFE_U32 : VOP3_Real_vi <0x1c8>;
1027 defm V_BFE_I32 : VOP3_Real_vi <0x1c9>;
1028 defm V_BFI_B32 : VOP3_Real_vi <0x1ca>;
1029 defm V_FMA_F32 : VOP3_Real_vi <0x1cb>;
1030 defm V_FMA_F64 : VOP3_Real_vi <0x1cc>;
1031 defm V_LERP_U8 : VOP3_Real_vi <0x1cd>;
1032 defm V_ALIGNBIT_B32 : VOP3_Real_vi <0x1ce>;
1033 defm V_ALIGNBYTE_B32 : VOP3_Real_vi <0x1cf>;
1034 defm V_MIN3_F32 : VOP3_Real_vi <0x1d0>;
1035 defm V_MIN3_I32 : VOP3_Real_vi <0x1d1>;
1036 defm V_MIN3_U32 : VOP3_Real_vi <0x1d2>;
1037 defm V_MAX3_F32 : VOP3_Real_vi <0x1d3>;
1038 defm V_MAX3_I32 : VOP3_Real_vi <0x1d4>;
1039 defm V_MAX3_U32 : VOP3_Real_vi <0x1d5>;
1040 defm V_MED3_F32 : VOP3_Real_vi <0x1d6>;
1041 defm V_MED3_I32 : VOP3_Real_vi <0x1d7>;
1042 defm V_MED3_U32 : VOP3_Real_vi <0x1d8>;
1043 defm V_SAD_U8 : VOP3_Real_vi <0x1d9>;
1044 defm V_SAD_HI_U8 : VOP3_Real_vi <0x1da>;
1045 defm V_SAD_U16 : VOP3_Real_vi <0x1db>;
1046 defm V_SAD_U32 : VOP3_Real_vi <0x1dc>;
1047 defm V_CVT_PK_U8_F32 : VOP3_Real_vi <0x1dd>;
1048 defm V_DIV_FIXUP_F32 : VOP3_Real_vi <0x1de>;
1049 defm V_DIV_FIXUP_F64 : VOP3_Real_vi <0x1df>;
1050 defm V_DIV_SCALE_F32 : VOP3be_Real_vi <0x1e0>;
1051 defm V_DIV_SCALE_F64 : VOP3be_Real_vi <0x1e1>;
1052 defm V_DIV_FMAS_F32 : VOP3_Real_vi <0x1e2>;
1053 defm V_DIV_FMAS_F64 : VOP3_Real_vi <0x1e3>;
1054 defm V_MSAD_U8 : VOP3_Real_vi <0x1e4>;
1055 defm V_QSAD_PK_U16_U8 : VOP3_Real_vi <0x1e5>;
1056 defm V_MQSAD_PK_U16_U8 : VOP3_Real_vi <0x1e6>;
1057 defm V_MQSAD_U32_U8 : VOP3_Real_vi <0x1e7>;
1059 defm V_PERM_B32 : VOP3_Real_vi <0x1ed>;
1061 defm V_MAD_F16 : VOP3_F16_Real_vi <0x1ea>;
1062 defm V_MAD_U16 : VOP3_F16_Real_vi <0x1eb>;
1063 defm V_MAD_I16 : VOP3_F16_Real_vi <0x1ec>;
1064 defm V_FMA_F16 : VOP3_F16_Real_vi <0x1ee>;
1065 defm V_DIV_FIXUP_F16 : VOP3_F16_Real_vi <0x1ef>;
1066 defm V_INTERP_P2_F16 : VOP3Interp_F16_Real_vi <0x276>;
1068 let FPDPRounding = 1 in {
1069 defm V_MAD_LEGACY_F16 : VOP3_F16_Real_gfx9 <0x1ea, "V_MAD_F16", "v_mad_legacy_f16">;
1070 defm V_FMA_LEGACY_F16 : VOP3_F16_Real_gfx9 <0x1ee, "V_FMA_F16", "v_fma_legacy_f16">;
1071 defm V_DIV_FIXUP_LEGACY_F16 : VOP3_F16_Real_gfx9 <0x1ef, "V_DIV_FIXUP_F16", "v_div_fixup_legacy_f16">;
1072 defm V_INTERP_P2_LEGACY_F16 : VOP3Interp_F16_Real_gfx9 <0x276, "V_INTERP_P2_F16", "v_interp_p2_legacy_f16">;
1073 } // End FPDPRounding = 1
1075 defm V_MAD_LEGACY_U16 : VOP3_F16_Real_gfx9 <0x1eb, "V_MAD_U16", "v_mad_legacy_u16">;
1076 defm V_MAD_LEGACY_I16 : VOP3_F16_Real_gfx9 <0x1ec, "V_MAD_I16", "v_mad_legacy_i16">;
1078 defm V_MAD_F16_gfx9 : VOP3OpSel_F16_Real_gfx9 <0x203, "v_mad_f16">;
1079 defm V_MAD_U16_gfx9 : VOP3OpSel_F16_Real_gfx9 <0x204, "v_mad_u16">;
1080 defm V_MAD_I16_gfx9 : VOP3OpSel_F16_Real_gfx9 <0x205, "v_mad_i16">;
1081 defm V_FMA_F16_gfx9 : VOP3OpSel_F16_Real_gfx9 <0x206, "v_fma_f16">;
1082 defm V_DIV_FIXUP_F16_gfx9 : VOP3OpSel_F16_Real_gfx9 <0x207, "v_div_fixup_f16">;
1083 defm V_INTERP_P2_F16_gfx9 : VOP3Interp_F16_Real_gfx9 <0x277, "V_INTERP_P2_F16_gfx9", "v_interp_p2_f16">;
1085 defm V_ADD_I32_gfx9 : VOP3_Real_gfx9 <0x29c, "v_add_i32">;
1086 defm V_SUB_I32_gfx9 : VOP3_Real_gfx9 <0x29d, "v_sub_i32">;
1088 defm V_INTERP_P1_F32_e64 : VOP3Interp_Real_vi <0x270>;
1089 defm V_INTERP_P2_F32_e64 : VOP3Interp_Real_vi <0x271>;
1090 defm V_INTERP_MOV_F32_e64 : VOP3Interp_Real_vi <0x272>;
1092 defm V_INTERP_P1LL_F16 : VOP3Interp_Real_vi <0x274>;
1093 defm V_INTERP_P1LV_F16 : VOP3Interp_Real_vi <0x275>;
1094 defm V_ADD_F64 : VOP3_Real_vi <0x280>;
1095 defm V_MUL_F64 : VOP3_Real_vi <0x281>;
1096 defm V_MIN_F64 : VOP3_Real_vi <0x282>;
1097 defm V_MAX_F64 : VOP3_Real_vi <0x283>;
1098 defm V_LDEXP_F64 : VOP3_Real_vi <0x284>;
1099 defm V_MUL_LO_U32 : VOP3_Real_vi <0x285>;
1101 // removed from VI as identical to V_MUL_LO_U32
1102 let isAsmParserOnly = 1 in {
1103 defm V_MUL_LO_I32 : VOP3_Real_vi <0x285>;
1106 defm V_MUL_HI_U32 : VOP3_Real_vi <0x286>;
1107 defm V_MUL_HI_I32 : VOP3_Real_vi <0x287>;
1109 defm V_READLANE_B32 : VOP3_Real_vi <0x289>;
1110 defm V_WRITELANE_B32 : VOP3_Real_vi <0x28a>;
1112 defm V_LSHLREV_B64 : VOP3_Real_vi <0x28f>;
1113 defm V_LSHRREV_B64 : VOP3_Real_vi <0x290>;
1114 defm V_ASHRREV_I64 : VOP3_Real_vi <0x291>;
1115 defm V_TRIG_PREOP_F64 : VOP3_Real_vi <0x292>;
1117 defm V_LSHL_ADD_U32 : VOP3_Real_vi <0x1fd>;
1118 defm V_ADD_LSHL_U32 : VOP3_Real_vi <0x1fe>;
1119 defm V_ADD3_U32 : VOP3_Real_vi <0x1ff>;
1120 defm V_LSHL_OR_B32 : VOP3_Real_vi <0x200>;
1121 defm V_AND_OR_B32 : VOP3_Real_vi <0x201>;
1122 defm V_OR3_B32 : VOP3_Real_vi <0x202>;
1123 defm V_PACK_B32_F16 : VOP3OpSel_Real_gfx9 <0x2a0>;
1125 defm V_XAD_U32 : VOP3_Real_vi <0x1f3>;
1127 defm V_MIN3_F16 : VOP3OpSel_Real_gfx9 <0x1f4>;
1128 defm V_MIN3_I16 : VOP3OpSel_Real_gfx9 <0x1f5>;
1129 defm V_MIN3_U16 : VOP3OpSel_Real_gfx9 <0x1f6>;
1131 defm V_MAX3_F16 : VOP3OpSel_Real_gfx9 <0x1f7>;
1132 defm V_MAX3_I16 : VOP3OpSel_Real_gfx9 <0x1f8>;
1133 defm V_MAX3_U16 : VOP3OpSel_Real_gfx9 <0x1f9>;
1135 defm V_MED3_F16 : VOP3OpSel_Real_gfx9 <0x1fa>;
1136 defm V_MED3_I16 : VOP3OpSel_Real_gfx9 <0x1fb>;
1137 defm V_MED3_U16 : VOP3OpSel_Real_gfx9 <0x1fc>;
1139 defm V_ADD_I16 : VOP3OpSel_Real_gfx9 <0x29e>;
1140 defm V_SUB_I16 : VOP3OpSel_Real_gfx9 <0x29f>;
1142 defm V_MAD_U32_U16 : VOP3OpSel_Real_gfx9 <0x1f1>;
1143 defm V_MAD_I32_I16 : VOP3OpSel_Real_gfx9 <0x1f2>;
1145 defm V_CVT_PKNORM_I16_F16 : VOP3OpSel_Real_gfx9 <0x299>;
1146 defm V_CVT_PKNORM_U16_F16 : VOP3OpSel_Real_gfx9 <0x29a>;