1 //===-- VOP3Instructions.td - Vector Instruction Definitions --------------===//
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 // Special case for v_div_fmas_{f32|f64}, since it seems to be the
10 // only VOP instruction that implicitly reads VCC.
11 let Asm64 = " $vdst, $src0_modifiers, $src1_modifiers, $src2_modifiers$clamp$omod" in {
12 def VOP_F32_F32_F32_F32_VCC : VOPProfile<[f32, f32, f32, f32]> {
13 let Outs64 = (outs DstRC.RegClass:$vdst);
14 let HasExtVOP3DPP = 0;
18 def VOP_F64_F64_F64_F64_VCC : VOPProfile<[f64, f64, f64, f64]> {
19 let Outs64 = (outs DstRC.RegClass:$vdst);
24 class VOP3b_Profile<ValueType vt> : VOPProfile<[vt, vt, vt, vt]> {
25 let Outs64 = (outs DstRC:$vdst, VOPDstS64orS32:$sdst);
26 let Asm64 = "$vdst, $sdst, $src0_modifiers, $src1_modifiers, $src2_modifiers$clamp$omod";
28 let HasExtVOP3DPP = 0;
32 def VOP3b_F32_I1_F32_F32_F32 : VOP3b_Profile<f32>;
33 def VOP3b_F64_I1_F64_F64_F64 : VOP3b_Profile<f64>;
35 def VOP3b_I64_I1_I32_I32_I64 : VOPProfile<[i64, i32, i32, i64]> {
39 let Outs64 = (outs DstRC:$vdst, VOPDstS64orS32:$sdst);
40 let Asm64 = "$vdst, $sdst, $src0, $src1, $src2$clamp";
43 class V_MUL_PROF<VOPProfile P> : VOP3_Profile<P> {
44 let HasExtVOP3DPP = 0;
48 def DIV_FIXUP_F32_PROF : VOP3_Profile<VOP_F32_F32_F32_F32> {
49 let HasExtVOP3DPP = 0;
53 //===----------------------------------------------------------------------===//
55 //===----------------------------------------------------------------------===//
57 class VOP3Interp<string OpName, VOPProfile P, list<dag> pattern = []> :
58 VOP3_Pseudo<OpName, P, pattern> {
59 let AsmMatchConverter = "cvtVOP3Interp";
60 let mayRaiseFPException = 0;
63 def VOP3_INTERP : VOPProfile<[f32, f32, i32, untyped]> {
64 let Src0Mod = FPVRegInputMods;
65 let Ins64 = (ins Src0Mod:$src0_modifiers, VRegSrc_32:$src0,
66 InterpAttr:$attr, InterpAttrChan:$attrchan,
67 Clamp0:$clamp, omod0:$omod);
69 let Asm64 = "$vdst, $src0_modifiers, $attr$attrchan$clamp$omod";
72 def VOP3_INTERP_MOV : VOPProfile<[f32, i32, i32, untyped]> {
73 let Ins64 = (ins InterpSlot:$src0,
74 InterpAttr:$attr, InterpAttrChan:$attrchan,
75 Clamp0:$clamp, omod0:$omod);
77 let Asm64 = "$vdst, $src0, $attr$attrchan$clamp$omod";
83 class getInterp16Asm <bit HasSrc2, bit HasOMod> {
84 string src2 = !if(HasSrc2, ", $src2_modifiers", "");
85 string omod = !if(HasOMod, "$omod", "");
87 " $vdst, $src0_modifiers, $attr$attrchan"#src2#"$high$clamp"#omod;
90 class getInterp16Ins <bit HasSrc2, bit HasOMod,
91 Operand Src0Mod, Operand Src2Mod> {
92 dag ret = !if(HasSrc2,
94 (ins Src0Mod:$src0_modifiers, VRegSrc_32:$src0,
95 InterpAttr:$attr, InterpAttrChan:$attrchan,
96 Src2Mod:$src2_modifiers, VRegSrc_32:$src2,
97 highmod:$high, Clamp0:$clamp, omod0:$omod),
98 (ins Src0Mod:$src0_modifiers, VRegSrc_32:$src0,
99 InterpAttr:$attr, InterpAttrChan:$attrchan,
100 Src2Mod:$src2_modifiers, VRegSrc_32:$src2,
101 highmod:$high, Clamp0:$clamp)
103 (ins Src0Mod:$src0_modifiers, VRegSrc_32:$src0,
104 InterpAttr:$attr, InterpAttrChan:$attrchan,
105 highmod:$high, Clamp0:$clamp, omod0:$omod)
109 class VOP3_INTERP16 <list<ValueType> ArgVT> : VOPProfile<ArgVT> {
111 let HasOMod = !ne(DstVT.Value, f16.Value);
114 let Src0Mod = FPVRegInputMods;
115 let Src2Mod = FPVRegInputMods;
117 let Outs64 = (outs DstRC.RegClass:$vdst);
118 let Ins64 = getInterp16Ins<HasSrc2, HasOMod, Src0Mod, Src2Mod>.ret;
119 let Asm64 = getInterp16Asm<HasSrc2, HasOMod>.ret;
122 //===----------------------------------------------------------------------===//
124 //===----------------------------------------------------------------------===//
126 let isCommutable = 1 in {
128 let isReMaterializable = 1 in {
129 let mayRaiseFPException = 0 in {
130 let SubtargetPredicate = HasMadMacF32Insts in {
131 defm V_MAD_LEGACY_F32 : VOP3Inst <"v_mad_legacy_f32", VOP3_Profile<VOP_F32_F32_F32_F32>>;
132 defm V_MAD_F32 : VOP3Inst <"v_mad_f32", VOP3_Profile<VOP_F32_F32_F32_F32>, any_fmad>;
133 } // End SubtargetPredicate = HasMadMacInsts
135 let SubtargetPredicate = HasFmaLegacy32 in
136 defm V_FMA_LEGACY_F32 : VOP3Inst <"v_fma_legacy_f32",
137 VOP3_Profile<VOP_F32_F32_F32_F32>,
138 int_amdgcn_fma_legacy>;
141 defm V_MAD_I32_I24 : VOP3Inst <"v_mad_i32_i24", VOP3_Profile<VOP_I32_I32_I32_I32, VOP3_CLAMP>>;
142 defm V_MAD_U32_U24 : VOP3Inst <"v_mad_u32_u24", VOP3_Profile<VOP_I32_I32_I32_I32, VOP3_CLAMP>>;
143 defm V_FMA_F32 : VOP3Inst <"v_fma_f32", VOP3_Profile<VOP_F32_F32_F32_F32>, any_fma>;
144 defm V_LERP_U8 : VOP3Inst <"v_lerp_u8", VOP3_Profile<VOP_I32_I32_I32_I32>, int_amdgcn_lerp>;
146 let SchedRW = [WriteDoubleAdd] in {
147 let FPDPRounding = 1 in {
148 defm V_FMA_F64 : VOP3Inst <"v_fma_f64", VOP3_Profile<VOP_F64_F64_F64_F64>, any_fma>;
149 let SubtargetPredicate = isNotGFX12Plus in {
150 defm V_ADD_F64 : VOP3Inst <"v_add_f64", VOP3_Profile<VOP_F64_F64_F64>, any_fadd>;
151 defm V_MUL_F64 : VOP3Inst <"v_mul_f64", VOP3_Profile<VOP_F64_F64_F64>, any_fmul>;
152 } // End SubtargetPredicate = isNotGFX12Plus
153 } // End FPDPRounding = 1
154 let SubtargetPredicate = isNotGFX12Plus in {
155 defm V_MIN_F64 : VOP3Inst <"v_min_f64", VOP3_Profile<VOP_F64_F64_F64>, fminnum_like>;
156 defm V_MAX_F64 : VOP3Inst <"v_max_f64", VOP3_Profile<VOP_F64_F64_F64>, fmaxnum_like>;
157 } // End SubtargetPredicate = isNotGFX12Plus
158 } // End SchedRW = [WriteDoubleAdd]
160 let SchedRW = [WriteIntMul], IsInvalidSingleUseConsumer = 1 in {
161 defm V_MUL_LO_U32 : VOP3Inst <"v_mul_lo_u32", V_MUL_PROF<VOP_I32_I32_I32>, DivergentBinFrag<mul>>;
162 defm V_MUL_HI_U32 : VOP3Inst <"v_mul_hi_u32", V_MUL_PROF<VOP_I32_I32_I32>, mulhu>;
163 defm V_MUL_LO_I32 : VOP3Inst <"v_mul_lo_i32", V_MUL_PROF<VOP_I32_I32_I32>>;
164 defm V_MUL_HI_I32 : VOP3Inst <"v_mul_hi_i32", V_MUL_PROF<VOP_I32_I32_I32>, mulhs>;
165 } // End SchedRW = [WriteIntMul], IsInvalidSingleUseConsumer = 1
167 let SubtargetPredicate = isGFX12Plus, ReadsModeReg = 0 in {
168 defm V_MINIMUM_F32 : VOP3Inst <"v_minimum_f32", VOP3_Profile<VOP_F32_F32_F32>, DivergentBinFrag<fminimum>>;
169 defm V_MAXIMUM_F32 : VOP3Inst <"v_maximum_f32", VOP3_Profile<VOP_F32_F32_F32>, DivergentBinFrag<fmaximum>>;
170 defm V_MINIMUM_F16 : VOP3Inst <"v_minimum_f16", VOP3_Profile<VOP_F16_F16_F16>, DivergentBinFrag<fminimum>>;
171 defm V_MAXIMUM_F16 : VOP3Inst <"v_maximum_f16", VOP3_Profile<VOP_F16_F16_F16>, DivergentBinFrag<fmaximum>>;
173 let SchedRW = [WriteDoubleAdd] in {
174 defm V_MINIMUM_F64 : VOP3Inst <"v_minimum_f64", VOP3_Profile<VOP_F64_F64_F64>, fminimum>;
175 defm V_MAXIMUM_F64 : VOP3Inst <"v_maximum_f64", VOP3_Profile<VOP_F64_F64_F64>, fmaximum>;
176 } // End SchedRW = [WriteDoubleAdd]
177 } // End SubtargetPredicate = isGFX12Plus, ReadsModeReg = 0
179 } // End isReMaterializable = 1
181 let Uses = [MODE, VCC, EXEC] in {
183 // result = src0 * src1 + src2
187 let SchedRW = [WriteFloatFMA] in
188 defm V_DIV_FMAS_F32 : VOP3Inst_Pseudo_Wrapper <"v_div_fmas_f32", VOP_F32_F32_F32_F32_VCC, []>;
190 // result = src0 * src1 + src2
194 let SchedRW = [WriteDouble], FPDPRounding = 1 in
195 defm V_DIV_FMAS_F64 : VOP3Inst_Pseudo_Wrapper <"v_div_fmas_f64", VOP_F64_F64_F64_F64_VCC, []>;
196 } // End Uses = [MODE, VCC, EXEC]
198 } // End isCommutable = 1
200 let isReMaterializable = 1 in {
201 let mayRaiseFPException = 0 in {
202 defm V_CUBEID_F32 : VOP3Inst <"v_cubeid_f32", VOP3_Profile<VOP_F32_F32_F32_F32>, int_amdgcn_cubeid>;
203 defm V_CUBESC_F32 : VOP3Inst <"v_cubesc_f32", VOP3_Profile<VOP_F32_F32_F32_F32>, int_amdgcn_cubesc>;
204 defm V_CUBETC_F32 : VOP3Inst <"v_cubetc_f32", VOP3_Profile<VOP_F32_F32_F32_F32>, int_amdgcn_cubetc>;
205 defm V_CUBEMA_F32 : VOP3Inst <"v_cubema_f32", VOP3_Profile<VOP_F32_F32_F32_F32>, int_amdgcn_cubema>;
206 } // End mayRaiseFPException
208 defm V_BFE_U32 : VOP3Inst <"v_bfe_u32", VOP3_Profile<VOP_I32_I32_I32_I32>, AMDGPUbfe_u32>;
209 defm V_BFE_I32 : VOP3Inst <"v_bfe_i32", VOP3_Profile<VOP_I32_I32_I32_I32>, AMDGPUbfe_i32>;
210 defm V_BFI_B32 : VOP3Inst <"v_bfi_b32", VOP3_Profile<VOP_I32_I32_I32_I32>, AMDGPUbfi>;
211 defm V_ALIGNBIT_B32 : VOP3Inst <"v_alignbit_b32", VOP3_Profile<VOP_I32_I32_I32_I32>, fshr>;
212 defm V_ALIGNBYTE_B32 : VOP3Inst <"v_alignbyte_b32", VOP3_Profile<VOP_I32_I32_I32_I32>, int_amdgcn_alignbyte>;
214 // XXX - No FPException seems suspect but manual doesn't say it does
215 let mayRaiseFPException = 0 in {
216 let isCommutable = 1 in {
217 defm V_MIN3_I32 : VOP3Inst <"v_min3_i32", VOP3_Profile<VOP_I32_I32_I32_I32>, AMDGPUsmin3>;
218 defm V_MIN3_U32 : VOP3Inst <"v_min3_u32", VOP3_Profile<VOP_I32_I32_I32_I32>, AMDGPUumin3>;
219 defm V_MAX3_I32 : VOP3Inst <"v_max3_i32", VOP3_Profile<VOP_I32_I32_I32_I32>, AMDGPUsmax3>;
220 defm V_MAX3_U32 : VOP3Inst <"v_max3_u32", VOP3_Profile<VOP_I32_I32_I32_I32>, AMDGPUumax3>;
221 defm V_MED3_I32 : VOP3Inst <"v_med3_i32", VOP3_Profile<VOP_I32_I32_I32_I32>, AMDGPUsmed3>;
222 defm V_MED3_U32 : VOP3Inst <"v_med3_u32", VOP3_Profile<VOP_I32_I32_I32_I32>, AMDGPUumed3>;
223 } // End isCommutable = 1
224 defm V_MIN3_F32 : VOP3Inst <"v_min3_f32", VOP3_Profile<VOP_F32_F32_F32_F32>, AMDGPUfmin3>;
225 defm V_MAX3_F32 : VOP3Inst <"v_max3_f32", VOP3_Profile<VOP_F32_F32_F32_F32>, AMDGPUfmax3>;
226 defm V_MED3_F32 : VOP3Inst <"v_med3_f32", VOP3_Profile<VOP_F32_F32_F32_F32>, AMDGPUfmed3>;
227 } // End mayRaiseFPException = 0
229 let SubtargetPredicate = isGFX12Plus, ReadsModeReg = 0 in {
230 defm V_MINIMUM3_F32 : VOP3Inst <"v_minimum3_f32", VOP3_Profile<VOP_F32_F32_F32_F32>, AMDGPUfminimum3>;
231 defm V_MAXIMUM3_F32 : VOP3Inst <"v_maximum3_f32", VOP3_Profile<VOP_F32_F32_F32_F32>, AMDGPUfmaximum3>;
232 } // End SubtargetPredicate = isGFX12Plus, ReadsModeReg = 0
234 let isCommutable = 1 in {
235 defm V_SAD_U8 : VOP3Inst <"v_sad_u8", VOP3_Profile<VOP_I32_I32_I32_I32, VOP3_CLAMP>>;
236 defm V_SAD_HI_U8 : VOP3Inst <"v_sad_hi_u8", VOP3_Profile<VOP_I32_I32_I32_I32, VOP3_CLAMP>>;
237 defm V_SAD_U16 : VOP3Inst <"v_sad_u16", VOP3_Profile<VOP_I32_I32_I32_I32, VOP3_CLAMP>>;
238 defm V_SAD_U32 : VOP3Inst <"v_sad_u32", VOP3_Profile<VOP_I32_I32_I32_I32, VOP3_CLAMP>>;
239 } // End isCommutable = 1
240 defm V_CVT_PK_U8_F32 : VOP3Inst<"v_cvt_pk_u8_f32", VOP3_Profile<VOP_I32_F32_I32_I32>, int_amdgcn_cvt_pk_u8_f32>;
242 defm V_DIV_FIXUP_F32 : VOP3Inst <"v_div_fixup_f32", DIV_FIXUP_F32_PROF, AMDGPUdiv_fixup>;
244 let SchedRW = [WriteDoubleAdd], FPDPRounding = 1 in {
245 defm V_DIV_FIXUP_F64 : VOP3Inst <"v_div_fixup_f64", VOP3_Profile<VOP_F64_F64_F64_F64>, AMDGPUdiv_fixup>;
246 defm V_LDEXP_F64 : VOP3Inst <"v_ldexp_f64", VOP3_Profile<VOP_F64_F64_I32>, any_fldexp>;
247 } // End SchedRW = [WriteDoubleAdd], FPDPRounding = 1
248 } // End isReMaterializable = 1
251 let mayRaiseFPException = 0 in { // Seems suspicious but manual doesn't say it does.
252 let SchedRW = [WriteFloatFMA, WriteSALU] in
253 defm V_DIV_SCALE_F32 : VOP3Inst_Pseudo_Wrapper <"v_div_scale_f32", VOP3b_F32_I1_F32_F32_F32> ;
255 // Double precision division pre-scale.
256 let SchedRW = [WriteDouble, WriteSALU], FPDPRounding = 1 in
257 defm V_DIV_SCALE_F64 : VOP3Inst_Pseudo_Wrapper <"v_div_scale_f64", VOP3b_F64_I1_F64_F64_F64>;
258 } // End mayRaiseFPException = 0
260 let isReMaterializable = 1 in
261 defm V_MSAD_U8 : VOP3Inst <"v_msad_u8", VOP3_Profile<VOP_I32_I32_I32_I32, VOP3_CLAMP>>;
263 let Constraints = "@earlyclobber $vdst", IsInvalidSingleUseConsumer = 1 in {
264 defm V_MQSAD_PK_U16_U8 : VOP3Inst <"v_mqsad_pk_u16_u8", VOP3_Profile<VOP_I64_I64_I32_I64, VOP3_CLAMP>>;
265 } // End Constraints = "@earlyclobber $vdst", IsInvalidSingleUseConsumer = 1
268 let isReMaterializable = 1 in {
269 let SchedRW = [WriteDouble] in {
270 defm V_TRIG_PREOP_F64 : VOP3Inst <"v_trig_preop_f64", VOP3_Profile<VOP_F64_F64_I32>, int_amdgcn_trig_preop>;
271 } // End SchedRW = [WriteDouble]
273 let SchedRW = [Write64Bit] in {
274 let SubtargetPredicate = isGFX6GFX7 in {
275 defm V_LSHL_B64 : VOP3Inst <"v_lshl_b64", VOP3_Profile<VOP_I64_I64_I32>, cshl_64>;
276 defm V_LSHR_B64 : VOP3Inst <"v_lshr_b64", VOP3_Profile<VOP_I64_I64_I32>, csrl_64>;
277 defm V_ASHR_I64 : VOP3Inst <"v_ashr_i64", VOP3_Profile<VOP_I64_I64_I32>, csra_64>;
278 } // End SubtargetPredicate = isGFX6GFX7
280 let IsInvalidSingleUseConsumer = 1 in {
281 let SubtargetPredicate = isGFX8Plus in {
282 defm V_LSHRREV_B64 : VOP3Inst <"v_lshrrev_b64", VOP3_Profile<VOP_I64_I32_I64>, clshr_rev_64>;
283 defm V_ASHRREV_I64 : VOP3Inst <"v_ashrrev_i64", VOP3_Profile<VOP_I64_I32_I64>, cashr_rev_64>;
284 } // End SubtargetPredicate = isGFX8Plus, , IsInvalidSingleUseConsumer = 1
286 let SubtargetPredicate = isGFX8GFX9GFX10GFX11 in {
287 defm V_LSHLREV_B64 : VOP3Inst <"v_lshlrev_b64", VOP3_Profile<VOP_I64_I32_I64>, clshl_rev_64>;
288 } // End SubtargetPredicate = isGFX8GFX9GFX10GFX11
289 } // End IsInvalidSingleUseConsumer = 1
290 } // End SchedRW = [Write64Bit]
291 } // End isReMaterializable = 1
294 (i32 (DivergentUnaryFrag<sext> i16:$src)),
295 (i32 (V_BFE_I32_e64 i16:$src, (i32 0), (i32 0x10)))
298 let isReMaterializable = 1 in {
299 let SubtargetPredicate = isGFX6GFX7GFX10Plus in {
300 defm V_MULLIT_F32 : VOP3Inst <"v_mullit_f32", VOP3_Profile<VOP_F32_F32_F32_F32>>;
301 } // End SubtargetPredicate = isGFX6GFX7GFX10Plus
303 let SchedRW = [Write32Bit] in {
304 let SubtargetPredicate = isGFX8Plus in {
305 defm V_PERM_B32 : VOP3Inst <"v_perm_b32", VOP3_Profile<VOP_I32_I32_I32_I32>, AMDGPUperm>;
306 } // End SubtargetPredicate = isGFX8Plus
307 } // End SchedRW = [Write32Bit]
308 } // End isReMaterializable = 1
310 def VOPProfileMQSAD : VOP3_Profile<VOP_V4I32_I64_I32_V4I32, VOP3_CLAMP> {
311 let HasModifiers = 0;
314 let SubtargetPredicate = isGFX7Plus, IsInvalidSingleUseConsumer = 1 in {
315 let Constraints = "@earlyclobber $vdst", SchedRW = [WriteQuarterRate32] in {
316 defm V_QSAD_PK_U16_U8 : VOP3Inst <"v_qsad_pk_u16_u8", VOP3_Profile<VOP_I64_I64_I32_I64, VOP3_CLAMP>>;
317 defm V_MQSAD_U32_U8 : VOP3Inst <"v_mqsad_u32_u8", VOPProfileMQSAD>;
318 } // End Constraints = "@earlyclobber $vdst", SchedRW = [WriteQuarterRate32]
319 } // End SubtargetPredicate = isGFX7Plus, IsInvalidSingleUseConsumer = 1
321 let isCommutable = 1, SchedRW = [WriteIntMul, WriteSALU], IsInvalidSingleUseConsumer = 1 in {
322 let SubtargetPredicate = isGFX7Plus, OtherPredicates = [HasNotMADIntraFwdBug] in {
323 defm V_MAD_U64_U32 : VOP3Inst <"v_mad_u64_u32", VOP3b_I64_I1_I32_I32_I64>;
324 defm V_MAD_I64_I32 : VOP3Inst <"v_mad_i64_i32", VOP3b_I64_I1_I32_I32_I64>;
326 let SubtargetPredicate = isGFX11Only, OtherPredicates = [HasMADIntraFwdBug],
327 Constraints = "@earlyclobber $vdst" in {
328 defm V_MAD_U64_U32_gfx11 : VOP3Inst <"v_mad_u64_u32", VOP3b_I64_I1_I32_I32_I64>;
329 defm V_MAD_I64_I32_gfx11 : VOP3Inst <"v_mad_i64_i32", VOP3b_I64_I1_I32_I32_I64>;
331 } // End isCommutable = 1, SchedRW = [WriteIntMul, WriteSALU], IsInvalidSingleUseConsumer = 1
334 let FPDPRounding = 1 in {
335 let Predicates = [Has16BitInsts, isGFX8Only] in {
336 defm V_DIV_FIXUP_F16 : VOP3Inst <"v_div_fixup_f16", VOP3_Profile<VOP_F16_F16_F16_F16>, AMDGPUdiv_fixup>;
337 defm V_FMA_F16 : VOP3Inst <"v_fma_f16", VOP3_Profile<VOP_F16_F16_F16_F16>, any_fma>;
338 } // End Predicates = [Has16BitInsts, isGFX8Only]
340 let renamedInGFX9 = 1, SubtargetPredicate = isGFX9Plus in {
341 defm V_DIV_FIXUP_F16_gfx9 : VOP3Inst <"v_div_fixup_f16_gfx9",
342 VOP3_Profile<VOP_F16_F16_F16_F16, VOP3_OPSEL>, AMDGPUdiv_fixup>;
343 defm V_FMA_F16_gfx9 : VOP3Inst <"v_fma_f16_gfx9", VOP3_Profile<VOP_F16_F16_F16_F16, VOP3_OPSEL>, any_fma>;
344 } // End renamedInGFX9 = 1, SubtargetPredicate = isGFX9Plus
345 } // End FPDPRounding = 1
347 let SubtargetPredicate = Has16BitInsts, isCommutable = 1 in {
349 let renamedInGFX9 = 1 in {
350 defm V_MAD_U16 : VOP3Inst <"v_mad_u16", VOP3_Profile<VOP_I16_I16_I16_I16, VOP3_CLAMP>>;
351 defm V_MAD_I16 : VOP3Inst <"v_mad_i16", VOP3_Profile<VOP_I16_I16_I16_I16, VOP3_CLAMP>>;
352 let FPDPRounding = 1 in {
353 defm V_MAD_F16 : VOP3Inst <"v_mad_f16", VOP3_Profile<VOP_F16_F16_F16_F16>, any_fmad>;
354 let Uses = [MODE, M0, EXEC] in {
355 let OtherPredicates = [isNotGFX90APlus] in
356 // For some reason the intrinsic operands are in a different order
357 // from the instruction operands.
358 def V_INTERP_P2_F16 : VOP3Interp <"v_interp_p2_f16", VOP3_INTERP16<[f16, f32, i32, f32]>,
360 (int_amdgcn_interp_p2_f16 (VOP3Mods f32:$src2, i32:$src2_modifiers),
361 (VOP3Mods f32:$src0, i32:$src0_modifiers),
362 (i32 timm:$attrchan),
366 } // End Uses = [M0, MODE, EXEC]
367 } // End FPDPRounding = 1
368 } // End renamedInGFX9 = 1
370 let SubtargetPredicate = isGFX9Only, FPDPRounding = 1 in {
371 defm V_MAD_F16_gfx9 : VOP3Inst <"v_mad_f16_gfx9", VOP3_Profile<VOP_F16_F16_F16_F16, VOP3_OPSEL>> ;
372 } // End SubtargetPredicate = isGFX9Only, FPDPRounding = 1
374 let SubtargetPredicate = isGFX9Plus in {
375 defm V_MAD_U16_gfx9 : VOP3Inst <"v_mad_u16_gfx9", VOP3_Profile<VOP_I16_I16_I16_I16, VOP3_OPSEL>>;
376 defm V_MAD_I16_gfx9 : VOP3Inst <"v_mad_i16_gfx9", VOP3_Profile<VOP_I16_I16_I16_I16, VOP3_OPSEL>>;
377 let OtherPredicates = [isNotGFX90APlus] in
378 def V_INTERP_P2_F16_gfx9 : VOP3Interp <"v_interp_p2_f16_gfx9", VOP3_INTERP16<[f16, f32, i32, f32]>>;
379 } // End SubtargetPredicate = isGFX9Plus
381 // This predicate should only apply to the selection pattern. The
382 // instruction still exists and should decode on subtargets with
383 // other bank counts.
384 let OtherPredicates = [isNotGFX90APlus, has32BankLDS], Uses = [MODE, M0, EXEC], FPDPRounding = 1 in {
385 def V_INTERP_P1LL_F16 : VOP3Interp <"v_interp_p1ll_f16", VOP3_INTERP16<[f32, f32, i32, untyped]>,
386 [(set f32:$vdst, (int_amdgcn_interp_p1_f16 (VOP3Mods f32:$src0, i32:$src0_modifiers),
387 (i32 timm:$attrchan),
389 (i1 timm:$high), M0))]>;
390 } // End OtherPredicates = [isNotGFX90APlus, has32BankLDS], Uses = [MODE, M0, EXEC], FPDPRounding = 1
392 let OtherPredicates = [isNotGFX90APlus], Uses = [MODE, M0, EXEC], FPDPRounding = 1 in {
393 def V_INTERP_P1LV_F16 : VOP3Interp <"v_interp_p1lv_f16", VOP3_INTERP16<[f32, f32, i32, f16]>>;
394 } // End OtherPredicates = [isNotGFX90APlus], Uses = [MODE, M0, EXEC], FPDPRounding = 1
396 } // End SubtargetPredicate = Has16BitInsts, isCommutable = 1
399 (i64 (DivergentUnaryFrag<sext> i16:$src)),
400 (REG_SEQUENCE VReg_64,
401 (i32 (V_BFE_I32_e64 $src, (S_MOV_B32 (i32 0)), (S_MOV_B32 (i32 0x10)))), sub0,
402 (i32 (COPY_TO_REGCLASS
403 (V_ASHRREV_I32_e32 (S_MOV_B32 (i32 0x1f)), (i32 (V_BFE_I32_e64 $src, (S_MOV_B32 (i32 0)), (S_MOV_B32 (i32 0x10))))
407 let SubtargetPredicate = isGFX8Plus, Uses = [MODE, M0, EXEC], OtherPredicates = [isNotGFX90APlus] in {
408 def V_INTERP_P1_F32_e64 : VOP3Interp <"v_interp_p1_f32", VOP3_INTERP>;
409 def V_INTERP_P2_F32_e64 : VOP3Interp <"v_interp_p2_f32", VOP3_INTERP>;
410 def V_INTERP_MOV_F32_e64 : VOP3Interp <"v_interp_mov_f32", VOP3_INTERP_MOV>;
411 } // End SubtargetPredicate = isGFX8Plus, Uses = [MODE, M0, EXEC], OtherPredicates = [isNotGFX90APlus]
413 // Note: 16-bit instructions produce a 0 result in the high 16-bits
414 // on GFX8 and GFX9 and preserve high 16 bits on GFX10+
415 multiclass Arithmetic_i16_0Hi_TernaryPats <SDPatternOperator op, Instruction inst> {
417 (i32 (zext (op i16:$src0, i16:$src1, i16:$src2))),
418 (inst VSrc_b16:$src0, VSrc_b16:$src1, VSrc_b16:$src2)
422 let Predicates = [Has16BitInsts, isGFX8GFX9] in {
423 defm : Arithmetic_i16_0Hi_TernaryPats<imad, V_MAD_U16_e64>;
426 let Predicates = [Has16BitInsts, isGFX6GFX7GFX8GFX9] in {
428 // FIXME: Should be able to just pass imad to the instruction
429 // definition pattern, but the implied clamp input interferes.
430 multiclass Ternary_i16_Pats <SDPatternOperator op, Instruction inst> {
432 (op i16:$src0, i16:$src1, i16:$src2),
433 (inst i16:$src0, i16:$src1, i16:$src2, (i1 0))
437 defm: Ternary_i16_Pats<imad, V_MAD_U16_e64>;
439 } // End Predicates = [Has16BitInsts, isGFX6GFX7GFX8GFX9]
442 class Ternary_i16_Pats_gfx9<SDPatternOperator op1, SDPatternOperator op2,
443 Instruction inst> : GCNPat <
444 (op2 (op1 i16:$src0, i16:$src1), i16:$src2),
445 (inst SRCMODS.NONE, $src0, SRCMODS.NONE, $src1, SRCMODS.NONE, $src2, DSTCLAMP.NONE)
448 let Predicates = [Has16BitInsts, isGFX10Plus] in {
449 def: Ternary_i16_Pats_gfx9<mul, add, V_MAD_U16_gfx9_e64>;
450 } // End Predicates = [Has16BitInsts, isGFX10Plus]
452 class ThreeOpFragSDAG<SDPatternOperator op1, SDPatternOperator op2> : PatFrag<
453 (ops node:$x, node:$y, node:$z),
454 // When the inner operation is used multiple times, selecting 3-op
455 // instructions may still be beneficial -- if the other users can be
456 // combined similarly. Let's be conservative for now.
457 (op2 (HasOneUseBinOp<op1> node:$x, node:$y), node:$z),
459 // Only use VALU ops when the result is divergent.
460 if (!N->isDivergent())
463 // Check constant bus limitations.
465 // Note: Use !isDivergent as a conservative proxy for whether the value
466 // is in an SGPR (uniform values can end up in VGPRs as well).
467 unsigned ConstantBusUses = 0;
468 for (unsigned i = 0; i < 3; ++i) {
469 if (!Operands[i]->isDivergent() &&
470 !isInlineImmediate(Operands[i].getNode())) {
472 // This uses AMDGPU::V_ADD3_U32_e64, but all three operand instructions
473 // have the same constant bus limit.
474 if (ConstantBusUses > Subtarget->getConstantBusLimit(AMDGPU::V_ADD3_U32_e64))
481 let PredicateCodeUsesOperands = 1;
484 class ThreeOpFrag<SDPatternOperator op1, SDPatternOperator op2> : ThreeOpFragSDAG<op1, op2> {
485 // The divergence predicate is irrelevant in GlobalISel, as we have
486 // proper register bank checks. We just need to verify the constant
487 // bus restriction when all the sources are considered.
489 // FIXME: With unlucky SGPR operands, we could penalize code by
490 // blocking folding SGPR->VGPR copies later.
491 // FIXME: There's no register bank verifier
492 let GISelPredicateCode = [{
493 const int ConstantBusLimit = Subtarget->getConstantBusLimit(AMDGPU::V_ADD3_U32_e64);
494 int ConstantBusUses = 0;
495 for (unsigned i = 0; i < 3; ++i) {
496 const RegisterBank *RegBank = RBI.getRegBank(Operands[i]->getReg(), MRI, TRI);
497 if (RegBank->getID() == AMDGPU::SGPRRegBankID) {
498 if (++ConstantBusUses > ConstantBusLimit)
506 def shl_0_to_4 : PatFrag<
507 (ops node:$src0, node:$src1), (shl node:$src0, node:$src1),
509 if (auto *C = dyn_cast<ConstantSDNode>(N->getOperand(1))) {
510 return C->getZExtValue() <= 4;
514 let GISelPredicateCode = [{
516 if (!mi_match(MI.getOperand(2).getReg(), MRI, m_ICst(Imm)) &&
517 !mi_match(MI.getOperand(2).getReg(), MRI, m_Copy(m_ICst(Imm))))
519 return (uint64_t)Imm <= 4;
523 def VOP3_CVT_PK_F8_F32_Profile : VOP3_Profile<VOP_I32_F32_F32, VOP3_OPSEL> {
524 let InsVOP3OpSel = (ins FP32InputMods:$src0_modifiers, Src0RC64:$src0,
525 FP32InputMods:$src1_modifiers, Src1RC64:$src1,
526 VGPR_32:$vdst_in, op_sel0:$op_sel);
527 let InsVOP3DPP = (ins VGPR_32:$old,
528 FP32InputMods:$src0_modifiers, Src0VOP3DPP:$src0,
529 FP32InputMods:$src1_modifiers, Src1VOP3DPP:$src1,
530 VGPR_32:$vdst_in, op_sel0:$op_sel,
531 dpp_ctrl:$dpp_ctrl, DppRowMask:$row_mask,
532 DppBankMask:$bank_mask, DppBoundCtrl:$bound_ctrl);
534 let InsVOP3DPP16 = (ins VGPR_32:$old,
535 FP32InputMods:$src0_modifiers, Src0VOP3DPP:$src0,
536 FP32InputMods:$src1_modifiers, Src1VOP3DPP:$src1,
537 VGPR_32:$vdst_in, op_sel0:$op_sel,
538 dpp_ctrl:$dpp_ctrl, DppRowMask:$row_mask,
539 DppBankMask:$bank_mask, DppBoundCtrl:$bound_ctrl, Dpp16FI:$fi);
540 let InsVOP3DPP8 = (ins VGPR_32:$old,
541 FP32InputMods:$src0_modifiers, Src0VOP3DPP:$src0,
542 FP32InputMods:$src1_modifiers, Src1VOP3DPP:$src1,
543 VGPR_32:$vdst_in, op_sel0:$op_sel, dpp8:$dpp8, Dpp8FI:$fi);
546 let HasExtVOP3DPP = 1;
549 def VOP3_CVT_SR_F8_F32_Profile : VOP3_Profile<VOPProfile<[i32, f32, i32, f32]>,
551 let InsVOP3OpSel = (ins FP32InputMods:$src0_modifiers, Src0RC64:$src0,
552 FP32InputMods:$src1_modifiers, Src1RC64:$src1,
553 FP32InputMods:$src2_modifiers, VGPR_32:$src2,
555 let InsVOP3DPP16 = (ins VGPR_32:$old,
556 FP32InputMods:$src0_modifiers, Src0VOP3DPP:$src0,
557 FP32InputMods:$src1_modifiers, Src1VOP3DPP:$src1,
558 FP32InputMods:$src2_modifiers, VGPR_32:$src2,
559 op_sel0:$op_sel, dpp_ctrl:$dpp_ctrl, DppRowMask:$row_mask,
560 DppBankMask:$bank_mask, DppBoundCtrl:$bound_ctrl, Dpp16FI:$fi);
561 let InsVOP3DPP8 = (ins VGPR_32:$old,
562 FP32InputMods:$src0_modifiers, Src0VOP3DPP:$src0,
563 FP32InputMods:$src1_modifiers, Src1VOP3DPP:$src1,
564 FP32InputMods:$src2_modifiers, VGPR_32:$src2,
565 op_sel0:$op_sel, dpp8:$dpp8, Dpp8FI:$fi);
569 let HasExtVOP3DPP = 1;
571 let AsmVOP3OpSel = !subst(", $src2_modifiers", "",
572 getAsmVOP3OpSel<3, HasClamp, HasOMod,
573 HasSrc0FloatMods, HasSrc1FloatMods,
574 HasSrc2FloatMods>.ret);
575 let AsmVOP3DPP16 = !subst(", $src2_modifiers", "",
576 getAsmVOP3DPP16<getAsmVOP3Base<3, 1, HasClamp, 1,
577 HasOMod, 0, 1, HasSrc0FloatMods,
579 HasSrc2FloatMods>.ret>.ret);
580 let AsmVOP3DPP8 = !subst(", $src2_modifiers", "",
581 getAsmVOP3DPP8<getAsmVOP3Base<3, 1, HasClamp, 1,
582 HasOMod, 0, 1, HasSrc0FloatMods,
584 HasSrc2FloatMods>.ret>.ret);
587 class VOP3_CVT_SR_F8_ByteSel_Profile<ValueType SrcVT> :
588 VOP3_Profile<VOPProfile<[i32, SrcVT, i32, untyped]>> {
589 let IsFP8DstByteSel = 1;
591 defvar bytesel = (ins VGPR_32:$vdst_in, ByteSel:$byte_sel);
592 let Ins64 = !con(getIns64<Src0RC64, Src1RC64, Src2RC64, NumSrcArgs,
593 HasClamp, HasModifiers, HasSrc2Mods,
594 HasOMod, Src0Mod, Src1Mod, Src2Mod>.ret,
596 let InsVOP3Base = !con(
597 getInsVOP3Base<Src0VOP3DPP, Src1VOP3DPP,
598 Src2VOP3DPP, NumSrcArgs, HasClamp, HasModifiers, HasSrc2Mods, HasOMod,
599 Src0ModVOP3DPP, Src1ModVOP3DPP, Src2ModVOP3DPP, HasOpSel>.ret,
603 def IsPow2Plus1: PatLeaf<(i32 imm), [{
604 uint32_t V = N->getZExtValue();
605 return isPowerOf2_32(V - 1);
608 def Log2_32: SDNodeXForm<imm, [{
609 uint32_t V = N->getZExtValue();
610 return CurDAG->getTargetConstant(Log2_32(V - 1), SDLoc(N), MVT::i32);
613 let SubtargetPredicate = isGFX9Plus in {
614 let isCommutable = 1, isReMaterializable = 1 in {
615 defm V_ADD3_U32 : VOP3Inst <"v_add3_u32", VOP3_Profile<VOP_I32_I32_I32_I32>>;
616 defm V_AND_OR_B32 : VOP3Inst <"v_and_or_b32", VOP3_Profile<VOP_I32_I32_I32_I32>>;
617 defm V_OR3_B32 : VOP3Inst <"v_or3_b32", VOP3_Profile<VOP_I32_I32_I32_I32>>;
618 defm V_XAD_U32 : VOP3Inst <"v_xad_u32", VOP3_Profile<VOP_I32_I32_I32_I32>>;
619 defm V_ADD_I32 : VOP3Inst <"v_add_i32", VOP3_Profile<VOP_I32_I32_I32_ARITH>>;
620 defm V_ADD_LSHL_U32 : VOP3Inst <"v_add_lshl_u32", VOP3_Profile<VOP_I32_I32_I32_I32>>;
621 } // End isCommutable = 1, isReMaterializable = 1
622 // TODO src0 contains the opsel bit for dst, so if we commute, need to mask and swap this
624 defm V_MED3_F16 : VOP3Inst <"v_med3_f16", VOP3_Profile<VOP_F16_F16_F16_F16, VOP3_OPSEL>, AMDGPUfmed3>;
625 defm V_MED3_I16 : VOP3Inst <"v_med3_i16", VOP3_Profile<VOP_I16_I16_I16_I16, VOP3_OPSEL>, AMDGPUsmed3>;
626 defm V_MED3_U16 : VOP3Inst <"v_med3_u16", VOP3_Profile<VOP_I16_I16_I16_I16, VOP3_OPSEL>, AMDGPUumed3>;
628 defm V_MIN3_F16 : VOP3Inst <"v_min3_f16", VOP3_Profile<VOP_F16_F16_F16_F16, VOP3_OPSEL>, AMDGPUfmin3>;
629 defm V_MIN3_I16 : VOP3Inst <"v_min3_i16", VOP3_Profile<VOP_I16_I16_I16_I16, VOP3_OPSEL>, AMDGPUsmin3>;
630 defm V_MIN3_U16 : VOP3Inst <"v_min3_u16", VOP3_Profile<VOP_I16_I16_I16_I16, VOP3_OPSEL>, AMDGPUumin3>;
632 defm V_MAX3_F16 : VOP3Inst <"v_max3_f16", VOP3_Profile<VOP_F16_F16_F16_F16, VOP3_OPSEL>, AMDGPUfmax3>;
633 defm V_MAX3_I16 : VOP3Inst <"v_max3_i16", VOP3_Profile<VOP_I16_I16_I16_I16, VOP3_OPSEL>, AMDGPUsmax3>;
634 defm V_MAX3_U16 : VOP3Inst <"v_max3_u16", VOP3_Profile<VOP_I16_I16_I16_I16, VOP3_OPSEL>, AMDGPUumax3>;
636 let SubtargetPredicate = isGFX12Plus, ReadsModeReg = 0 in {
637 defm V_MINIMUM3_F16 : VOP3Inst <"v_minimum3_f16", VOP3_Profile<VOP_F16_F16_F16_F16, VOP3_OPSEL>, AMDGPUfminimum3>;
638 defm V_MAXIMUM3_F16 : VOP3Inst <"v_maximum3_f16", VOP3_Profile<VOP_F16_F16_F16_F16, VOP3_OPSEL>, AMDGPUfmaximum3>;
639 } // End SubtargetPredicate = isGFX12Plus, ReadsModeReg = 0
641 defm V_ADD_I16 : VOP3Inst <"v_add_i16", VOP3_Profile<VOP_I16_I16_I16, VOP3_OPSEL>>;
642 defm V_SUB_I16 : VOP3Inst <"v_sub_i16", VOP3_Profile<VOP_I16_I16_I16, VOP3_OPSEL>>;
644 defm V_MAD_U32_U16 : VOP3Inst <"v_mad_u32_u16", VOP3_Profile<VOP_I32_I16_I16_I32, VOP3_OPSEL>>;
645 defm V_MAD_I32_I16 : VOP3Inst <"v_mad_i32_i16", VOP3_Profile<VOP_I32_I16_I16_I32, VOP3_OPSEL>>;
647 defm V_CVT_PKNORM_I16_F16 : VOP3Inst <"v_cvt_pknorm_i16_f16", VOP3_Profile<VOP_B32_F16_F16, VOP3_OPSEL>>;
648 defm V_CVT_PKNORM_U16_F16 : VOP3Inst <"v_cvt_pknorm_u16_f16", VOP3_Profile<VOP_B32_F16_F16, VOP3_OPSEL>>;
650 defm V_PACK_B32_F16 : VOP3Inst <"v_pack_b32_f16", VOP3_Profile<VOP_B32_F16_F16, VOP3_OPSEL>>;
652 let isReMaterializable = 1 in {
653 defm V_SUB_I32 : VOP3Inst <"v_sub_i32", VOP3_Profile<VOP_I32_I32_I32_ARITH>>;
654 defm V_LSHL_ADD_U32 : VOP3Inst <"v_lshl_add_u32", VOP3_Profile<VOP_I32_I32_I32_I32>>;
655 defm V_LSHL_OR_B32 : VOP3Inst <"v_lshl_or_b32", VOP3_Profile<VOP_I32_I32_I32_I32>>;
656 } // End isReMaterializable = 1
658 // V_LSHL_ADD_U64: D0.u64 = (S0.u64 << S1.u[2:0]) + S2.u64
659 // src0 is shifted left by 0-4 (use “0” to get ADD_U64).
660 let SubtargetPredicate = isGFX940Plus in
661 defm V_LSHL_ADD_U64 : VOP3Inst <"v_lshl_add_u64", VOP3_Profile<VOP_I64_I64_I32_I64>>;
663 let OtherPredicates = [HasFP8ConversionInsts], mayRaiseFPException = 0,
664 SchedRW = [WriteFloatCvt] in {
665 let Constraints = "$vdst = $vdst_in", DisableEncoding = "$vdst_in" in {
666 defm V_CVT_PK_FP8_F32 : VOP3Inst<"v_cvt_pk_fp8_f32", VOP3_CVT_PK_F8_F32_Profile>;
667 defm V_CVT_PK_BF8_F32 : VOP3Inst<"v_cvt_pk_bf8_f32", VOP3_CVT_PK_F8_F32_Profile>;
669 let SubtargetPredicate = isGFX12Plus in {
670 defm V_CVT_SR_FP8_F32_gfx12 : VOP3Inst<"v_cvt_sr_fp8_f32_gfx12", VOP3_CVT_SR_F8_ByteSel_Profile<f32>>;
671 defm V_CVT_SR_BF8_F32_gfx12 : VOP3Inst<"v_cvt_sr_bf8_f32_gfx12", VOP3_CVT_SR_F8_ByteSel_Profile<f32>>;
675 // These instructions have non-standard use of op_sel. In particular they are
676 // using op_sel bits 2 and 3 while only having two sources. Therefore dummy
677 // src2 is used to hold the op_sel value.
678 let Constraints = "$vdst = $src2", DisableEncoding = "$src2", SubtargetPredicate = isGFX940Plus in {
679 defm V_CVT_SR_FP8_F32 : VOP3Inst<"v_cvt_sr_fp8_f32", VOP3_CVT_SR_F8_F32_Profile>;
680 defm V_CVT_SR_BF8_F32 : VOP3Inst<"v_cvt_sr_bf8_f32", VOP3_CVT_SR_F8_F32_Profile>;
684 class Cvt_PK_F8_F32_Pat<SDPatternOperator node, int index, VOP3_Pseudo inst> : GCNPat<
685 (i32 (node f32:$src0, f32:$src1, i32:$old, index)),
686 (inst !if(index, SRCMODS.DST_OP_SEL, 0), $src0, 0, $src1, $old, 0)
689 class Cvt_SR_F8_F32_Pat<SDPatternOperator node, bits<2> index, VOP3_Pseudo inst> : GCNPat<
690 (i32 (node f32:$src0, i32:$src1, i32:$old, index)),
691 (inst !if(index{1}, SRCMODS.DST_OP_SEL, 0), $src0, 0, $src1,
692 !if(index{0}, SRCMODS.OP_SEL_0, 0), $old, 0)
695 class Cvt_SR_F8_ByteSel_Pat<SDPatternOperator node, VOP3_Pseudo inst, ValueType SrcVT> : GCNPat<
696 (i32 (node (VOP3Mods SrcVT:$src0, i32:$src0_modifiers), (VOP3Mods i32:$src1, i32:$src1_modifiers),
697 i32:$old, timm:$byte_sel)),
698 (inst $src0_modifiers, $src0, $src1_modifiers, $src1, $old, (as_i32timm $byte_sel))
701 let OtherPredicates = [HasFP8ConversionInsts] in {
702 foreach Index = [0, -1] in {
703 def : Cvt_PK_F8_F32_Pat<int_amdgcn_cvt_pk_fp8_f32, Index, V_CVT_PK_FP8_F32_e64>;
704 def : Cvt_PK_F8_F32_Pat<int_amdgcn_cvt_pk_bf8_f32, Index, V_CVT_PK_BF8_F32_e64>;
707 let SubtargetPredicate = isGFX940Plus in {
708 foreach Index = [0, 1, 2, 3] in {
709 def : Cvt_SR_F8_F32_Pat<int_amdgcn_cvt_sr_fp8_f32, Index, V_CVT_SR_FP8_F32_e64>;
710 def : Cvt_SR_F8_F32_Pat<int_amdgcn_cvt_sr_bf8_f32, Index, V_CVT_SR_BF8_F32_e64>;
714 let SubtargetPredicate = isGFX12Plus in {
715 def : Cvt_SR_F8_ByteSel_Pat<int_amdgcn_cvt_sr_fp8_f32, V_CVT_SR_FP8_F32_gfx12_e64, f32>;
716 def : Cvt_SR_F8_ByteSel_Pat<int_amdgcn_cvt_sr_bf8_f32, V_CVT_SR_BF8_F32_gfx12_e64, f32>;
720 class ThreeOp_i32_Pats <SDPatternOperator op1, SDPatternOperator op2, Instruction inst> : GCNPat <
721 // This matches (op2 (op1 i32:$src0, i32:$src1), i32:$src2) with conditions.
722 (ThreeOpFrag<op1, op2> i32:$src0, i32:$src1, i32:$src2),
723 (inst VSrc_b32:$src0, VSrc_b32:$src1, VSrc_b32:$src2)
726 def : ThreeOp_i32_Pats<cshl_32, add, V_LSHL_ADD_U32_e64>;
727 def : ThreeOp_i32_Pats<add, cshl_32, V_ADD_LSHL_U32_e64>;
728 def : ThreeOp_i32_Pats<add, add, V_ADD3_U32_e64>;
729 def : ThreeOp_i32_Pats<ptradd, ptradd, V_ADD3_U32_e64>;
730 def : ThreeOp_i32_Pats<cshl_32, or, V_LSHL_OR_B32_e64>;
731 def : ThreeOp_i32_Pats<and, or, V_AND_OR_B32_e64>;
732 def : ThreeOp_i32_Pats<or, or, V_OR3_B32_e64>;
733 def : ThreeOp_i32_Pats<xor, add, V_XAD_U32_e64>;
736 (DivergentBinFrag<mul> i32:$src0, IsPow2Plus1:$src1),
737 (V_LSHL_ADD_U32_e64 i32:$src0, (i32 (Log2_32 imm:$src1)), i32:$src0)>;
739 let SubtargetPredicate = isGFX940Plus in
741 (ThreeOpFrag<shl_0_to_4, add> i64:$src0, i32:$src1, i64:$src2),
742 (V_LSHL_ADD_U64_e64 VSrc_b64:$src0, VSrc_b32:$src1, VSrc_b64:$src2)
745 def : VOPBinOpClampPat<saddsat, V_ADD_I32_e64, i32>;
746 def : VOPBinOpClampPat<ssubsat, V_SUB_I32_e64, i32>;
748 def : GCNPat<(DivergentBinFrag<or> (or_oneuse i64:$src0, i64:$src1), i64:$src2),
749 (REG_SEQUENCE VReg_64,
750 (V_OR3_B32_e64 (i32 (EXTRACT_SUBREG $src0, sub0)),
751 (i32 (EXTRACT_SUBREG $src1, sub0)),
752 (i32 (EXTRACT_SUBREG $src2, sub0))), sub0,
753 (V_OR3_B32_e64 (i32 (EXTRACT_SUBREG $src0, sub1)),
754 (i32 (EXTRACT_SUBREG $src1, sub1)),
755 (i32 (EXTRACT_SUBREG $src2, sub1))), sub1)>;
757 // FIXME: Probably should hardcode clamp bit in pseudo and avoid this.
758 class OpSelBinOpClampPat<SDPatternOperator node,
759 Instruction inst> : GCNPat<
760 (node (i16 (VOP3OpSel i16:$src0, i32:$src0_modifiers)),
761 (i16 (VOP3OpSel i16:$src1, i32:$src1_modifiers))),
762 (inst $src0_modifiers, $src0, $src1_modifiers, $src1, DSTCLAMP.ENABLE, 0)
765 def : OpSelBinOpClampPat<saddsat, V_ADD_I16_e64>;
766 def : OpSelBinOpClampPat<ssubsat, V_SUB_I16_e64>;
767 } // End SubtargetPredicate = isGFX9Plus
769 multiclass IMAD32_Pats <VOP3_Pseudo inst> {
771 (ThreeOpFrag<mul, add> i32:$src0, i32:$src1, i32:$src2),
772 (EXTRACT_SUBREG (inst i32:$src0, i32:$src1,
773 (REG_SEQUENCE SReg_64, // Use scalar and let it be legalized
775 (i32 (IMPLICIT_DEF)), sub1),
780 // GISel-specific pattern that avoids creating a SGPR->VGPR copy if
783 (ThreeOpFrag<mul, add> i32:$src0, i32:$src1, VGPR_32:$src2),
784 (EXTRACT_SUBREG (inst i32:$src0, i32:$src1,
785 (REG_SEQUENCE VReg_64,
787 (i32 (IMPLICIT_DEF)), sub1),
792 // Immediate src2 in the pattern above will not fold because it would be partially
793 // undef. Hence define specialized pattern for this case.
795 (ThreeOpFrag<mul, add> i32:$src0, i32:$src1, (i32 imm:$src2)),
796 (EXTRACT_SUBREG (inst i32:$src0, i32:$src1, (i64 (as_i64imm $src2)), 0 /* clamp */), sub0)
800 // Handle cases where amdgpu-codegenprepare-mul24 made a mul24 instead of a normal mul.
801 // We need to separate this because otherwise OtherPredicates would be overriden.
802 class IMAD32_Mul24_Pat<VOP3_Pseudo inst>: GCNPat <
803 (i64 (add (i64 (AMDGPUmul_u24 i32:$src0, i32:$src1)), i64:$src2)),
804 (inst $src0, $src1, $src2, 0 /* clamp */)
807 // exclude pre-GFX9 where it was slow
808 let OtherPredicates = [HasNotMADIntraFwdBug], SubtargetPredicate = isGFX9Plus in {
809 defm : IMAD32_Pats<V_MAD_U64_U32_e64>;
810 def : IMAD32_Mul24_Pat<V_MAD_U64_U32_e64>;
812 let OtherPredicates = [HasMADIntraFwdBug], SubtargetPredicate = isGFX11Only in {
813 defm : IMAD32_Pats<V_MAD_U64_U32_gfx11_e64>;
814 def : IMAD32_Mul24_Pat<V_MAD_U64_U32_gfx11_e64>;
817 def VOP3_PERMLANE_Profile : VOP3_Profile<VOPProfile <[i32, i32, i32, i32]>, VOP3_OPSEL> {
818 let InsVOP3OpSel = (ins IntOpSelMods:$src0_modifiers, VRegSrc_32:$src0,
819 IntOpSelMods:$src1_modifiers, SSrc_b32:$src1,
820 IntOpSelMods:$src2_modifiers, SSrc_b32:$src2,
821 VGPR_32:$vdst_in, op_sel0:$op_sel);
823 let HasExtVOP3DPP = 0;
827 def VOP3_PERMLANE_VAR_Profile : VOP3_Profile<VOPProfile <[i32, i32, i32, untyped]>, VOP3_OPSEL> {
828 let InsVOP3OpSel = (ins IntOpSelMods:$src0_modifiers, VRegSrc_32:$src0,
829 IntOpSelMods:$src1_modifiers, VRegSrc_32:$src1,
830 VGPR_32:$vdst_in, op_sel0:$op_sel);
832 let HasExtVOP3DPP = 0;
836 def opsel_i1timm : SDNodeXForm<timm, [{
837 return CurDAG->getTargetConstant(
838 N->getZExtValue() ? SISrcMods::OP_SEL_0 : SISrcMods::NONE,
841 def gi_opsel_i1timm : GICustomOperandRenderer<"renderOpSelTImm">,
842 GISDNodeXFormEquiv<opsel_i1timm>;
844 class PermlanePat<SDPatternOperator permlane,
845 Instruction inst, ValueType vt> : GCNPat<
846 (vt (permlane vt:$vdst_in, vt:$src0, i32:$src1, i32:$src2,
847 timm:$fi, timm:$bc)),
848 (inst (opsel_i1timm $fi), VGPR_32:$src0, (opsel_i1timm $bc),
849 SCSrc_b32:$src1, 0, SCSrc_b32:$src2, VGPR_32:$vdst_in)
852 class PermlaneVarPat<SDPatternOperator permlane,
853 Instruction inst> : GCNPat<
854 (permlane i32:$vdst_in, i32:$src0, i32:$src1,
856 (inst (opsel_i1timm $fi), VGPR_32:$src0, (opsel_i1timm $bc),
857 VGPR_32:$src1, VGPR_32:$vdst_in)
860 let SubtargetPredicate = isGFX10Plus in {
861 let isCommutable = 1, isReMaterializable = 1 in {
862 defm V_XOR3_B32 : VOP3Inst <"v_xor3_b32", VOP3_Profile<VOP_I32_I32_I32_I32>>;
863 } // End isCommutable = 1, isReMaterializable = 1
864 def : ThreeOp_i32_Pats<xor, xor, V_XOR3_B32_e64>;
866 let Constraints = "$vdst = $vdst_in", DisableEncoding="$vdst_in", IsInvalidSingleUseConsumer = 1, IsInvalidSingleUseProducer = 1 in {
867 defm V_PERMLANE16_B32 : VOP3Inst<"v_permlane16_b32", VOP3_PERMLANE_Profile>;
868 defm V_PERMLANEX16_B32 : VOP3Inst<"v_permlanex16_b32", VOP3_PERMLANE_Profile>;
869 } // End $vdst = $vdst_in, DisableEncoding $vdst_in, IsInvalidSingleUseConsumer = 1, IsInvalidSingleUseProducer = 1
871 foreach vt = Reg32Types.types in {
872 def : PermlanePat<int_amdgcn_permlane16, V_PERMLANE16_B32_e64, vt>;
873 def : PermlanePat<int_amdgcn_permlanex16, V_PERMLANEX16_B32_e64, vt>;
876 defm V_ADD_NC_U16 : VOP3Inst <"v_add_nc_u16", VOP3_Profile<VOP_I16_I16_I16, VOP3_OPSEL>, add>;
877 defm V_SUB_NC_U16 : VOP3Inst <"v_sub_nc_u16", VOP3_Profile<VOP_I16_I16_I16, VOP3_OPSEL>, sub>;
879 def : OpSelBinOpClampPat<uaddsat, V_ADD_NC_U16_e64>;
880 def : OpSelBinOpClampPat<usubsat, V_SUB_NC_U16_e64>;
882 // Undo sub x, c -> add x, -c canonicalization since c is more likely
883 // an inline immediate than -c.
885 (add i16:$src0, (i16 NegSubInlineIntConst16:$src1)),
886 (V_SUB_NC_U16_e64 0, VSrc_b16:$src0, 0, NegSubInlineIntConst16:$src1, 0, 0)
889 } // End SubtargetPredicate = isGFX10Plus
891 let SubtargetPredicate = isGFX12Plus in {
892 let Constraints = "$vdst = $vdst_in", DisableEncoding="$vdst_in" in {
893 defm V_PERMLANE16_VAR_B32 : VOP3Inst<"v_permlane16_var_b32", VOP3_PERMLANE_VAR_Profile>;
894 defm V_PERMLANEX16_VAR_B32 : VOP3Inst<"v_permlanex16_var_b32", VOP3_PERMLANE_VAR_Profile>;
895 } // End $vdst = $vdst_in, DisableEncoding $vdst_in
897 def : PermlaneVarPat<int_amdgcn_permlane16_var, V_PERMLANE16_VAR_B32_e64>;
898 def : PermlaneVarPat<int_amdgcn_permlanex16_var, V_PERMLANEX16_VAR_B32_e64>;
900 } // End SubtargetPredicate = isGFX12Plus
902 class DivFmasPat<ValueType vt, Instruction inst, Register CondReg> : GCNPat<
903 (AMDGPUdiv_fmas (vt (VOP3Mods vt:$src0, i32:$src0_modifiers)),
904 (vt (VOP3Mods vt:$src1, i32:$src1_modifiers)),
905 (vt (VOP3Mods vt:$src2, i32:$src2_modifiers)),
907 (inst $src0_modifiers, $src0, $src1_modifiers, $src1, $src2_modifiers, $src2)
910 let WaveSizePredicate = isWave64 in {
911 def : DivFmasPat<f32, V_DIV_FMAS_F32_e64, VCC>;
912 def : DivFmasPat<f64, V_DIV_FMAS_F64_e64, VCC>;
915 let WaveSizePredicate = isWave32 in {
916 def : DivFmasPat<f32, V_DIV_FMAS_F32_e64, VCC_LO>;
917 def : DivFmasPat<f64, V_DIV_FMAS_F64_e64, VCC_LO>;
920 class VOP3_DOT_Profile<VOPProfile P> : VOP3_Profile<P, VOP3_OPSEL> {
925 let SubtargetPredicate = isGFX11Plus in {
926 defm V_MAXMIN_F32 : VOP3Inst<"v_maxmin_f32", VOP3_Profile<VOP_F32_F32_F32_F32>>;
927 defm V_MINMAX_F32 : VOP3Inst<"v_minmax_f32", VOP3_Profile<VOP_F32_F32_F32_F32>>;
928 defm V_MAXMIN_F16 : VOP3Inst<"v_maxmin_f16", VOP3_Profile<VOP_F16_F16_F16_F16>>;
929 defm V_MINMAX_F16 : VOP3Inst<"v_minmax_f16", VOP3_Profile<VOP_F16_F16_F16_F16>>;
930 defm V_MAXMIN_U32 : VOP3Inst<"v_maxmin_u32", VOP3_Profile<VOP_I32_I32_I32_I32>>;
931 defm V_MINMAX_U32 : VOP3Inst<"v_minmax_u32", VOP3_Profile<VOP_I32_I32_I32_I32>>;
932 defm V_MAXMIN_I32 : VOP3Inst<"v_maxmin_i32", VOP3_Profile<VOP_I32_I32_I32_I32>>;
933 defm V_MINMAX_I32 : VOP3Inst<"v_minmax_i32", VOP3_Profile<VOP_I32_I32_I32_I32>>;
934 defm V_CVT_PK_I16_F32 : VOP3Inst<"v_cvt_pk_i16_f32", VOP3_Profile<VOP_V2I16_F32_F32>>;
935 defm V_CVT_PK_U16_F32 : VOP3Inst<"v_cvt_pk_u16_f32", VOP3_Profile<VOP_V2I16_F32_F32>>;
936 } // End SubtargetPredicate = isGFX11Plus
938 let SubtargetPredicate = isGFX12Plus, ReadsModeReg = 0 in {
939 defm V_MAXIMUMMINIMUM_F32 : VOP3Inst<"v_maximumminimum_f32", VOP3_Profile<VOP_F32_F32_F32_F32>>;
940 defm V_MINIMUMMAXIMUM_F32 : VOP3Inst<"v_minimummaximum_f32", VOP3_Profile<VOP_F32_F32_F32_F32>>;
941 defm V_MAXIMUMMINIMUM_F16 : VOP3Inst<"v_maximumminimum_f16", VOP3_Profile<VOP_F16_F16_F16_F16, VOP3_OPSEL>>;
942 defm V_MINIMUMMAXIMUM_F16 : VOP3Inst<"v_minimummaximum_f16", VOP3_Profile<VOP_F16_F16_F16_F16, VOP3_OPSEL>>;
943 } // End SubtargetPredicate = isGFX12Plus, ReadsModeReg = 0
945 let OtherPredicates = [HasDot9Insts], IsDOT=1 in {
946 defm V_DOT2_F16_F16 : VOP3Inst<"v_dot2_f16_f16", VOP3_DOT_Profile<VOP_F16_V2F16_V2F16_F16>, int_amdgcn_fdot2_f16_f16>;
947 defm V_DOT2_BF16_BF16 : VOP3Inst<"v_dot2_bf16_bf16", VOP3_DOT_Profile<VOP_BF16_V2BF16_V2BF16_BF16>, int_amdgcn_fdot2_bf16_bf16>;
950 class VOP_Pseudo_Scalar<RegisterClass Dst, RegisterOperand SrcOp,
951 ValueType dstVt, ValueType srcVt = dstVt>
952 : VOPProfile<[dstVt, srcVt, untyped, untyped]> {
953 let DstRC = VOPDstOperand<Dst>;
954 let Src0RC64 = SrcOp;
957 let HasModifiers = 1;
960 def VOP_Pseudo_Scalar_F32 : VOP_Pseudo_Scalar<SReg_32_XEXEC, SSrc_f32, f32>;
961 def VOP_Pseudo_Scalar_F16 : VOP_Pseudo_Scalar<SReg_32_XEXEC, SSrc_f16, f32, f16>;
963 let SubtargetPredicate = HasPseudoScalarTrans, TRANS = 1,
964 isReMaterializable = 1, SchedRW = [WritePseudoScalarTrans] in {
965 defm V_S_EXP_F32 : VOP3PseudoScalarInst<"v_s_exp_f32", VOP_Pseudo_Scalar_F32, AMDGPUexp>;
966 defm V_S_EXP_F16 : VOP3PseudoScalarInst<"v_s_exp_f16", VOP_Pseudo_Scalar_F16>;
967 defm V_S_LOG_F32 : VOP3PseudoScalarInst<"v_s_log_f32", VOP_Pseudo_Scalar_F32, AMDGPUlog>;
968 defm V_S_LOG_F16 : VOP3PseudoScalarInst<"v_s_log_f16", VOP_Pseudo_Scalar_F16>;
969 defm V_S_RCP_F32 : VOP3PseudoScalarInst<"v_s_rcp_f32", VOP_Pseudo_Scalar_F32, AMDGPUrcp>;
970 defm V_S_RCP_F16 : VOP3PseudoScalarInst<"v_s_rcp_f16", VOP_Pseudo_Scalar_F16>;
971 defm V_S_RSQ_F32 : VOP3PseudoScalarInst<"v_s_rsq_f32", VOP_Pseudo_Scalar_F32, AMDGPUrsq>;
972 defm V_S_RSQ_F16 : VOP3PseudoScalarInst<"v_s_rsq_f16", VOP_Pseudo_Scalar_F16>;
973 defm V_S_SQRT_F32 : VOP3PseudoScalarInst<"v_s_sqrt_f32", VOP_Pseudo_Scalar_F32, any_amdgcn_sqrt>;
974 defm V_S_SQRT_F16 : VOP3PseudoScalarInst<"v_s_sqrt_f16", VOP_Pseudo_Scalar_F16>;
977 class PseudoScalarPatF16<SDPatternOperator node, VOP3_Pseudo inst> : GCNPat <
978 (f16 (UniformUnaryFrag<node> (f16 (VOP3Mods0 f16:$src0, i32:$src0_modifiers,
979 i1:$clamp, i32:$omod)))),
980 (f16 (COPY_TO_REGCLASS (f32 (inst i32:$src0_modifiers, f16:$src0, i1:$clamp,
985 let SubtargetPredicate = HasPseudoScalarTrans in {
986 def : PseudoScalarPatF16<AMDGPUexpf16, V_S_EXP_F16_e64>;
987 def : PseudoScalarPatF16<AMDGPUlogf16, V_S_LOG_F16_e64>;
988 def : PseudoScalarPatF16<AMDGPUrcp, V_S_RCP_F16_e64>;
989 def : PseudoScalarPatF16<AMDGPUrsq, V_S_RSQ_F16_e64>;
990 def : PseudoScalarPatF16<any_amdgcn_sqrt, V_S_SQRT_F16_e64>;
993 //===----------------------------------------------------------------------===//
994 // Integer Clamp Patterns
995 //===----------------------------------------------------------------------===//
997 class getClampPat<VOPProfile P, SDPatternOperator node> {
998 dag ret3 = (P.DstVT (node P.Src0VT:$src0, P.Src1VT:$src1, P.Src2VT:$src2));
999 dag ret2 = (P.DstVT (node P.Src0VT:$src0, P.Src1VT:$src1));
1000 dag ret1 = (P.DstVT (node P.Src0VT:$src0));
1001 dag ret = !if(!eq(P.NumSrcArgs, 3), ret3,
1002 !if(!eq(P.NumSrcArgs, 2), ret2,
1006 class getClampRes<VOPProfile P, Instruction inst> {
1007 dag ret3 = (inst P.Src0VT:$src0, P.Src1VT:$src1, P.Src2VT:$src2, (i1 0));
1008 dag ret2 = (inst P.Src0VT:$src0, P.Src1VT:$src1, (i1 0));
1009 dag ret1 = (inst P.Src0VT:$src0, (i1 0));
1010 dag ret = !if(!eq(P.NumSrcArgs, 3), ret3,
1011 !if(!eq(P.NumSrcArgs, 2), ret2,
1015 class IntClampPat<VOP3InstBase inst, SDPatternOperator node> : GCNPat<
1016 getClampPat<inst.Pfl, node>.ret,
1017 getClampRes<inst.Pfl, inst>.ret
1020 def : IntClampPat<V_MAD_I32_I24_e64, AMDGPUmad_i24>;
1021 def : IntClampPat<V_MAD_U32_U24_e64, AMDGPUmad_u24>;
1023 def : IntClampPat<V_SAD_U8_e64, int_amdgcn_sad_u8>;
1024 def : IntClampPat<V_SAD_HI_U8_e64, int_amdgcn_sad_hi_u8>;
1025 def : IntClampPat<V_SAD_U16_e64, int_amdgcn_sad_u16>;
1027 def : IntClampPat<V_MSAD_U8_e64, int_amdgcn_msad_u8>;
1028 def : IntClampPat<V_MQSAD_PK_U16_U8_e64, int_amdgcn_mqsad_pk_u16_u8>;
1030 def : IntClampPat<V_QSAD_PK_U16_U8_e64, int_amdgcn_qsad_pk_u16_u8>;
1031 def : IntClampPat<V_MQSAD_U32_U8_e64, int_amdgcn_mqsad_u32_u8>;
1033 //===----------------------------------------------------------------------===//
1034 // Target-specific instruction encodings.
1035 //===----------------------------------------------------------------------===//
1037 //===----------------------------------------------------------------------===//
1039 //===----------------------------------------------------------------------===//
1041 defm V_MIN3_NUM_F32 : VOP3_Realtriple_with_name_gfx12<0x229, "V_MIN3_F32", "v_min3_num_f32">;
1042 defm V_MAX3_NUM_F32 : VOP3_Realtriple_with_name_gfx12<0x22a, "V_MAX3_F32", "v_max3_num_f32">;
1043 defm V_MIN3_NUM_F16 : VOP3_Realtriple_with_name_gfx12<0x22b, "V_MIN3_F16", "v_min3_num_f16">;
1044 defm V_MAX3_NUM_F16 : VOP3_Realtriple_with_name_gfx12<0x22c, "V_MAX3_F16", "v_max3_num_f16">;
1045 defm V_MINIMUM3_F32 : VOP3Only_Realtriple_gfx12<0x22d>;
1046 defm V_MAXIMUM3_F32 : VOP3Only_Realtriple_gfx12<0x22e>;
1047 defm V_MINIMUM3_F16 : VOP3Only_Realtriple_t16_gfx12<0x22f>;
1048 defm V_MAXIMUM3_F16 : VOP3Only_Realtriple_t16_gfx12<0x230>;
1049 defm V_MED3_NUM_F32 : VOP3_Realtriple_with_name_gfx12<0x231, "V_MED3_F32", "v_med3_num_f32">;
1050 defm V_MED3_NUM_F16 : VOP3_Realtriple_with_name_gfx12<0x232, "V_MED3_F16", "v_med3_num_f16">;
1051 defm V_MINMAX_NUM_F32 : VOP3_Realtriple_with_name_gfx12<0x268, "V_MINMAX_F32", "v_minmax_num_f32">;
1052 defm V_MAXMIN_NUM_F32 : VOP3_Realtriple_with_name_gfx12<0x269, "V_MAXMIN_F32", "v_maxmin_num_f32">;
1053 defm V_MINMAX_NUM_F16 : VOP3_Realtriple_with_name_gfx12<0x26a, "V_MINMAX_F16", "v_minmax_num_f16">;
1054 defm V_MAXMIN_NUM_F16 : VOP3_Realtriple_with_name_gfx12<0x26b, "V_MAXMIN_F16", "v_maxmin_num_f16">;
1055 defm V_MINIMUMMAXIMUM_F32 : VOP3Only_Realtriple_gfx12<0x26c>;
1056 defm V_MAXIMUMMINIMUM_F32 : VOP3Only_Realtriple_gfx12<0x26d>;
1057 defm V_MINIMUMMAXIMUM_F16 : VOP3Only_Realtriple_t16_gfx12<0x26e>;
1058 defm V_MAXIMUMMINIMUM_F16 : VOP3Only_Realtriple_t16_gfx12<0x26f>;
1059 defm V_S_EXP_F32 : VOP3Only_Real_Base_gfx12<0x280>;
1060 defm V_S_EXP_F16 : VOP3Only_Real_Base_gfx12<0x281>;
1061 defm V_S_LOG_F32 : VOP3Only_Real_Base_gfx12<0x282>;
1062 defm V_S_LOG_F16 : VOP3Only_Real_Base_gfx12<0x283>;
1063 defm V_S_RCP_F32 : VOP3Only_Real_Base_gfx12<0x284>;
1064 defm V_S_RCP_F16 : VOP3Only_Real_Base_gfx12<0x285>;
1065 defm V_S_RSQ_F32 : VOP3Only_Real_Base_gfx12<0x286>;
1066 defm V_S_RSQ_F16 : VOP3Only_Real_Base_gfx12<0x287>;
1067 defm V_S_SQRT_F32 : VOP3Only_Real_Base_gfx12<0x288>;
1068 defm V_S_SQRT_F16 : VOP3Only_Real_Base_gfx12<0x289>;
1069 defm V_MAD_CO_U64_U32 : VOP3be_Real_with_name_gfx12<0x2fe, "V_MAD_U64_U32", "v_mad_co_u64_u32">;
1070 defm V_MAD_CO_I64_I32 : VOP3be_Real_with_name_gfx12<0x2ff, "V_MAD_I64_I32", "v_mad_co_i64_i32">;
1071 defm V_MINIMUM_F64 : VOP3Only_Real_Base_gfx12<0x341>;
1072 defm V_MAXIMUM_F64 : VOP3Only_Real_Base_gfx12<0x342>;
1073 defm V_MINIMUM_F32 : VOP3Only_Realtriple_gfx12<0x365>;
1074 defm V_MAXIMUM_F32 : VOP3Only_Realtriple_gfx12<0x366>;
1075 defm V_MINIMUM_F16 : VOP3Only_Realtriple_t16_gfx12<0x367>;
1076 defm V_MAXIMUM_F16 : VOP3Only_Realtriple_t16_gfx12<0x368>;
1078 defm V_PERMLANE16_VAR_B32 : VOP3Only_Real_Base_gfx12<0x30f>;
1079 defm V_PERMLANEX16_VAR_B32 : VOP3Only_Real_Base_gfx12<0x310>;
1081 defm V_CVT_PK_FP8_F32 : VOP3Only_Realtriple_gfx12<0x369>;
1082 defm V_CVT_PK_BF8_F32 : VOP3Only_Realtriple_gfx12<0x36a>;
1083 defm V_CVT_SR_FP8_F32_gfx12 : VOP3_Realtriple_with_name_gfx12<0x36b, "V_CVT_SR_FP8_F32_gfx12", "v_cvt_sr_fp8_f32" >;
1084 defm V_CVT_SR_BF8_F32_gfx12 : VOP3_Realtriple_with_name_gfx12<0x36c, "V_CVT_SR_BF8_F32_gfx12", "v_cvt_sr_bf8_f32">;
1086 //===----------------------------------------------------------------------===//
1088 //===----------------------------------------------------------------------===//
1090 multiclass VOP3_Real_with_name_gfx11_gfx12<bits<10> op, string opName,
1092 VOP3_Real_with_name<GFX11Gen, op, opName, asmName>,
1093 VOP3_Real_with_name<GFX12Gen, op, opName, asmName>;
1095 multiclass VOP3_Realtriple_gfx11_gfx12<bits<10> op> :
1096 VOP3_Realtriple<GFX11Gen, op>, VOP3_Realtriple<GFX12Gen, op>;
1098 multiclass VOP3_Real_Base_gfx11_gfx12<bits<10> op> :
1099 VOP3_Real_Base<GFX11Gen, op>, VOP3_Real_Base<GFX12Gen, op>;
1101 multiclass VOP3_Realtriple_with_name_gfx11_gfx12<bits<10> op, string opName,
1103 VOP3_Realtriple_with_name<GFX11Gen, op, opName, asmName>,
1104 VOP3_Realtriple_with_name<GFX12Gen, op, opName, asmName>;
1106 multiclass VOP3Dot_Realtriple_gfx11_gfx12<bits<10> op> :
1107 VOP3Dot_Realtriple<GFX11Gen, op>, VOP3Dot_Realtriple<GFX12Gen, op>;
1109 multiclass VOP3be_Real_gfx11_gfx12<bits<10> op, string opName, string asmName> :
1110 VOP3be_Real<GFX11Gen, op, opName, asmName>,
1111 VOP3be_Real<GFX12Gen, op, opName, asmName>;
1113 multiclass VOP3_Real_No_Suffix_gfx11_gfx12<bits<10> op> :
1114 VOP3_Real_No_Suffix<GFX11Gen, op>, VOP3_Real_No_Suffix<GFX12Gen, op>;
1116 defm V_FMA_DX9_ZERO_F32 : VOP3_Real_with_name_gfx11_gfx12<0x209, "V_FMA_LEGACY_F32", "v_fma_dx9_zero_f32">;
1117 defm V_MAD_I32_I24 : VOP3_Realtriple_gfx11_gfx12<0x20a>;
1118 defm V_MAD_U32_U24 : VOP3_Realtriple_gfx11_gfx12<0x20b>;
1119 defm V_CUBEID_F32 : VOP3_Realtriple_gfx11_gfx12<0x20c>;
1120 defm V_CUBESC_F32 : VOP3_Realtriple_gfx11_gfx12<0x20d>;
1121 defm V_CUBETC_F32 : VOP3_Realtriple_gfx11_gfx12<0x20e>;
1122 defm V_CUBEMA_F32 : VOP3_Realtriple_gfx11_gfx12<0x20f>;
1123 defm V_BFE_U32 : VOP3_Realtriple_gfx11_gfx12<0x210>;
1124 defm V_BFE_I32 : VOP3_Realtriple_gfx11_gfx12<0x211>;
1125 defm V_BFI_B32 : VOP3_Realtriple_gfx11_gfx12<0x212>;
1126 defm V_FMA_F32 : VOP3_Realtriple_gfx11_gfx12<0x213>;
1127 defm V_FMA_F64 : VOP3_Real_Base_gfx11_gfx12<0x214>;
1128 defm V_LERP_U8 : VOP3_Realtriple_gfx11_gfx12<0x215>;
1129 defm V_ALIGNBIT_B32 : VOP3_Realtriple_gfx11_gfx12<0x216>;
1130 defm V_ALIGNBYTE_B32 : VOP3_Realtriple_gfx11_gfx12<0x217>;
1131 defm V_MULLIT_F32 : VOP3_Realtriple_gfx11_gfx12<0x218>;
1132 defm V_MIN3_F32 : VOP3_Realtriple_gfx11<0x219>;
1133 defm V_MIN3_I32 : VOP3_Realtriple_gfx11_gfx12<0x21a>;
1134 defm V_MIN3_U32 : VOP3_Realtriple_gfx11_gfx12<0x21b>;
1135 defm V_MAX3_F32 : VOP3_Realtriple_gfx11<0x21c>;
1136 defm V_MAX3_I32 : VOP3_Realtriple_gfx11_gfx12<0x21d>;
1137 defm V_MAX3_U32 : VOP3_Realtriple_gfx11_gfx12<0x21e>;
1138 defm V_MED3_F32 : VOP3_Realtriple_gfx11<0x21f>;
1139 defm V_MED3_I32 : VOP3_Realtriple_gfx11_gfx12<0x220>;
1140 defm V_MED3_U32 : VOP3_Realtriple_gfx11_gfx12<0x221>;
1141 defm V_SAD_U8 : VOP3_Realtriple_gfx11_gfx12<0x222>;
1142 defm V_SAD_HI_U8 : VOP3_Realtriple_gfx11_gfx12<0x223>;
1143 defm V_SAD_U16 : VOP3_Realtriple_gfx11_gfx12<0x224>;
1144 defm V_SAD_U32 : VOP3_Realtriple_gfx11_gfx12<0x225>;
1145 defm V_CVT_PK_U8_F32 : VOP3_Realtriple_gfx11_gfx12<0x226>;
1146 defm V_DIV_FIXUP_F32 : VOP3_Real_Base_gfx11_gfx12<0x227>;
1147 defm V_DIV_FIXUP_F64 : VOP3_Real_Base_gfx11_gfx12<0x228>;
1148 defm V_DIV_FMAS_F32 : VOP3_Real_Base_gfx11_gfx12<0x237>;
1149 defm V_DIV_FMAS_F64 : VOP3_Real_Base_gfx11_gfx12<0x238>;
1150 defm V_MSAD_U8 : VOP3_Realtriple_gfx11_gfx12<0x239>;
1151 defm V_QSAD_PK_U16_U8 : VOP3_Real_Base_gfx11_gfx12<0x23a>;
1152 defm V_MQSAD_PK_U16_U8 : VOP3_Real_Base_gfx11_gfx12<0x23b>;
1153 defm V_MQSAD_U32_U8 : VOP3_Real_Base_gfx11_gfx12<0x23d>;
1154 defm V_XOR3_B32 : VOP3_Realtriple_gfx11_gfx12<0x240>;
1155 defm V_MAD_U16 : VOP3_Realtriple_with_name_gfx11_gfx12<0x241, "V_MAD_U16_gfx9", "v_mad_u16">;
1156 defm V_PERM_B32 : VOP3_Realtriple_gfx11_gfx12<0x244>;
1157 defm V_XAD_U32 : VOP3_Realtriple_gfx11_gfx12<0x245>;
1158 defm V_LSHL_ADD_U32 : VOP3_Realtriple_gfx11_gfx12<0x246>;
1159 defm V_ADD_LSHL_U32 : VOP3_Realtriple_gfx11_gfx12<0x247>;
1160 defm V_FMA_F16 : VOP3_Realtriple_with_name_gfx11_gfx12<0x248, "V_FMA_F16_gfx9", "v_fma_f16">;
1161 defm V_MIN3_F16 : VOP3_Realtriple_gfx11<0x249>;
1162 defm V_MIN3_I16 : VOP3_Realtriple_gfx11_gfx12<0x24a>;
1163 defm V_MIN3_U16 : VOP3_Realtriple_gfx11_gfx12<0x24b>;
1164 defm V_MAX3_F16 : VOP3_Realtriple_gfx11<0x24c>;
1165 defm V_MAX3_I16 : VOP3_Realtriple_gfx11_gfx12<0x24d>;
1166 defm V_MAX3_U16 : VOP3_Realtriple_gfx11_gfx12<0x24e>;
1167 defm V_MED3_F16 : VOP3_Realtriple_gfx11<0x24f>;
1168 defm V_MED3_I16 : VOP3_Realtriple_gfx11_gfx12<0x250>;
1169 defm V_MED3_U16 : VOP3_Realtriple_gfx11_gfx12<0x251>;
1170 defm V_MAD_I16 : VOP3_Realtriple_with_name_gfx11_gfx12<0x253, "V_MAD_I16_gfx9", "v_mad_i16">;
1171 defm V_DIV_FIXUP_F16 : VOP3_Realtriple_with_name_gfx11_gfx12<0x254, "V_DIV_FIXUP_F16_gfx9", "v_div_fixup_f16">;
1172 defm V_ADD3_U32 : VOP3_Realtriple_gfx11_gfx12<0x255>;
1173 defm V_LSHL_OR_B32 : VOP3_Realtriple_gfx11_gfx12<0x256>;
1174 defm V_AND_OR_B32 : VOP3_Realtriple_gfx11_gfx12<0x257>;
1175 defm V_OR3_B32 : VOP3_Realtriple_gfx11_gfx12<0x258>;
1176 defm V_MAD_U32_U16 : VOP3_Realtriple_gfx11_gfx12<0x259>;
1177 defm V_MAD_I32_I16 : VOP3_Realtriple_gfx11_gfx12<0x25a>;
1178 defm V_PERMLANE16_B32 : VOP3_Real_Base_gfx11_gfx12<0x25b>;
1179 defm V_PERMLANEX16_B32 : VOP3_Real_Base_gfx11_gfx12<0x25c>;
1180 defm V_MAXMIN_F32 : VOP3_Realtriple_gfx11<0x25e>;
1181 defm V_MINMAX_F32 : VOP3_Realtriple_gfx11<0x25f>;
1182 defm V_MAXMIN_F16 : VOP3_Realtriple_gfx11<0x260>;
1183 defm V_MINMAX_F16 : VOP3_Realtriple_gfx11<0x261>;
1184 defm V_MAXMIN_U32 : VOP3_Realtriple_gfx11_gfx12<0x262>;
1185 defm V_MINMAX_U32 : VOP3_Realtriple_gfx11_gfx12<0x263>;
1186 defm V_MAXMIN_I32 : VOP3_Realtriple_gfx11_gfx12<0x264>;
1187 defm V_MINMAX_I32 : VOP3_Realtriple_gfx11_gfx12<0x265>;
1188 defm V_DOT2_F16_F16 : VOP3Dot_Realtriple_gfx11_gfx12<0x266>;
1189 defm V_DOT2_BF16_BF16 : VOP3Dot_Realtriple_gfx11_gfx12<0x267>;
1190 defm V_DIV_SCALE_F32 : VOP3be_Real_gfx11_gfx12<0x2fc, "V_DIV_SCALE_F32", "v_div_scale_f32">;
1191 defm V_DIV_SCALE_F64 : VOP3be_Real_gfx11_gfx12<0x2fd, "V_DIV_SCALE_F64", "v_div_scale_f64">;
1192 defm V_MAD_U64_U32_gfx11 : VOP3be_Real_gfx11<0x2fe, "V_MAD_U64_U32_gfx11", "v_mad_u64_u32">;
1193 defm V_MAD_I64_I32_gfx11 : VOP3be_Real_gfx11<0x2ff, "V_MAD_I64_I32_gfx11", "v_mad_i64_i32">;
1194 defm V_ADD_NC_U16 : VOP3Only_Realtriple_gfx11_gfx12<0x303>;
1195 defm V_SUB_NC_U16 : VOP3Only_Realtriple_gfx11_gfx12<0x304>;
1196 defm V_MUL_LO_U16_t16 : VOP3Only_Realtriple_t16_gfx11_gfx12<0x305, "v_mul_lo_u16">;
1197 defm V_CVT_PK_I16_F32 : VOP3_Realtriple_gfx11_gfx12<0x306>;
1198 defm V_CVT_PK_U16_F32 : VOP3_Realtriple_gfx11_gfx12<0x307>;
1199 defm V_MAX_U16_t16 : VOP3Only_Realtriple_t16_gfx11_gfx12<0x309, "v_max_u16">;
1200 defm V_MAX_I16_t16 : VOP3Only_Realtriple_t16_gfx11_gfx12<0x30a, "v_max_i16">;
1201 defm V_MIN_U16_t16 : VOP3Only_Realtriple_t16_gfx11_gfx12<0x30b, "v_min_u16">;
1202 defm V_MIN_I16_t16 : VOP3Only_Realtriple_t16_gfx11_gfx12<0x30c, "v_min_i16">;
1203 defm V_ADD_NC_I16 : VOP3_Realtriple_with_name_gfx11_gfx12<0x30d, "V_ADD_I16", "v_add_nc_i16">;
1204 defm V_SUB_NC_I16 : VOP3_Realtriple_with_name_gfx11_gfx12<0x30e, "V_SUB_I16", "v_sub_nc_i16">;
1205 defm V_PACK_B32_F16 : VOP3_Realtriple_gfx11_gfx12<0x311>;
1206 defm V_CVT_PK_NORM_I16_F16 : VOP3_Realtriple_with_name_gfx11_gfx12<0x312, "V_CVT_PKNORM_I16_F16" , "v_cvt_pk_norm_i16_f16" >;
1207 defm V_CVT_PK_NORM_U16_F16 : VOP3_Realtriple_with_name_gfx11_gfx12<0x313, "V_CVT_PKNORM_U16_F16" , "v_cvt_pk_norm_u16_f16" >;
1208 defm V_SUB_NC_I32 : VOP3_Realtriple_with_name_gfx11_gfx12<0x325, "V_SUB_I32", "v_sub_nc_i32">;
1209 defm V_ADD_NC_I32 : VOP3_Realtriple_with_name_gfx11_gfx12<0x326, "V_ADD_I32", "v_add_nc_i32">;
1210 defm V_ADD_F64 : VOP3_Real_Base_gfx11<0x327>;
1211 defm V_MUL_F64 : VOP3_Real_Base_gfx11<0x328>;
1212 defm V_MIN_F64 : VOP3_Real_Base_gfx11<0x329>;
1213 defm V_MAX_F64 : VOP3_Real_Base_gfx11<0x32a>;
1214 defm V_LDEXP_F64 : VOP3_Real_Base_gfx11_gfx12<0x32b>;
1215 defm V_MUL_LO_U32 : VOP3_Real_Base_gfx11_gfx12<0x32c>;
1216 defm V_MUL_HI_U32 : VOP3_Real_Base_gfx11_gfx12<0x32d>;
1217 defm V_MUL_HI_I32 : VOP3_Real_Base_gfx11_gfx12<0x32e>;
1218 defm V_TRIG_PREOP_F64 : VOP3_Real_Base_gfx11_gfx12<0x32f>;
1219 defm V_LSHLREV_B16_t16 : VOP3Only_Realtriple_t16_gfx11_gfx12<0x338, "v_lshlrev_b16">;
1220 defm V_LSHRREV_B16_t16 : VOP3Only_Realtriple_t16_gfx11_gfx12<0x339, "v_lshrrev_b16">;
1221 defm V_ASHRREV_I16_t16 : VOP3Only_Realtriple_t16_gfx11_gfx12<0x33a, "v_ashrrev_i16">;
1222 defm V_LSHLREV_B64 : VOP3_Real_Base_gfx11<0x33c>;
1223 defm V_LSHRREV_B64 : VOP3_Real_Base_gfx11_gfx12<0x33d>;
1224 defm V_ASHRREV_I64 : VOP3_Real_Base_gfx11_gfx12<0x33e>;
1225 defm V_READLANE_B32 : VOP3_Real_No_Suffix_gfx11_gfx12<0x360>; // Pseudo in VOP2
1226 let InOperandList = (ins SSrcOrLds_b32:$src0, SCSrc_b32:$src1, VGPR_32:$vdst_in) in {
1227 defm V_WRITELANE_B32 : VOP3_Real_No_Suffix_gfx11_gfx12<0x361>; // Pseudo in VOP2
1228 } // End InOperandList = (ins SSrcOrLds_b32:$src0, SCSrc_b32:$src1, VGPR_32:$vdst_in)
1229 defm V_AND_B16_t16 : VOP3Only_Realtriple_t16_gfx11_gfx12<0x362, "v_and_b16">;
1230 defm V_OR_B16_t16 : VOP3Only_Realtriple_t16_gfx11_gfx12<0x363, "v_or_b16">;
1231 defm V_XOR_B16_t16 : VOP3Only_Realtriple_t16_gfx11_gfx12<0x364, "v_xor_b16">;
1233 //===----------------------------------------------------------------------===//
1235 //===----------------------------------------------------------------------===//
1237 let AssemblerPredicate = isGFX10Only, DecoderNamespace = "GFX10" in {
1238 multiclass VOP3_Real_gfx10<bits<10> op> {
1240 VOP3_Real<!cast<VOP_Pseudo>(NAME#"_e64"), SIEncodingFamily.GFX10>,
1241 VOP3e_gfx10<op, !cast<VOP_Pseudo>(NAME#"_e64").Pfl>;
1243 multiclass VOP3_Real_No_Suffix_gfx10<bits<10> op> {
1245 VOP3_Real<!cast<VOP_Pseudo>(NAME), SIEncodingFamily.GFX10>,
1246 VOP3e_gfx10<op, !cast<VOP_Pseudo>(NAME).Pfl>;
1248 multiclass VOP3_Real_gfx10_with_name<bits<10> op, string opName,
1251 VOP3_Real<!cast<VOP3_Pseudo>(opName#"_e64"), SIEncodingFamily.GFX10>,
1252 VOP3e_gfx10<op, !cast<VOP3_Pseudo>(opName#"_e64").Pfl> {
1253 VOP3_Pseudo ps = !cast<VOP3_Pseudo>(opName#"_e64");
1254 let AsmString = asmName # ps.AsmOperands;
1258 multiclass VOP3be_Real_gfx10<bits<10> op> {
1260 VOP3_Real<!cast<VOP3_Pseudo>(NAME#"_e64"), SIEncodingFamily.GFX10>,
1261 VOP3be_gfx10<op, !cast<VOP3_Pseudo>(NAME#"_e64").Pfl>;
1263 multiclass VOP3Interp_Real_gfx10<bits<10> op> {
1265 VOP3_Real<!cast<VOP3_Pseudo>(NAME), SIEncodingFamily.GFX10>,
1266 VOP3Interp_gfx10<op, !cast<VOP3_Pseudo>(NAME).Pfl>;
1268 multiclass VOP3OpSel_Real_gfx10<bits<10> op> {
1270 VOP3_Real<!cast<VOP3_Pseudo>(NAME#"_e64"), SIEncodingFamily.GFX10>,
1271 VOP3OpSel_gfx10<op, !cast<VOP3_Pseudo>(NAME#"_e64").Pfl>;
1273 multiclass VOP3OpSel_Real_gfx10_with_name<bits<10> op, string opName,
1276 VOP3_Real<!cast<VOP3_Pseudo>(opName#"_e64"), SIEncodingFamily.GFX10>,
1277 VOP3OpSel_gfx10<op, !cast<VOP3_Pseudo>(opName#"_e64").Pfl> {
1278 VOP3_Pseudo ps = !cast<VOP3_Pseudo>(opName#"_e64");
1279 let AsmString = asmName # ps.AsmOperands;
1282 } // End AssemblerPredicate = isGFX10Only, DecoderNamespace = "GFX10"
1284 let IsInvalidSingleUseConsumer = 1 in {
1285 defm V_READLANE_B32 : VOP3_Real_No_Suffix_gfx10<0x360>;
1286 let InOperandList = (ins SSrcOrLds_b32:$src0, SCSrc_b32:$src1, VGPR_32:$vdst_in), IsInvalidSingleUseProducer = 1 in {
1287 defm V_WRITELANE_B32 : VOP3_Real_No_Suffix_gfx10<0x361>;
1288 } // End InOperandList = (ins SSrcOrLds_b32:$src0, SCSrc_b32: $src1, VGPR_32:$vdst_in), IsInvalidSingleUseProducer = 1
1289 } // End IsInvalidSingleUseConsumer = 1
1291 let SubtargetPredicate = isGFX10Before1030 in {
1292 defm V_MUL_LO_I32 : VOP3_Real_gfx10<0x16b>;
1295 defm V_XOR3_B32 : VOP3_Real_gfx10<0x178>;
1296 defm V_LSHLREV_B64 : VOP3_Real_gfx10<0x2ff>;
1297 defm V_LSHRREV_B64 : VOP3_Real_gfx10<0x300>;
1298 defm V_ASHRREV_I64 : VOP3_Real_gfx10<0x301>;
1299 defm V_PERM_B32 : VOP3_Real_gfx10<0x344>;
1300 defm V_XAD_U32 : VOP3_Real_gfx10<0x345>;
1301 defm V_LSHL_ADD_U32 : VOP3_Real_gfx10<0x346>;
1302 defm V_ADD_LSHL_U32 : VOP3_Real_gfx10<0x347>;
1303 defm V_ADD3_U32 : VOP3_Real_gfx10<0x36d>;
1304 defm V_LSHL_OR_B32 : VOP3_Real_gfx10<0x36f>;
1305 defm V_AND_OR_B32 : VOP3_Real_gfx10<0x371>;
1306 defm V_OR3_B32 : VOP3_Real_gfx10<0x372>;
1308 // TODO-GFX10: add MC tests for v_add/sub_nc_i16
1310 VOP3OpSel_Real_gfx10_with_name<0x30d, "V_ADD_I16", "v_add_nc_i16">;
1312 VOP3OpSel_Real_gfx10_with_name<0x30e, "V_SUB_I16", "v_sub_nc_i16">;
1314 VOP3_Real_gfx10_with_name<0x376, "V_SUB_I32", "v_sub_nc_i32">;
1316 VOP3_Real_gfx10_with_name<0x37f, "V_ADD_I32", "v_add_nc_i32">;
1318 defm V_INTERP_P1_F32_e64 : VOP3Interp_Real_gfx10<0x200>;
1319 defm V_INTERP_P2_F32_e64 : VOP3Interp_Real_gfx10<0x201>;
1320 defm V_INTERP_MOV_F32_e64 : VOP3Interp_Real_gfx10<0x202>;
1322 defm V_INTERP_P1LL_F16 : VOP3Interp_Real_gfx10<0x342>;
1323 defm V_INTERP_P1LV_F16 : VOP3Interp_Real_gfx10<0x343>;
1324 defm V_INTERP_P2_F16 : VOP3Interp_Real_gfx10<0x35a>;
1326 defm V_PACK_B32_F16 : VOP3OpSel_Real_gfx10<0x311>;
1327 defm V_CVT_PKNORM_I16_F16 : VOP3OpSel_Real_gfx10<0x312>;
1328 defm V_CVT_PKNORM_U16_F16 : VOP3OpSel_Real_gfx10<0x313>;
1330 defm V_MIN3_F16 : VOP3OpSel_Real_gfx10<0x351>;
1331 defm V_MIN3_I16 : VOP3OpSel_Real_gfx10<0x352>;
1332 defm V_MIN3_U16 : VOP3OpSel_Real_gfx10<0x353>;
1333 defm V_MAX3_F16 : VOP3OpSel_Real_gfx10<0x354>;
1334 defm V_MAX3_I16 : VOP3OpSel_Real_gfx10<0x355>;
1335 defm V_MAX3_U16 : VOP3OpSel_Real_gfx10<0x356>;
1336 defm V_MED3_F16 : VOP3OpSel_Real_gfx10<0x357>;
1337 defm V_MED3_I16 : VOP3OpSel_Real_gfx10<0x358>;
1338 defm V_MED3_U16 : VOP3OpSel_Real_gfx10<0x359>;
1339 defm V_MAD_U32_U16 : VOP3OpSel_Real_gfx10<0x373>;
1340 defm V_MAD_I32_I16 : VOP3OpSel_Real_gfx10<0x375>;
1343 VOP3OpSel_Real_gfx10_with_name<0x340, "V_MAD_U16_gfx9", "v_mad_u16">;
1345 VOP3OpSel_Real_gfx10_with_name<0x34b, "V_FMA_F16_gfx9", "v_fma_f16">;
1347 VOP3OpSel_Real_gfx10_with_name<0x35e, "V_MAD_I16_gfx9", "v_mad_i16">;
1348 defm V_DIV_FIXUP_F16 :
1349 VOP3OpSel_Real_gfx10_with_name<0x35f, "V_DIV_FIXUP_F16_gfx9", "v_div_fixup_f16">;
1351 defm V_ADD_NC_U16 : VOP3OpSel_Real_gfx10<0x303>;
1352 defm V_SUB_NC_U16 : VOP3OpSel_Real_gfx10<0x304>;
1354 // FIXME-GFX10-OPSEL: Need to add "selective" opsel support to some of these
1355 // (they do not support SDWA or DPP).
1356 defm V_MUL_LO_U16 : VOP3_Real_gfx10_with_name<0x305, "V_MUL_LO_U16", "v_mul_lo_u16">;
1357 defm V_LSHRREV_B16 : VOP3_Real_gfx10_with_name<0x307, "V_LSHRREV_B16", "v_lshrrev_b16">;
1358 defm V_ASHRREV_I16 : VOP3_Real_gfx10_with_name<0x308, "V_ASHRREV_I16", "v_ashrrev_i16">;
1359 defm V_MAX_U16 : VOP3_Real_gfx10_with_name<0x309, "V_MAX_U16", "v_max_u16">;
1360 defm V_MAX_I16 : VOP3_Real_gfx10_with_name<0x30a, "V_MAX_I16", "v_max_i16">;
1361 defm V_MIN_U16 : VOP3_Real_gfx10_with_name<0x30b, "V_MIN_U16", "v_min_u16">;
1362 defm V_MIN_I16 : VOP3_Real_gfx10_with_name<0x30c, "V_MIN_I16", "v_min_i16">;
1363 defm V_LSHLREV_B16 : VOP3_Real_gfx10_with_name<0x314, "V_LSHLREV_B16", "v_lshlrev_b16">;
1364 defm V_PERMLANE16_B32 : VOP3OpSel_Real_gfx10<0x377>;
1365 defm V_PERMLANEX16_B32 : VOP3OpSel_Real_gfx10<0x378>;
1367 //===----------------------------------------------------------------------===//
1369 //===----------------------------------------------------------------------===//
1371 let AssemblerPredicate = isGFX7Only, DecoderNamespace = "GFX7" in {
1372 multiclass VOP3_Real_gfx7<bits<10> op> {
1374 VOP3_Real<!cast<VOP3_Pseudo>(NAME#"_e64"), SIEncodingFamily.SI>,
1375 VOP3e_gfx6_gfx7<op{8-0}, !cast<VOP3_Pseudo>(NAME#"_e64").Pfl>;
1377 multiclass VOP3be_Real_gfx7<bits<10> op> {
1379 VOP3_Real<!cast<VOP3_Pseudo>(NAME#"_e64"), SIEncodingFamily.SI>,
1380 VOP3be_gfx6_gfx7<op{8-0}, !cast<VOP3_Pseudo>(NAME#"_e64").Pfl>;
1382 } // End AssemblerPredicate = isGFX7Only, DecoderNamespace = "GFX7"
1384 multiclass VOP3_Real_gfx7_gfx10<bits<10> op> :
1385 VOP3_Real_gfx7<op>, VOP3_Real_gfx10<op>;
1387 multiclass VOP3be_Real_gfx7_gfx10<bits<10> op> :
1388 VOP3be_Real_gfx7<op>, VOP3be_Real_gfx10<op>;
1390 defm V_QSAD_PK_U16_U8 : VOP3_Real_gfx7_gfx10<0x172>;
1391 defm V_MQSAD_U32_U8 : VOP3_Real_gfx7_gfx10<0x175>;
1392 defm V_MAD_U64_U32 : VOP3be_Real_gfx7_gfx10<0x176>;
1393 defm V_MAD_I64_I32 : VOP3be_Real_gfx7_gfx10<0x177>;
1395 //===----------------------------------------------------------------------===//
1396 // GFX6, GFX7, GFX10.
1397 //===----------------------------------------------------------------------===//
1399 let AssemblerPredicate = isGFX6GFX7, DecoderNamespace = "GFX6GFX7" in {
1400 multiclass VOP3_Real_gfx6_gfx7<bits<10> op> {
1402 VOP3_Real<!cast<VOP3_Pseudo>(NAME#"_e64"), SIEncodingFamily.SI>,
1403 VOP3e_gfx6_gfx7<op{8-0}, !cast<VOP3_Pseudo>(NAME#"_e64").Pfl>;
1405 multiclass VOP3be_Real_gfx6_gfx7<bits<10> op> {
1407 VOP3_Real<!cast<VOP3_Pseudo>(NAME#"_e64"), SIEncodingFamily.SI>,
1408 VOP3be_gfx6_gfx7<op{8-0}, !cast<VOP3_Pseudo>(NAME#"_e64").Pfl>;
1410 } // End AssemblerPredicate = isGFX6GFX7, DecoderNamespace = "GFX6GFX7"
1412 multiclass VOP3_Real_gfx6_gfx7_gfx10<bits<10> op> :
1413 VOP3_Real_gfx6_gfx7<op>, VOP3_Real_gfx10<op>;
1415 multiclass VOP3be_Real_gfx6_gfx7_gfx10<bits<10> op> :
1416 VOP3be_Real_gfx6_gfx7<op>, VOP3be_Real_gfx10<op>;
1418 defm V_LSHL_B64 : VOP3_Real_gfx6_gfx7<0x161>;
1419 defm V_LSHR_B64 : VOP3_Real_gfx6_gfx7<0x162>;
1420 defm V_ASHR_I64 : VOP3_Real_gfx6_gfx7<0x163>;
1421 defm V_MUL_LO_I32 : VOP3_Real_gfx6_gfx7<0x16b>;
1423 defm V_MAD_LEGACY_F32 : VOP3_Real_gfx6_gfx7_gfx10<0x140>;
1424 defm V_MAD_F32 : VOP3_Real_gfx6_gfx7_gfx10<0x141>;
1425 defm V_MAD_I32_I24 : VOP3_Real_gfx6_gfx7_gfx10<0x142>;
1426 defm V_MAD_U32_U24 : VOP3_Real_gfx6_gfx7_gfx10<0x143>;
1427 defm V_CUBEID_F32 : VOP3_Real_gfx6_gfx7_gfx10<0x144>;
1428 defm V_CUBESC_F32 : VOP3_Real_gfx6_gfx7_gfx10<0x145>;
1429 defm V_CUBETC_F32 : VOP3_Real_gfx6_gfx7_gfx10<0x146>;
1430 defm V_CUBEMA_F32 : VOP3_Real_gfx6_gfx7_gfx10<0x147>;
1431 defm V_BFE_U32 : VOP3_Real_gfx6_gfx7_gfx10<0x148>;
1432 defm V_BFE_I32 : VOP3_Real_gfx6_gfx7_gfx10<0x149>;
1433 defm V_BFI_B32 : VOP3_Real_gfx6_gfx7_gfx10<0x14a>;
1434 defm V_FMA_F32 : VOP3_Real_gfx6_gfx7_gfx10<0x14b>;
1435 defm V_FMA_F64 : VOP3_Real_gfx6_gfx7_gfx10<0x14c>;
1436 defm V_LERP_U8 : VOP3_Real_gfx6_gfx7_gfx10<0x14d>;
1437 defm V_ALIGNBIT_B32 : VOP3_Real_gfx6_gfx7_gfx10<0x14e>;
1438 defm V_ALIGNBYTE_B32 : VOP3_Real_gfx6_gfx7_gfx10<0x14f>;
1439 defm V_MULLIT_F32 : VOP3_Real_gfx6_gfx7_gfx10<0x150>;
1440 defm V_MIN3_F32 : VOP3_Real_gfx6_gfx7_gfx10<0x151>;
1441 defm V_MIN3_I32 : VOP3_Real_gfx6_gfx7_gfx10<0x152>;
1442 defm V_MIN3_U32 : VOP3_Real_gfx6_gfx7_gfx10<0x153>;
1443 defm V_MAX3_F32 : VOP3_Real_gfx6_gfx7_gfx10<0x154>;
1444 defm V_MAX3_I32 : VOP3_Real_gfx6_gfx7_gfx10<0x155>;
1445 defm V_MAX3_U32 : VOP3_Real_gfx6_gfx7_gfx10<0x156>;
1446 defm V_MED3_F32 : VOP3_Real_gfx6_gfx7_gfx10<0x157>;
1447 defm V_MED3_I32 : VOP3_Real_gfx6_gfx7_gfx10<0x158>;
1448 defm V_MED3_U32 : VOP3_Real_gfx6_gfx7_gfx10<0x159>;
1449 defm V_SAD_U8 : VOP3_Real_gfx6_gfx7_gfx10<0x15a>;
1450 defm V_SAD_HI_U8 : VOP3_Real_gfx6_gfx7_gfx10<0x15b>;
1451 defm V_SAD_U16 : VOP3_Real_gfx6_gfx7_gfx10<0x15c>;
1452 defm V_SAD_U32 : VOP3_Real_gfx6_gfx7_gfx10<0x15d>;
1453 defm V_CVT_PK_U8_F32 : VOP3_Real_gfx6_gfx7_gfx10<0x15e>;
1454 defm V_DIV_FIXUP_F32 : VOP3_Real_gfx6_gfx7_gfx10<0x15f>;
1455 defm V_DIV_FIXUP_F64 : VOP3_Real_gfx6_gfx7_gfx10<0x160>;
1456 defm V_ADD_F64 : VOP3_Real_gfx6_gfx7_gfx10<0x164>;
1457 defm V_MUL_F64 : VOP3_Real_gfx6_gfx7_gfx10<0x165>;
1458 defm V_MIN_F64 : VOP3_Real_gfx6_gfx7_gfx10<0x166>;
1459 defm V_MAX_F64 : VOP3_Real_gfx6_gfx7_gfx10<0x167>;
1460 defm V_LDEXP_F64 : VOP3_Real_gfx6_gfx7_gfx10<0x168>;
1461 defm V_MUL_LO_U32 : VOP3_Real_gfx6_gfx7_gfx10<0x169>;
1462 defm V_MUL_HI_U32 : VOP3_Real_gfx6_gfx7_gfx10<0x16a>;
1463 defm V_MUL_HI_I32 : VOP3_Real_gfx6_gfx7_gfx10<0x16c>;
1464 defm V_DIV_FMAS_F32 : VOP3_Real_gfx6_gfx7_gfx10<0x16f>;
1465 defm V_DIV_FMAS_F64 : VOP3_Real_gfx6_gfx7_gfx10<0x170>;
1466 defm V_MSAD_U8 : VOP3_Real_gfx6_gfx7_gfx10<0x171>;
1467 defm V_MQSAD_PK_U16_U8 : VOP3_Real_gfx6_gfx7_gfx10<0x173>;
1468 defm V_TRIG_PREOP_F64 : VOP3_Real_gfx6_gfx7_gfx10<0x174>;
1469 defm V_DIV_SCALE_F32 : VOP3be_Real_gfx6_gfx7_gfx10<0x16d>;
1470 defm V_DIV_SCALE_F64 : VOP3be_Real_gfx6_gfx7_gfx10<0x16e>;
1472 // NB: Same opcode as v_mad_legacy_f32
1473 let DecoderNamespace = "GFX10_B" in
1474 defm V_FMA_LEGACY_F32 : VOP3_Real_gfx10<0x140>;
1476 //===----------------------------------------------------------------------===//
1478 //===----------------------------------------------------------------------===//
1480 let AssemblerPredicate = isGFX8GFX9, DecoderNamespace = "GFX8" in {
1482 multiclass VOP3_Real_vi<bits<10> op> {
1483 def _vi : VOP3_Real<!cast<VOP_Pseudo>(NAME#"_e64"), SIEncodingFamily.VI>,
1484 VOP3e_vi <op, !cast<VOP_Pseudo>(NAME#"_e64").Pfl>;
1486 multiclass VOP3_Real_No_Suffix_vi<bits<10> op> {
1487 def _vi : VOP3_Real<!cast<VOP_Pseudo>(NAME), SIEncodingFamily.VI>,
1488 VOP3e_vi <op, !cast<VOP_Pseudo>(NAME).Pfl>;
1491 multiclass VOP3be_Real_vi<bits<10> op> {
1492 def _vi : VOP3_Real<!cast<VOP_Pseudo>(NAME#"_e64"), SIEncodingFamily.VI>,
1493 VOP3be_vi <op, !cast<VOP_Pseudo>(NAME#"_e64").Pfl>;
1496 multiclass VOP3OpSel_Real_gfx9<bits<10> op> {
1497 def _vi : VOP3_Real<!cast<VOP_Pseudo>(NAME#"_e64"), SIEncodingFamily.VI>,
1498 VOP3OpSel_gfx9 <op, !cast<VOP_Pseudo>(NAME#"_e64").Pfl>;
1501 multiclass VOP3OpSel_Real_gfx9_forced_opsel2<bits<10> op> {
1502 def _vi : VOP3_Real<!cast<VOP_Pseudo>(NAME#"_e64"), SIEncodingFamily.VI>,
1503 VOP3OpSel_gfx9 <op, !cast<VOP_Pseudo>(NAME#"_e64").Pfl> {
1504 let Inst{13} = src2_modifiers{2}; // op_sel(2)
1508 multiclass VOP3Interp_Real_vi<bits<10> op> {
1509 def _vi : VOP3_Real<!cast<VOP_Pseudo>(NAME), SIEncodingFamily.VI>,
1510 VOP3Interp_vi <op, !cast<VOP_Pseudo>(NAME).Pfl>;
1513 } // End AssemblerPredicate = isGFX8GFX9, DecoderNamespace = "GFX8"
1515 let AssemblerPredicate = isGFX8Only, DecoderNamespace = "GFX8" in {
1517 multiclass VOP3_F16_Real_vi<bits<10> op> {
1518 def _vi : VOP3_Real<!cast<VOP3_Pseudo>(NAME#"_e64"), SIEncodingFamily.VI>,
1519 VOP3e_vi <op, !cast<VOP3_Pseudo>(NAME#"_e64").Pfl>;
1522 multiclass VOP3Interp_F16_Real_vi<bits<10> op> {
1523 def _vi : VOP3_Real<!cast<VOP3_Pseudo>(NAME), SIEncodingFamily.VI>,
1524 VOP3Interp_vi <op, !cast<VOP3_Pseudo>(NAME).Pfl>;
1527 } // End AssemblerPredicate = isGFX8Only, DecoderNamespace = "GFX8"
1529 let AssemblerPredicate = isGFX9Only, DecoderNamespace = "GFX9" in {
1531 multiclass VOP3_F16_Real_gfx9<bits<10> op, string OpName, string AsmName> {
1532 def _gfx9 : VOP3_Real<!cast<VOP3_Pseudo>(OpName#"_e64"), SIEncodingFamily.GFX9>,
1533 VOP3e_vi <op, !cast<VOP3_Pseudo>(OpName#"_e64").Pfl> {
1534 VOP3_Pseudo ps = !cast<VOP3_Pseudo>(OpName#"_e64");
1535 let AsmString = AsmName # ps.AsmOperands;
1539 multiclass VOP3OpSel_F16_Real_gfx9<bits<10> op, string AsmName> {
1540 def _gfx9 : VOP3_Real<!cast<VOP3_Pseudo>(NAME#"_e64"), SIEncodingFamily.GFX9>,
1541 VOP3OpSel_gfx9 <op, !cast<VOP3_Pseudo>(NAME#"_e64").Pfl> {
1542 VOP3_Pseudo ps = !cast<VOP3_Pseudo>(NAME#"_e64");
1543 let AsmString = AsmName # ps.AsmOperands;
1547 multiclass VOP3Interp_F16_Real_gfx9<bits<10> op, string OpName, string AsmName> {
1548 def _gfx9 : VOP3_Real<!cast<VOP3_Pseudo>(OpName), SIEncodingFamily.GFX9>,
1549 VOP3Interp_vi <op, !cast<VOP3_Pseudo>(OpName).Pfl> {
1550 VOP3_Pseudo ps = !cast<VOP3_Pseudo>(OpName);
1551 let AsmString = AsmName # ps.AsmOperands;
1555 multiclass VOP3_Real_gfx9<bits<10> op, string AsmName> {
1556 def _gfx9 : VOP3_Real<!cast<VOP_Pseudo>(NAME#"_e64"), SIEncodingFamily.GFX9>,
1557 VOP3e_vi <op, !cast<VOP_Pseudo>(NAME#"_e64").Pfl> {
1558 VOP_Pseudo ps = !cast<VOP_Pseudo>(NAME#"_e64");
1559 let AsmString = AsmName # ps.AsmOperands;
1563 } // End AssemblerPredicate = isGFX9Only, DecoderNamespace = "GFX9"
1565 defm V_MAD_U64_U32 : VOP3be_Real_vi <0x1E8>;
1566 defm V_MAD_I64_I32 : VOP3be_Real_vi <0x1E9>;
1568 defm V_MAD_LEGACY_F32 : VOP3_Real_vi <0x1c0>;
1569 defm V_MAD_F32 : VOP3_Real_vi <0x1c1>;
1570 defm V_MAD_I32_I24 : VOP3_Real_vi <0x1c2>;
1571 defm V_MAD_U32_U24 : VOP3_Real_vi <0x1c3>;
1572 defm V_CUBEID_F32 : VOP3_Real_vi <0x1c4>;
1573 defm V_CUBESC_F32 : VOP3_Real_vi <0x1c5>;
1574 defm V_CUBETC_F32 : VOP3_Real_vi <0x1c6>;
1575 defm V_CUBEMA_F32 : VOP3_Real_vi <0x1c7>;
1576 defm V_BFE_U32 : VOP3_Real_vi <0x1c8>;
1577 defm V_BFE_I32 : VOP3_Real_vi <0x1c9>;
1578 defm V_BFI_B32 : VOP3_Real_vi <0x1ca>;
1579 defm V_FMA_F32 : VOP3_Real_vi <0x1cb>;
1580 defm V_FMA_F64 : VOP3_Real_vi <0x1cc>;
1581 defm V_LERP_U8 : VOP3_Real_vi <0x1cd>;
1582 defm V_ALIGNBIT_B32 : VOP3_Real_vi <0x1ce>;
1583 defm V_ALIGNBYTE_B32 : VOP3_Real_vi <0x1cf>;
1584 defm V_MIN3_F32 : VOP3_Real_vi <0x1d0>;
1585 defm V_MIN3_I32 : VOP3_Real_vi <0x1d1>;
1586 defm V_MIN3_U32 : VOP3_Real_vi <0x1d2>;
1587 defm V_MAX3_F32 : VOP3_Real_vi <0x1d3>;
1588 defm V_MAX3_I32 : VOP3_Real_vi <0x1d4>;
1589 defm V_MAX3_U32 : VOP3_Real_vi <0x1d5>;
1590 defm V_MED3_F32 : VOP3_Real_vi <0x1d6>;
1591 defm V_MED3_I32 : VOP3_Real_vi <0x1d7>;
1592 defm V_MED3_U32 : VOP3_Real_vi <0x1d8>;
1593 defm V_SAD_U8 : VOP3_Real_vi <0x1d9>;
1594 defm V_SAD_HI_U8 : VOP3_Real_vi <0x1da>;
1595 defm V_SAD_U16 : VOP3_Real_vi <0x1db>;
1596 defm V_SAD_U32 : VOP3_Real_vi <0x1dc>;
1597 defm V_CVT_PK_U8_F32 : VOP3_Real_vi <0x1dd>;
1598 defm V_DIV_FIXUP_F32 : VOP3_Real_vi <0x1de>;
1599 defm V_DIV_FIXUP_F64 : VOP3_Real_vi <0x1df>;
1600 defm V_DIV_SCALE_F32 : VOP3be_Real_vi <0x1e0>;
1601 defm V_DIV_SCALE_F64 : VOP3be_Real_vi <0x1e1>;
1602 defm V_DIV_FMAS_F32 : VOP3_Real_vi <0x1e2>;
1603 defm V_DIV_FMAS_F64 : VOP3_Real_vi <0x1e3>;
1604 defm V_MSAD_U8 : VOP3_Real_vi <0x1e4>;
1605 defm V_QSAD_PK_U16_U8 : VOP3_Real_vi <0x1e5>;
1606 defm V_MQSAD_PK_U16_U8 : VOP3_Real_vi <0x1e6>;
1607 defm V_MQSAD_U32_U8 : VOP3_Real_vi <0x1e7>;
1609 defm V_PERM_B32 : VOP3_Real_vi <0x1ed>;
1611 defm V_MAD_F16 : VOP3_F16_Real_vi <0x1ea>;
1612 defm V_MAD_U16 : VOP3_F16_Real_vi <0x1eb>;
1613 defm V_MAD_I16 : VOP3_F16_Real_vi <0x1ec>;
1614 defm V_FMA_F16 : VOP3_F16_Real_vi <0x1ee>;
1615 defm V_DIV_FIXUP_F16 : VOP3_F16_Real_vi <0x1ef>;
1616 defm V_INTERP_P2_F16 : VOP3Interp_F16_Real_vi <0x276>;
1618 let FPDPRounding = 1 in {
1619 defm V_MAD_LEGACY_F16 : VOP3_F16_Real_gfx9 <0x1ea, "V_MAD_F16", "v_mad_legacy_f16">;
1620 defm V_FMA_LEGACY_F16 : VOP3_F16_Real_gfx9 <0x1ee, "V_FMA_F16", "v_fma_legacy_f16">;
1621 defm V_DIV_FIXUP_LEGACY_F16 : VOP3_F16_Real_gfx9 <0x1ef, "V_DIV_FIXUP_F16", "v_div_fixup_legacy_f16">;
1622 defm V_INTERP_P2_LEGACY_F16 : VOP3Interp_F16_Real_gfx9 <0x276, "V_INTERP_P2_F16", "v_interp_p2_legacy_f16">;
1623 } // End FPDPRounding = 1
1625 defm V_MAD_LEGACY_U16 : VOP3_F16_Real_gfx9 <0x1eb, "V_MAD_U16", "v_mad_legacy_u16">;
1626 defm V_MAD_LEGACY_I16 : VOP3_F16_Real_gfx9 <0x1ec, "V_MAD_I16", "v_mad_legacy_i16">;
1628 defm V_MAD_F16_gfx9 : VOP3OpSel_F16_Real_gfx9 <0x203, "v_mad_f16">;
1629 defm V_MAD_U16_gfx9 : VOP3OpSel_F16_Real_gfx9 <0x204, "v_mad_u16">;
1630 defm V_MAD_I16_gfx9 : VOP3OpSel_F16_Real_gfx9 <0x205, "v_mad_i16">;
1631 defm V_FMA_F16_gfx9 : VOP3OpSel_F16_Real_gfx9 <0x206, "v_fma_f16">;
1632 defm V_DIV_FIXUP_F16_gfx9 : VOP3OpSel_F16_Real_gfx9 <0x207, "v_div_fixup_f16">;
1633 defm V_INTERP_P2_F16_gfx9 : VOP3Interp_F16_Real_gfx9 <0x277, "V_INTERP_P2_F16_gfx9", "v_interp_p2_f16">;
1635 defm V_ADD_I32 : VOP3_Real_vi <0x29c>;
1636 defm V_SUB_I32 : VOP3_Real_vi <0x29d>;
1638 defm V_INTERP_P1_F32_e64 : VOP3Interp_Real_vi <0x270>;
1639 defm V_INTERP_P2_F32_e64 : VOP3Interp_Real_vi <0x271>;
1640 defm V_INTERP_MOV_F32_e64 : VOP3Interp_Real_vi <0x272>;
1642 defm V_INTERP_P1LL_F16 : VOP3Interp_Real_vi <0x274>;
1643 defm V_INTERP_P1LV_F16 : VOP3Interp_Real_vi <0x275>;
1644 defm V_ADD_F64 : VOP3_Real_vi <0x280>;
1645 defm V_MUL_F64 : VOP3_Real_vi <0x281>;
1646 defm V_MIN_F64 : VOP3_Real_vi <0x282>;
1647 defm V_MAX_F64 : VOP3_Real_vi <0x283>;
1648 defm V_LDEXP_F64 : VOP3_Real_vi <0x284>;
1649 defm V_MUL_LO_U32 : VOP3_Real_vi <0x285>;
1651 // removed from VI as identical to V_MUL_LO_U32
1652 let isAsmParserOnly = 1 in {
1653 defm V_MUL_LO_I32 : VOP3_Real_vi <0x285>;
1656 defm V_MUL_HI_U32 : VOP3_Real_vi <0x286>;
1657 defm V_MUL_HI_I32 : VOP3_Real_vi <0x287>;
1659 defm V_READLANE_B32 : VOP3_Real_No_Suffix_vi <0x289>;
1660 defm V_WRITELANE_B32 : VOP3_Real_No_Suffix_vi <0x28a>;
1662 defm V_LSHLREV_B64 : VOP3_Real_vi <0x28f>;
1663 defm V_LSHRREV_B64 : VOP3_Real_vi <0x290>;
1664 defm V_ASHRREV_I64 : VOP3_Real_vi <0x291>;
1665 defm V_TRIG_PREOP_F64 : VOP3_Real_vi <0x292>;
1667 defm V_LSHL_ADD_U32 : VOP3_Real_vi <0x1fd>;
1668 defm V_ADD_LSHL_U32 : VOP3_Real_vi <0x1fe>;
1669 defm V_ADD3_U32 : VOP3_Real_vi <0x1ff>;
1670 defm V_LSHL_OR_B32 : VOP3_Real_vi <0x200>;
1671 defm V_AND_OR_B32 : VOP3_Real_vi <0x201>;
1672 defm V_OR3_B32 : VOP3_Real_vi <0x202>;
1673 defm V_PACK_B32_F16 : VOP3OpSel_Real_gfx9 <0x2a0>;
1675 defm V_XAD_U32 : VOP3_Real_vi <0x1f3>;
1677 defm V_MIN3_F16 : VOP3OpSel_Real_gfx9 <0x1f4>;
1678 defm V_MIN3_I16 : VOP3OpSel_Real_gfx9 <0x1f5>;
1679 defm V_MIN3_U16 : VOP3OpSel_Real_gfx9 <0x1f6>;
1681 defm V_MAX3_F16 : VOP3OpSel_Real_gfx9 <0x1f7>;
1682 defm V_MAX3_I16 : VOP3OpSel_Real_gfx9 <0x1f8>;
1683 defm V_MAX3_U16 : VOP3OpSel_Real_gfx9 <0x1f9>;
1685 defm V_MED3_F16 : VOP3OpSel_Real_gfx9 <0x1fa>;
1686 defm V_MED3_I16 : VOP3OpSel_Real_gfx9 <0x1fb>;
1687 defm V_MED3_U16 : VOP3OpSel_Real_gfx9 <0x1fc>;
1689 defm V_ADD_I16 : VOP3OpSel_Real_gfx9 <0x29e>;
1690 defm V_SUB_I16 : VOP3OpSel_Real_gfx9 <0x29f>;
1692 defm V_MAD_U32_U16 : VOP3OpSel_Real_gfx9 <0x1f1>;
1693 defm V_MAD_I32_I16 : VOP3OpSel_Real_gfx9 <0x1f2>;
1695 defm V_CVT_PKNORM_I16_F16 : VOP3OpSel_Real_gfx9 <0x299>;
1696 defm V_CVT_PKNORM_U16_F16 : VOP3OpSel_Real_gfx9 <0x29a>;
1698 defm V_LSHL_ADD_U64 : VOP3_Real_vi <0x208>;
1700 defm V_CVT_PK_FP8_F32 : VOP3OpSel_Real_gfx9 <0x2a2>;
1701 defm V_CVT_PK_BF8_F32 : VOP3OpSel_Real_gfx9 <0x2a3>;
1702 defm V_CVT_SR_FP8_F32 : VOP3OpSel_Real_gfx9_forced_opsel2 <0x2a4>;
1703 defm V_CVT_SR_BF8_F32 : VOP3OpSel_Real_gfx9_forced_opsel2 <0x2a5>;