1*0fca6ea1SDimitry Andric 25ffd83dbSDimitry Andric//===-- VOP1Instructions.td - Vector Instruction Definitions --------------===// 30b57cec5SDimitry Andric// 40b57cec5SDimitry Andric// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 50b57cec5SDimitry Andric// See https://llvm.org/LICENSE.txt for license information. 60b57cec5SDimitry Andric// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 70b57cec5SDimitry Andric// 80b57cec5SDimitry Andric//===----------------------------------------------------------------------===// 90b57cec5SDimitry Andric 100b57cec5SDimitry Andric//===----------------------------------------------------------------------===// 110b57cec5SDimitry Andric// VOP1 Classes 120b57cec5SDimitry Andric//===----------------------------------------------------------------------===// 130b57cec5SDimitry Andric 140b57cec5SDimitry Andricclass VOP1e <bits<8> op, VOPProfile P> : Enc32 { 150b57cec5SDimitry Andric bits<8> vdst; 160b57cec5SDimitry Andric bits<9> src0; 170b57cec5SDimitry Andric 180b57cec5SDimitry Andric let Inst{8-0} = !if(P.HasSrc0, src0{8-0}, ?); 190b57cec5SDimitry Andric let Inst{16-9} = op; 200b57cec5SDimitry Andric let Inst{24-17} = !if(P.EmitDst, vdst{7-0}, 0); 210b57cec5SDimitry Andric let Inst{31-25} = 0x3f; //encoding 220b57cec5SDimitry Andric} 230b57cec5SDimitry Andric 240b57cec5SDimitry Andricclass VOP1_SDWAe <bits<8> op, VOPProfile P> : VOP_SDWAe <P> { 250b57cec5SDimitry Andric bits<8> vdst; 260b57cec5SDimitry Andric 270b57cec5SDimitry Andric let Inst{8-0} = 0xf9; // sdwa 280b57cec5SDimitry Andric let Inst{16-9} = op; 290b57cec5SDimitry Andric let Inst{24-17} = !if(P.EmitDst, vdst{7-0}, 0); 300b57cec5SDimitry Andric let Inst{31-25} = 0x3f; // encoding 310b57cec5SDimitry Andric} 320b57cec5SDimitry Andric 330b57cec5SDimitry Andricclass VOP1_SDWA9Ae <bits<8> op, VOPProfile P> : VOP_SDWA9Ae <P> { 340b57cec5SDimitry Andric bits<8> vdst; 350b57cec5SDimitry Andric 360b57cec5SDimitry Andric let Inst{8-0} = 0xf9; // sdwa 370b57cec5SDimitry Andric let Inst{16-9} = op; 380b57cec5SDimitry Andric let Inst{24-17} = !if(P.EmitDst, vdst{7-0}, 0); 390b57cec5SDimitry Andric let Inst{31-25} = 0x3f; // encoding 400b57cec5SDimitry Andric} 410b57cec5SDimitry Andric 420b57cec5SDimitry Andricclass VOP1_Pseudo <string opName, VOPProfile P, list<dag> pattern=[], bit VOP1Only = 0> : 430b57cec5SDimitry Andric VOP_Pseudo <opName, !if(VOP1Only, "", "_e32"), P, P.Outs32, P.Ins32, "", pattern> { 440b57cec5SDimitry Andric 450b57cec5SDimitry Andric let AsmOperands = P.Asm32; 460b57cec5SDimitry Andric 470b57cec5SDimitry Andric let Size = 4; 480b57cec5SDimitry Andric let mayLoad = 0; 490b57cec5SDimitry Andric let mayStore = 0; 500b57cec5SDimitry Andric let hasSideEffects = 0; 510b57cec5SDimitry Andric 527a6dacacSDimitry Andric let ReadsModeReg = !or(P.DstVT.isFP, P.Src0VT.isFP); 535ffd83dbSDimitry Andric 545ffd83dbSDimitry Andric let mayRaiseFPException = ReadsModeReg; 555ffd83dbSDimitry Andric 560b57cec5SDimitry Andric let VOP1 = 1; 570b57cec5SDimitry Andric let VALU = 1; 585ffd83dbSDimitry Andric let Uses = !if(ReadsModeReg, [MODE, EXEC], [EXEC]); 590b57cec5SDimitry Andric 600b57cec5SDimitry Andric let AsmVariantName = AMDGPUAsmVariants.Default; 610b57cec5SDimitry Andric} 620b57cec5SDimitry Andric 6381ad6265SDimitry Andricclass VOP1_Real <VOP1_Pseudo ps, int EncodingFamily, string real_name = ps.Mnemonic > : 64fe6060f1SDimitry Andric VOP_Real <ps>, 6581ad6265SDimitry Andric InstSI <ps.OutOperandList, ps.InOperandList, real_name # ps.AsmOperands, []>, 660b57cec5SDimitry Andric SIMCInstr <ps.PseudoInstr, EncodingFamily> { 670b57cec5SDimitry Andric 68fe6060f1SDimitry Andric let VALU = 1; 69fe6060f1SDimitry Andric let VOP1 = 1; 700b57cec5SDimitry Andric let isPseudo = 0; 710b57cec5SDimitry Andric let isCodeGenOnly = 0; 720b57cec5SDimitry Andric 730b57cec5SDimitry Andric let Constraints = ps.Constraints; 740b57cec5SDimitry Andric let DisableEncoding = ps.DisableEncoding; 750b57cec5SDimitry Andric 760b57cec5SDimitry Andric // copy relevant pseudo op flags 770b57cec5SDimitry Andric let SubtargetPredicate = ps.SubtargetPredicate; 78297eecfbSDimitry Andric let OtherPredicates = ps.OtherPredicates; 790b57cec5SDimitry Andric let AsmMatchConverter = ps.AsmMatchConverter; 800b57cec5SDimitry Andric let AsmVariantName = ps.AsmVariantName; 810b57cec5SDimitry Andric let Constraints = ps.Constraints; 820b57cec5SDimitry Andric let DisableEncoding = ps.DisableEncoding; 830b57cec5SDimitry Andric let TSFlags = ps.TSFlags; 840b57cec5SDimitry Andric let UseNamedOperandTable = ps.UseNamedOperandTable; 850b57cec5SDimitry Andric let Uses = ps.Uses; 860b57cec5SDimitry Andric let Defs = ps.Defs; 87fe6060f1SDimitry Andric let SchedRW = ps.SchedRW; 88fe6060f1SDimitry Andric let mayLoad = ps.mayLoad; 89fe6060f1SDimitry Andric let mayStore = ps.mayStore; 90fe6060f1SDimitry Andric let TRANS = ps.TRANS; 910b57cec5SDimitry Andric} 920b57cec5SDimitry Andric 935f757f3fSDimitry Andricclass VOP1_Real_Gen <VOP1_Pseudo ps, GFXGen Gen, string real_name = ps.Mnemonic> : 945f757f3fSDimitry Andric VOP1_Real <ps, Gen.Subtarget, real_name> { 955f757f3fSDimitry Andric let AssemblerPredicate = Gen.AssemblerPredicate; 965f757f3fSDimitry Andric let DecoderNamespace = Gen.DecoderNamespace; 975f757f3fSDimitry Andric} 985f757f3fSDimitry Andric 990b57cec5SDimitry Andricclass VOP1_SDWA_Pseudo <string OpName, VOPProfile P, list<dag> pattern=[]> : 1000b57cec5SDimitry Andric VOP_SDWA_Pseudo <OpName, P, pattern> { 1010b57cec5SDimitry Andric let AsmMatchConverter = "cvtSdwaVOP1"; 1020b57cec5SDimitry Andric} 1030b57cec5SDimitry Andric 1040b57cec5SDimitry Andricclass VOP1_DPP_Pseudo <string OpName, VOPProfile P, list<dag> pattern=[]> : 1050b57cec5SDimitry Andric VOP_DPP_Pseudo <OpName, P, pattern> { 1060b57cec5SDimitry Andric} 1070b57cec5SDimitry Andric 108*0fca6ea1SDimitry Andricclass getVOP1Pat <SDPatternOperator node, VOPProfile P> : LetDummies { 1090b57cec5SDimitry Andric list<dag> ret = 1100b57cec5SDimitry Andric !if(P.HasModifiers, 1115ffd83dbSDimitry Andric [(set P.DstVT:$vdst, (node (P.Src0VT (VOP3Mods P.Src0VT:$src0, i32:$src0_modifiers))))], 1120b57cec5SDimitry Andric !if(P.HasOMod, 1130b57cec5SDimitry Andric [(set P.DstVT:$vdst, (node (P.Src0VT (VOP3OMods P.Src0VT:$src0, 1140b57cec5SDimitry Andric i1:$clamp, i32:$omod))))], 115*0fca6ea1SDimitry Andric [(set P.DstVT:$vdst, (node (P.Src0VT P.Src0RC32:$src0)))] 1160b57cec5SDimitry Andric ) 1170b57cec5SDimitry Andric ); 1180b57cec5SDimitry Andric} 1190b57cec5SDimitry Andric 1200b57cec5SDimitry Andricmulticlass VOP1Inst <string opName, VOPProfile P, 12181ad6265SDimitry Andric SDPatternOperator node = null_frag, int VOPDOp = -1> { 1225ffd83dbSDimitry Andric // We only want to set this on the basic, non-SDWA or DPP forms. 12381ad6265SDimitry Andric defvar should_mov_imm = !or(!eq(opName, "v_mov_b32"), 12481ad6265SDimitry Andric !eq(opName, "v_mov_b64")); 1255ffd83dbSDimitry Andric 1265ffd83dbSDimitry Andric let isMoveImm = should_mov_imm in { 12781ad6265SDimitry Andric if !eq(VOPDOp, -1) then 1280b57cec5SDimitry Andric def _e32 : VOP1_Pseudo <opName, P>; 12981ad6265SDimitry Andric else 13081ad6265SDimitry Andric // Only for V_MOV_B32 13106c3fb27SDimitry Andric def _e32 : VOP1_Pseudo <opName, P>, VOPD_Component<VOPDOp, opName>; 13281ad6265SDimitry Andric def _e64 : VOP3InstBase <opName, P, node>; 1335ffd83dbSDimitry Andric } 1348bcb0991SDimitry Andric 13506c3fb27SDimitry Andric if P.HasExtSDWA then 1360b57cec5SDimitry Andric def _sdwa : VOP1_SDWA_Pseudo <opName, P>; 1378bcb0991SDimitry Andric 13806c3fb27SDimitry Andric if P.HasExtDPP then 1390b57cec5SDimitry Andric def _dpp : VOP1_DPP_Pseudo <opName, P>; 1408bcb0991SDimitry Andric 14181ad6265SDimitry Andric let SubtargetPredicate = isGFX11Plus in { 14206c3fb27SDimitry Andric if P.HasExtVOP3DPP then 14381ad6265SDimitry Andric def _e64_dpp : VOP3_DPP_Pseudo <opName, P>; 14481ad6265SDimitry Andric } // End SubtargetPredicate = isGFX11Plus 14581ad6265SDimitry Andric 146*0fca6ea1SDimitry Andric def : LetDummies, AMDGPUMnemonicAlias<opName#"_e32", opName>; 147*0fca6ea1SDimitry Andric def : LetDummies, AMDGPUMnemonicAlias<opName#"_e64", opName>; 1488bcb0991SDimitry Andric 14906c3fb27SDimitry Andric if P.HasExtSDWA then 150*0fca6ea1SDimitry Andric def : LetDummies, AMDGPUMnemonicAlias<opName#"_sdwa", opName>; 1518bcb0991SDimitry Andric 15206c3fb27SDimitry Andric if P.HasExtDPP then 153*0fca6ea1SDimitry Andric def : LetDummies, AMDGPUMnemonicAlias<opName#"_dpp", opName, AMDGPUAsmVariants.DPP>; 154bdd1243dSDimitry Andric} 155bdd1243dSDimitry Andric 156*0fca6ea1SDimitry Andricmulticlass VOP1Inst_t16_with_profiles<string opName, 157bdd1243dSDimitry Andric VOPProfile P, 158*0fca6ea1SDimitry Andric VOPProfile P_t16, 159*0fca6ea1SDimitry Andric VOPProfile P_fake16, 160bdd1243dSDimitry Andric SDPatternOperator node = null_frag> { 161bdd1243dSDimitry Andric let OtherPredicates = [NotHasTrue16BitInsts, Has16BitInsts] in { 162bdd1243dSDimitry Andric defm NAME : VOP1Inst<opName, P, node>; 163bdd1243dSDimitry Andric } 164297eecfbSDimitry Andric let OtherPredicates = [UseRealTrue16Insts] in { 165*0fca6ea1SDimitry Andric defm _t16 : VOP1Inst<opName#"_t16", P_t16, node>; 166297eecfbSDimitry Andric } 167297eecfbSDimitry Andric let OtherPredicates = [UseFakeTrue16Insts] in { 168*0fca6ea1SDimitry Andric defm _fake16 : VOP1Inst<opName#"_fake16", P_fake16, node>; 169bdd1243dSDimitry Andric } 1700b57cec5SDimitry Andric} 1710b57cec5SDimitry Andric 172*0fca6ea1SDimitry Andricmulticlass VOP1Inst_t16<string opName, VOPProfile P, 173*0fca6ea1SDimitry Andric SDPatternOperator node = null_frag> : 174*0fca6ea1SDimitry Andric VOP1Inst_t16_with_profiles<opName, P, VOPProfile_True16<P>, VOPProfile_Fake16<P>, node>; 175*0fca6ea1SDimitry Andric 1760b57cec5SDimitry Andric// Special profile for instructions which have clamp 1770b57cec5SDimitry Andric// and output modifiers (but have no input modifiers) 1780b57cec5SDimitry Andricclass VOPProfileI2F<ValueType dstVt, ValueType srcVt> : 1790b57cec5SDimitry Andric VOPProfile<[dstVt, srcVt, untyped, untyped]> { 1800b57cec5SDimitry Andric 181*0fca6ea1SDimitry Andric let Ins64 = (ins Src0RC64:$src0, Clamp:$clamp, omod:$omod); 182*0fca6ea1SDimitry Andric let InsVOP3Base = (ins Src0VOP3DPP:$src0, Clamp:$clamp, omod:$omod); 183bdd1243dSDimitry Andric let AsmVOP3Base = "$vdst, $src0$clamp$omod"; 184bdd1243dSDimitry Andric 185bdd1243dSDimitry Andric let HasModifiers = 0; 186bdd1243dSDimitry Andric let HasClamp = 1; 187bdd1243dSDimitry Andric} 188bdd1243dSDimitry Andric 189bdd1243dSDimitry Andricclass VOPProfileI2F_True16<ValueType dstVt, ValueType srcVt> : 1905f757f3fSDimitry Andric VOPProfile_Fake16<VOPProfile<[dstVt, srcVt, untyped, untyped]>> { 191bdd1243dSDimitry Andric 192*0fca6ea1SDimitry Andric let Ins64 = (ins Src0RC64:$src0, Clamp:$clamp, omod:$omod); 193*0fca6ea1SDimitry Andric let InsVOP3Base = (ins Src0VOP3DPP:$src0, Clamp:$clamp, omod:$omod); 194bdd1243dSDimitry Andric let AsmVOP3Base = "$vdst, $src0$clamp$omod"; 1950b57cec5SDimitry Andric 1960b57cec5SDimitry Andric let HasModifiers = 0; 1970b57cec5SDimitry Andric let HasClamp = 1; 1980b57cec5SDimitry Andric} 1990b57cec5SDimitry Andric 2000b57cec5SDimitry Andricdef VOP1_F64_I32 : VOPProfileI2F <f64, i32>; 2010b57cec5SDimitry Andricdef VOP1_F32_I32 : VOPProfileI2F <f32, i32>; 2020b57cec5SDimitry Andricdef VOP1_F16_I16 : VOPProfileI2F <f16, i16>; 203bdd1243dSDimitry Andricdef VOP1_F16_I16_t16 : VOPProfileI2F_True16 <f16, i16>; 2040b57cec5SDimitry Andric 20581ad6265SDimitry Andricdef VOP_NOP_PROFILE : VOPProfile <[untyped, untyped, untyped, untyped]>{ 20681ad6265SDimitry Andric let HasExtVOP3DPP = 0; 20781ad6265SDimitry Andric} 20881ad6265SDimitry Andric 20981ad6265SDimitry Andric// OMod clears exceptions when set. OMod was always an operand, but its 21081ad6265SDimitry Andric// now explicitly set. 211fe6060f1SDimitry Andricclass VOP_SPECIAL_OMOD_PROF<ValueType dstVt, ValueType srcVt> : 212fe6060f1SDimitry Andric VOPProfile<[dstVt, srcVt, untyped, untyped]> { 213fe6060f1SDimitry Andric 214fe6060f1SDimitry Andric let HasOMod = 1; 215fe6060f1SDimitry Andric} 216fe6060f1SDimitry Andricdef VOP_I32_F32_SPECIAL_OMOD : VOP_SPECIAL_OMOD_PROF<i32, f32>; 217fe6060f1SDimitry Andricdef VOP_I32_F64_SPECIAL_OMOD : VOP_SPECIAL_OMOD_PROF<i32, f64>; 218fe6060f1SDimitry Andricdef VOP_I16_F16_SPECIAL_OMOD : VOP_SPECIAL_OMOD_PROF<i16, f16>; 2195f757f3fSDimitry Andricdef VOP_I16_F16_SPECIAL_OMOD_t16 : VOPProfile_Fake16<VOP_I16_F16> { 220bdd1243dSDimitry Andric let HasOMod = 1; 221bdd1243dSDimitry Andric} 222fe6060f1SDimitry Andric 2230b57cec5SDimitry Andric//===----------------------------------------------------------------------===// 2240b57cec5SDimitry Andric// VOP1 Instructions 2250b57cec5SDimitry Andric//===----------------------------------------------------------------------===// 2260b57cec5SDimitry Andric 22781ad6265SDimitry Andricdefm V_NOP : VOP1Inst <"v_nop", VOP_NOP_PROFILE>; 22881ad6265SDimitry Andric 22981ad6265SDimitry Andricdef VOPProfile_MOV : VOPProfile <[i32, i32, untyped, untyped]> { 23081ad6265SDimitry Andric let InsVOPDX = (ins Src0RC32:$src0X); 23181ad6265SDimitry Andric let InsVOPDXDeferred = (ins VSrc_f32_Deferred:$src0X); 23281ad6265SDimitry Andric let InsVOPDY = (ins Src0RC32:$src0Y); 23381ad6265SDimitry Andric let InsVOPDYDeferred = (ins VSrc_f32_Deferred:$src0Y); 2340b57cec5SDimitry Andric} 2350b57cec5SDimitry Andric 2365ffd83dbSDimitry Andriclet isReMaterializable = 1, isAsCheapAsAMove = 1 in { 23781ad6265SDimitry Andricdefm V_MOV_B32 : VOP1Inst <"v_mov_b32", VOPProfile_MOV, null_frag, 0x8>; 23881ad6265SDimitry Andric 2395f757f3fSDimitry Andriclet SubtargetPredicate = isGFX940Plus, SchedRW = [Write64Bit] in 24081ad6265SDimitry Andricdefm V_MOV_B64 : VOP1Inst <"v_mov_b64", VOP_I64_I64>; 2410b57cec5SDimitry Andric} // End isMoveImm = 1 2420b57cec5SDimitry Andric 243*0fca6ea1SDimitry Andricdef VOP_READFIRSTLANE : VOPProfile <[i32, i32, untyped, untyped]> { 244*0fca6ea1SDimitry Andric let DstRC = RegisterOperand<SReg_32>; 245*0fca6ea1SDimitry Andric let Src0RC32 = VRegOrLdsSrc_32; 246*0fca6ea1SDimitry Andric let Asm32 = " $vdst, $src0"; 247*0fca6ea1SDimitry Andric} 248*0fca6ea1SDimitry Andric 2490b57cec5SDimitry Andric// FIXME: Specify SchedRW for READFIRSTLANE_B32 250*0fca6ea1SDimitry Andric// TODO: There is VOP3 encoding also 251*0fca6ea1SDimitry Andricdef V_READFIRSTLANE_B32 : VOP1_Pseudo <"v_readfirstlane_b32", VOP_READFIRSTLANE, 252*0fca6ea1SDimitry Andric [], 1> { 2530b57cec5SDimitry Andric let isConvergent = 1; 254*0fca6ea1SDimitry Andric let IsInvalidSingleUseConsumer = 1; 255*0fca6ea1SDimitry Andric} 2560b57cec5SDimitry Andric 257*0fca6ea1SDimitry Andricforeach vt = Reg32Types.types in { 258*0fca6ea1SDimitry Andric def : GCNPat<(vt (int_amdgcn_readfirstlane (vt VRegOrLdsSrc_32:$src0))), 259*0fca6ea1SDimitry Andric (V_READFIRSTLANE_B32 (vt VRegOrLdsSrc_32:$src0)) 260*0fca6ea1SDimitry Andric >; 2610b57cec5SDimitry Andric} 2620b57cec5SDimitry Andric 263fe6060f1SDimitry Andriclet isReMaterializable = 1 in { 2640b57cec5SDimitry Andriclet SchedRW = [WriteDoubleCvt] in { 265fe6060f1SDimitry Andric// OMod clears exceptions when set in this instruction 266fe6060f1SDimitry Andricdefm V_CVT_I32_F64 : VOP1Inst <"v_cvt_i32_f64", VOP_I32_F64_SPECIAL_OMOD, fp_to_sint>; 2675ffd83dbSDimitry Andric 2685ffd83dbSDimitry Andriclet mayRaiseFPException = 0 in { 2690b57cec5SDimitry Andricdefm V_CVT_F64_I32 : VOP1Inst <"v_cvt_f64_i32", VOP1_F64_I32, sint_to_fp>; 2705ffd83dbSDimitry Andric} 2715ffd83dbSDimitry Andric 2720b57cec5SDimitry Andricdefm V_CVT_F32_F64 : VOP1Inst <"v_cvt_f32_f64", VOP_F32_F64, fpround>; 27306c3fb27SDimitry Andricdefm V_CVT_F64_F32 : VOP1Inst <"v_cvt_f64_f32", VOP_F64_F32, any_fpextend>; 274fe6060f1SDimitry Andric// OMod clears exceptions when set in this instruction 275fe6060f1SDimitry Andricdefm V_CVT_U32_F64 : VOP1Inst <"v_cvt_u32_f64", VOP_I32_F64_SPECIAL_OMOD, fp_to_uint>; 2765ffd83dbSDimitry Andric 2775ffd83dbSDimitry Andriclet mayRaiseFPException = 0 in { 2780b57cec5SDimitry Andricdefm V_CVT_F64_U32 : VOP1Inst <"v_cvt_f64_u32", VOP1_F64_I32, uint_to_fp>; 2795ffd83dbSDimitry Andric} 2805ffd83dbSDimitry Andric 2810b57cec5SDimitry Andric} // End SchedRW = [WriteDoubleCvt] 2820b57cec5SDimitry Andric 2835ffd83dbSDimitry Andriclet SchedRW = [WriteFloatCvt] in { 2845ffd83dbSDimitry Andric 2855ffd83dbSDimitry Andric// XXX: Does this really not raise exceptions? The manual claims the 2865ffd83dbSDimitry Andric// 16-bit ones can. 2875ffd83dbSDimitry Andriclet mayRaiseFPException = 0 in { 2880b57cec5SDimitry Andricdefm V_CVT_F32_I32 : VOP1Inst <"v_cvt_f32_i32", VOP1_F32_I32, sint_to_fp>; 2890b57cec5SDimitry Andricdefm V_CVT_F32_U32 : VOP1Inst <"v_cvt_f32_u32", VOP1_F32_I32, uint_to_fp>; 2905ffd83dbSDimitry Andric} 2915ffd83dbSDimitry Andric 292fe6060f1SDimitry Andric// OMod clears exceptions when set in these 2 instructions 293fe6060f1SDimitry Andricdefm V_CVT_U32_F32 : VOP1Inst <"v_cvt_u32_f32", VOP_I32_F32_SPECIAL_OMOD, fp_to_uint>; 294fe6060f1SDimitry Andricdefm V_CVT_I32_F32 : VOP1Inst <"v_cvt_i32_f32", VOP_I32_F32_SPECIAL_OMOD, fp_to_sint>; 295fe6060f1SDimitry Andriclet FPDPRounding = 1, isReMaterializable = 0 in { 296bdd1243dSDimitry Andric let OtherPredicates = [NotHasTrue16BitInsts] in 29706c3fb27SDimitry Andric defm V_CVT_F16_F32 : VOP1Inst <"v_cvt_f16_f32", VOP_F16_F32, any_fpround>; 298bdd1243dSDimitry Andric let OtherPredicates = [HasTrue16BitInsts] in 2995f757f3fSDimitry Andric defm V_CVT_F16_F32_t16 : VOP1Inst <"v_cvt_f16_f32_t16", VOPProfile_Fake16<VOP_F16_F32>, any_fpround>; 300fe6060f1SDimitry Andric} // End FPDPRounding = 1, isReMaterializable = 0 3015ffd83dbSDimitry Andric 302bdd1243dSDimitry Andriclet OtherPredicates = [NotHasTrue16BitInsts] in 30306c3fb27SDimitry Andricdefm V_CVT_F32_F16 : VOP1Inst <"v_cvt_f32_f16", VOP_F32_F16, any_fpextend>; 304bdd1243dSDimitry Andriclet OtherPredicates = [HasTrue16BitInsts] in 3055f757f3fSDimitry Andricdefm V_CVT_F32_F16_t16 : VOP1Inst <"v_cvt_f32_f16_t16", VOPProfile_Fake16<VOP_F32_F16>, any_fpextend>; 3065ffd83dbSDimitry Andric 3075ffd83dbSDimitry Andriclet ReadsModeReg = 0, mayRaiseFPException = 0 in { 3080b57cec5SDimitry Andricdefm V_CVT_RPI_I32_F32 : VOP1Inst <"v_cvt_rpi_i32_f32", VOP_I32_F32, cvt_rpi_i32_f32>; 3090b57cec5SDimitry Andricdefm V_CVT_FLR_I32_F32 : VOP1Inst <"v_cvt_flr_i32_f32", VOP_I32_F32, cvt_flr_i32_f32>; 3100b57cec5SDimitry Andricdefm V_CVT_OFF_F32_I4 : VOP1Inst <"v_cvt_off_f32_i4", VOP1_F32_I32>; 3115ffd83dbSDimitry Andric} // End ReadsModeReg = 0, mayRaiseFPException = 0 3125ffd83dbSDimitry Andric} // End SchedRW = [WriteFloatCvt] 3130b57cec5SDimitry Andric 3145ffd83dbSDimitry Andriclet ReadsModeReg = 0, mayRaiseFPException = 0 in { 3150b57cec5SDimitry Andricdefm V_CVT_F32_UBYTE0 : VOP1Inst <"v_cvt_f32_ubyte0", VOP1_F32_I32, AMDGPUcvt_f32_ubyte0>; 3160b57cec5SDimitry Andricdefm V_CVT_F32_UBYTE1 : VOP1Inst <"v_cvt_f32_ubyte1", VOP1_F32_I32, AMDGPUcvt_f32_ubyte1>; 3170b57cec5SDimitry Andricdefm V_CVT_F32_UBYTE2 : VOP1Inst <"v_cvt_f32_ubyte2", VOP1_F32_I32, AMDGPUcvt_f32_ubyte2>; 3180b57cec5SDimitry Andricdefm V_CVT_F32_UBYTE3 : VOP1Inst <"v_cvt_f32_ubyte3", VOP1_F32_I32, AMDGPUcvt_f32_ubyte3>; 3195ffd83dbSDimitry Andric} // ReadsModeReg = 0, mayRaiseFPException = 0 3200b57cec5SDimitry Andric 3210b57cec5SDimitry Andricdefm V_FRACT_F32 : VOP1Inst <"v_fract_f32", VOP_F32_F32, AMDGPUfract>; 3220b57cec5SDimitry Andricdefm V_TRUNC_F32 : VOP1Inst <"v_trunc_f32", VOP_F32_F32, ftrunc>; 3230b57cec5SDimitry Andricdefm V_CEIL_F32 : VOP1Inst <"v_ceil_f32", VOP_F32_F32, fceil>; 3245f757f3fSDimitry Andricdefm V_RNDNE_F32 : VOP1Inst <"v_rndne_f32", VOP_F32_F32, froundeven>; 3250b57cec5SDimitry Andricdefm V_FLOOR_F32 : VOP1Inst <"v_floor_f32", VOP_F32_F32, ffloor>; 3260b57cec5SDimitry Andric 327e8d8bef9SDimitry Andriclet TRANS = 1, SchedRW = [WriteTrans32] in { 32806c3fb27SDimitry Andricdefm V_EXP_F32 : VOP1Inst <"v_exp_f32", VOP_F32_F32, AMDGPUexp>; 32906c3fb27SDimitry Andricdefm V_LOG_F32 : VOP1Inst <"v_log_f32", VOP_F32_F32, AMDGPUlog>; 3300b57cec5SDimitry Andricdefm V_RCP_F32 : VOP1Inst <"v_rcp_f32", VOP_F32_F32, AMDGPUrcp>; 3310b57cec5SDimitry Andricdefm V_RCP_IFLAG_F32 : VOP1Inst <"v_rcp_iflag_f32", VOP_F32_F32, AMDGPUrcp_iflag>; 3320b57cec5SDimitry Andricdefm V_RSQ_F32 : VOP1Inst <"v_rsq_f32", VOP_F32_F32, AMDGPUrsq>; 3335f757f3fSDimitry Andricdefm V_SQRT_F32 : VOP1Inst <"v_sqrt_f32", VOP_F32_F32, int_amdgcn_sqrt>; 334e8d8bef9SDimitry Andric} // End TRANS = 1, SchedRW = [WriteTrans32] 3350b57cec5SDimitry Andric 336e8d8bef9SDimitry Andriclet TRANS = 1, SchedRW = [WriteTrans64] in { 3370b57cec5SDimitry Andricdefm V_RCP_F64 : VOP1Inst <"v_rcp_f64", VOP_F64_F64, AMDGPUrcp>; 3380b57cec5SDimitry Andricdefm V_RSQ_F64 : VOP1Inst <"v_rsq_f64", VOP_F64_F64, AMDGPUrsq>; 33906c3fb27SDimitry Andricdefm V_SQRT_F64 : VOP1Inst <"v_sqrt_f64", VOP_F64_F64, int_amdgcn_sqrt>; 340e8d8bef9SDimitry Andric} // End TRANS = 1, SchedRW = [WriteTrans64] 3410b57cec5SDimitry Andric 342e8d8bef9SDimitry Andriclet TRANS = 1, SchedRW = [WriteTrans32] in { 3430b57cec5SDimitry Andricdefm V_SIN_F32 : VOP1Inst <"v_sin_f32", VOP_F32_F32, AMDGPUsin>; 3440b57cec5SDimitry Andricdefm V_COS_F32 : VOP1Inst <"v_cos_f32", VOP_F32_F32, AMDGPUcos>; 345e8d8bef9SDimitry Andric} // End TRANS = 1, SchedRW = [WriteTrans32] 3460b57cec5SDimitry Andric 3470b57cec5SDimitry Andricdefm V_NOT_B32 : VOP1Inst <"v_not_b32", VOP_I32_I32>; 34881ad6265SDimitry Andricdefm V_BFREV_B32 : VOP1Inst <"v_bfrev_b32", VOP_I32_I32, DivergentUnaryFrag<bitreverse>>; 3498bcb0991SDimitry Andricdefm V_FFBH_U32 : VOP1Inst <"v_ffbh_u32", VOP_I32_I32, AMDGPUffbh_u32>; 3505ffd83dbSDimitry Andricdefm V_FFBL_B32 : VOP1Inst <"v_ffbl_b32", VOP_I32_I32, AMDGPUffbl_b32>; 3518bcb0991SDimitry Andricdefm V_FFBH_I32 : VOP1Inst <"v_ffbh_i32", VOP_I32_I32, AMDGPUffbh_i32>; 3520b57cec5SDimitry Andric 3530b57cec5SDimitry Andriclet SchedRW = [WriteDoubleAdd] in { 354fe6060f1SDimitry Andricdefm V_FREXP_EXP_I32_F64 : VOP1Inst <"v_frexp_exp_i32_f64", VOP_I32_F64_SPECIAL_OMOD, int_amdgcn_frexp_exp>; 3550b57cec5SDimitry Andricdefm V_FREXP_MANT_F64 : VOP1Inst <"v_frexp_mant_f64", VOP_F64_F64, int_amdgcn_frexp_mant>; 3560b57cec5SDimitry Andriclet FPDPRounding = 1 in { 3570b57cec5SDimitry Andricdefm V_FRACT_F64 : VOP1Inst <"v_fract_f64", VOP_F64_F64, AMDGPUfract>; 3580b57cec5SDimitry Andric} // End FPDPRounding = 1 3590b57cec5SDimitry Andric} // End SchedRW = [WriteDoubleAdd] 3600b57cec5SDimitry Andric 3610b57cec5SDimitry Andricdefm V_FREXP_EXP_I32_F32 : VOP1Inst <"v_frexp_exp_i32_f32", VOP_I32_F32, int_amdgcn_frexp_exp>; 3620b57cec5SDimitry Andricdefm V_FREXP_MANT_F32 : VOP1Inst <"v_frexp_mant_f32", VOP_F32_F32, int_amdgcn_frexp_mant>; 363fe6060f1SDimitry Andric} // End isReMaterializable = 1 3640b57cec5SDimitry Andric 3650b57cec5SDimitry Andricdefm V_CLREXCP : VOP1Inst <"v_clrexcp", VOP_NO_EXT<VOP_NONE>>; 3660b57cec5SDimitry Andric 3670b57cec5SDimitry Andric// Restrict src0 to be VGPR 368480093f4SDimitry Andricdef VOP_MOVRELS : VOPProfile<[i32, i32, untyped, untyped]> { 3690b57cec5SDimitry Andric let Src0RC32 = VRegSrc_32; 3700b57cec5SDimitry Andric let Src0RC64 = VRegSrc_32; 371*0fca6ea1SDimitry Andric let IsInvalidSingleUseConsumer = 1; 3720b57cec5SDimitry Andric} 3730b57cec5SDimitry Andric 3740b57cec5SDimitry Andric// Special case because there are no true output operands. Hack vdst 3750b57cec5SDimitry Andric// to be a src operand. The custom inserter must add a tied implicit 3760b57cec5SDimitry Andric// def and use of the super register since there seems to be no way to 3770b57cec5SDimitry Andric// add an implicit def of a virtual register in tablegen. 378480093f4SDimitry Andricclass VOP_MOVREL<RegisterOperand Src1RC> : VOPProfile<[untyped, i32, untyped, untyped]> { 3790b57cec5SDimitry Andric let Src0RC32 = VOPDstOperand<VGPR_32>; 3800b57cec5SDimitry Andric let Src0RC64 = VOPDstOperand<VGPR_32>; 3810b57cec5SDimitry Andric 3820b57cec5SDimitry Andric let Outs = (outs); 383480093f4SDimitry Andric let Ins32 = (ins Src0RC32:$vdst, Src1RC:$src0); 384480093f4SDimitry Andric let Ins64 = (ins Src0RC64:$vdst, Src1RC:$src0); 3850b57cec5SDimitry Andric let Asm32 = getAsm32<1, 1>.ret; 386480093f4SDimitry Andric 387480093f4SDimitry Andric let OutsSDWA = (outs Src0RC32:$vdst); 388480093f4SDimitry Andric let InsSDWA = (ins Src0ModSDWA:$src0_modifiers, Src0SDWA:$src0, 389*0fca6ea1SDimitry Andric Clamp:$clamp, dst_sel:$dst_sel, dst_unused:$dst_unused, 390480093f4SDimitry Andric src0_sel:$src0_sel); 3910b57cec5SDimitry Andric let AsmSDWA9 = getAsmSDWA9<1, 0, 1>.ret; 3920b57cec5SDimitry Andric 393480093f4SDimitry Andric let OutsDPP = (outs Src0RC32:$vdst); 394480093f4SDimitry Andric let InsDPP16 = (ins Src0RC32:$old, Src0RC32:$src0, 395*0fca6ea1SDimitry Andric dpp_ctrl:$dpp_ctrl, DppRowMask:$row_mask, 396*0fca6ea1SDimitry Andric DppBankMask:$bank_mask, DppBoundCtrl:$bound_ctrl, Dpp16FI:$fi); 397480093f4SDimitry Andric let AsmDPP16 = getAsmDPP16<1, 1, 0>.ret; 398*0fca6ea1SDimitry Andric let InsDPP8 = (ins Src0RC32:$old, Src0RC32:$src0, dpp8:$dpp8, Dpp8FI:$fi); 399480093f4SDimitry Andric let AsmDPP8 = getAsmDPP8<1, 1, 0>.ret; 4000b57cec5SDimitry Andric 401bdd1243dSDimitry Andric let OutsVOP3DPP = (outs Src0RC64:$vdst); 402bdd1243dSDimitry Andric let InsVOP3DPP = getInsVOP3DPP<InsVOP3Base, Src0RC64, NumSrcArgs>.ret; 403bdd1243dSDimitry Andric let InsVOP3DPP16 = getInsVOP3DPP16<InsVOP3Base, Src0RC64, NumSrcArgs>.ret; 404bdd1243dSDimitry Andric let InsVOP3DPP8 = getInsVOP3DPP8<InsVOP3Base, Src0RC64, NumSrcArgs>.ret; 405bdd1243dSDimitry Andric 406bdd1243dSDimitry Andric let AsmVOP3Base = 407bdd1243dSDimitry Andric getAsmVOP3Base<NumSrcArgs, 1 /* HasDst */, HasClamp, 408bdd1243dSDimitry Andric HasOpSel, HasOMod, IsVOP3P, HasModifiers, 409bdd1243dSDimitry Andric HasModifiers, HasModifiers, HasModifiers>.ret; 410bdd1243dSDimitry Andric 4110b57cec5SDimitry Andric let HasDst = 0; 4120b57cec5SDimitry Andric let EmitDst = 1; // force vdst emission 4130b57cec5SDimitry Andric} 4140b57cec5SDimitry Andric 415*0fca6ea1SDimitry Andriclet IsInvalidSingleUseProducer = 1 in { 416480093f4SDimitry Andric def VOP_MOVRELD : VOP_MOVREL<VSrc_b32>; 417*0fca6ea1SDimitry Andric def VOP_MOVRELSD : VOP_MOVREL<VRegSrc_32> { 418*0fca6ea1SDimitry Andric let IsInvalidSingleUseConsumer = 1; 419*0fca6ea1SDimitry Andric } 420*0fca6ea1SDimitry Andric} 421480093f4SDimitry Andric 4220b57cec5SDimitry Andriclet SubtargetPredicate = HasMovrel, Uses = [M0, EXEC] in { 4230b57cec5SDimitry Andric // v_movreld_b32 is a special case because the destination output 4240b57cec5SDimitry Andric // register is really a source. It isn't actually read (but may be 4250b57cec5SDimitry Andric // written), and is only to provide the base register to start 4260b57cec5SDimitry Andric // indexing from. Tablegen seems to not let you define an implicit 4270b57cec5SDimitry Andric // virtual register output for the super register being written into, 4280b57cec5SDimitry Andric // so this must have an implicit def of the register added to it. 4290b57cec5SDimitry Andricdefm V_MOVRELD_B32 : VOP1Inst <"v_movreld_b32", VOP_MOVRELD>; 430480093f4SDimitry Andricdefm V_MOVRELS_B32 : VOP1Inst <"v_movrels_b32", VOP_MOVRELS>; 431480093f4SDimitry Andricdefm V_MOVRELSD_B32 : VOP1Inst <"v_movrelsd_b32", VOP_MOVRELSD>; 4320b57cec5SDimitry Andric} // End Uses = [M0, EXEC] 4330b57cec5SDimitry Andric 434fe6060f1SDimitry Andriclet isReMaterializable = 1 in { 4350b57cec5SDimitry Andriclet SubtargetPredicate = isGFX6GFX7 in { 436e8d8bef9SDimitry Andric let TRANS = 1, SchedRW = [WriteTrans32] in { 4370b57cec5SDimitry Andric defm V_LOG_CLAMP_F32 : 4380b57cec5SDimitry Andric VOP1Inst<"v_log_clamp_f32", VOP_F32_F32, int_amdgcn_log_clamp>; 4390b57cec5SDimitry Andric defm V_RCP_CLAMP_F32 : 4400b57cec5SDimitry Andric VOP1Inst<"v_rcp_clamp_f32", VOP_F32_F32>; 4410b57cec5SDimitry Andric defm V_RCP_LEGACY_F32 : 4420b57cec5SDimitry Andric VOP1Inst<"v_rcp_legacy_f32", VOP_F32_F32, AMDGPUrcp_legacy>; 4430b57cec5SDimitry Andric defm V_RSQ_CLAMP_F32 : 4440b57cec5SDimitry Andric VOP1Inst<"v_rsq_clamp_f32", VOP_F32_F32, AMDGPUrsq_clamp>; 4450b57cec5SDimitry Andric defm V_RSQ_LEGACY_F32 : 4465ffd83dbSDimitry Andric VOP1Inst<"v_rsq_legacy_f32", VOP_F32_F32, int_amdgcn_rsq_legacy>; 447e8d8bef9SDimitry Andric } // End TRANS = 1, SchedRW = [WriteTrans32] 4480b57cec5SDimitry Andric 449fe6060f1SDimitry Andric let SchedRW = [WriteTrans64] in { 4500b57cec5SDimitry Andric defm V_RCP_CLAMP_F64 : 4510b57cec5SDimitry Andric VOP1Inst<"v_rcp_clamp_f64", VOP_F64_F64>; 4520b57cec5SDimitry Andric defm V_RSQ_CLAMP_F64 : 4530b57cec5SDimitry Andric VOP1Inst<"v_rsq_clamp_f64", VOP_F64_F64, AMDGPUrsq_clamp>; 454fe6060f1SDimitry Andric } // End SchedRW = [WriteTrans64] 4550b57cec5SDimitry Andric} // End SubtargetPredicate = isGFX6GFX7 4560b57cec5SDimitry Andric 4570b57cec5SDimitry Andriclet SubtargetPredicate = isGFX7GFX8GFX9 in { 458e8d8bef9SDimitry Andric let TRANS = 1, SchedRW = [WriteTrans32] in { 4590b57cec5SDimitry Andric defm V_LOG_LEGACY_F32 : VOP1Inst<"v_log_legacy_f32", VOP_F32_F32>; 4600b57cec5SDimitry Andric defm V_EXP_LEGACY_F32 : VOP1Inst<"v_exp_legacy_f32", VOP_F32_F32>; 461e8d8bef9SDimitry Andric } // End TRANS = 1, SchedRW = [WriteTrans32] 4620b57cec5SDimitry Andric} // End SubtargetPredicate = isGFX7GFX8GFX9 4630b57cec5SDimitry Andric 4640b57cec5SDimitry Andriclet SubtargetPredicate = isGFX7Plus in { 4650b57cec5SDimitry Andric let SchedRW = [WriteDoubleAdd] in { 4660b57cec5SDimitry Andric defm V_TRUNC_F64 : VOP1Inst<"v_trunc_f64", VOP_F64_F64, ftrunc>; 4670b57cec5SDimitry Andric defm V_CEIL_F64 : VOP1Inst<"v_ceil_f64", VOP_F64_F64, fceil>; 4685f757f3fSDimitry Andric defm V_RNDNE_F64 : VOP1Inst<"v_rndne_f64", VOP_F64_F64, froundeven>; 4690b57cec5SDimitry Andric defm V_FLOOR_F64 : VOP1Inst<"v_floor_f64", VOP_F64_F64, ffloor>; 4700b57cec5SDimitry Andric } // End SchedRW = [WriteDoubleAdd] 4710b57cec5SDimitry Andric} // End SubtargetPredicate = isGFX7Plus 472fe6060f1SDimitry Andric} // End isReMaterializable = 1 4730b57cec5SDimitry Andric 4740b57cec5SDimitry Andriclet FPDPRounding = 1 in { 475bdd1243dSDimitry Andriclet OtherPredicates = [Has16BitInsts, NotHasTrue16BitInsts] in { 4760b57cec5SDimitry Andricdefm V_CVT_F16_U16 : VOP1Inst <"v_cvt_f16_u16", VOP1_F16_I16, uint_to_fp>; 4770b57cec5SDimitry Andricdefm V_CVT_F16_I16 : VOP1Inst <"v_cvt_f16_i16", VOP1_F16_I16, sint_to_fp>; 478bdd1243dSDimitry Andric} 479bdd1243dSDimitry Andriclet OtherPredicates = [HasTrue16BitInsts] in { 480bdd1243dSDimitry Andricdefm V_CVT_F16_U16_t16 : VOP1Inst <"v_cvt_f16_u16_t16", VOP1_F16_I16_t16, uint_to_fp>; 481bdd1243dSDimitry Andricdefm V_CVT_F16_I16_t16 : VOP1Inst <"v_cvt_f16_i16_t16", VOP1_F16_I16_t16, sint_to_fp>; 482bdd1243dSDimitry Andric} 4830b57cec5SDimitry Andric} // End FPDPRounding = 1 484fe6060f1SDimitry Andric// OMod clears exceptions when set in these two instructions 485bdd1243dSDimitry Andriclet OtherPredicates = [Has16BitInsts, NotHasTrue16BitInsts] in { 486fe6060f1SDimitry Andricdefm V_CVT_U16_F16 : VOP1Inst <"v_cvt_u16_f16", VOP_I16_F16_SPECIAL_OMOD, fp_to_uint>; 487fe6060f1SDimitry Andricdefm V_CVT_I16_F16 : VOP1Inst <"v_cvt_i16_f16", VOP_I16_F16_SPECIAL_OMOD, fp_to_sint>; 488bdd1243dSDimitry Andric} 489bdd1243dSDimitry Andriclet OtherPredicates = [HasTrue16BitInsts] in { 490bdd1243dSDimitry Andricdefm V_CVT_U16_F16_t16 : VOP1Inst <"v_cvt_u16_f16_t16", VOP_I16_F16_SPECIAL_OMOD_t16, fp_to_uint>; 491bdd1243dSDimitry Andricdefm V_CVT_I16_F16_t16 : VOP1Inst <"v_cvt_i16_f16_t16", VOP_I16_F16_SPECIAL_OMOD_t16, fp_to_sint>; 492bdd1243dSDimitry Andric} 493e8d8bef9SDimitry Andriclet TRANS = 1, SchedRW = [WriteTrans32] in { 494bdd1243dSDimitry Andricdefm V_RCP_F16 : VOP1Inst_t16 <"v_rcp_f16", VOP_F16_F16, AMDGPUrcp>; 495bdd1243dSDimitry Andricdefm V_SQRT_F16 : VOP1Inst_t16 <"v_sqrt_f16", VOP_F16_F16, any_amdgcn_sqrt>; 496bdd1243dSDimitry Andricdefm V_RSQ_F16 : VOP1Inst_t16 <"v_rsq_f16", VOP_F16_F16, AMDGPUrsq>; 49706c3fb27SDimitry Andricdefm V_LOG_F16 : VOP1Inst_t16 <"v_log_f16", VOP_F16_F16, AMDGPUlogf16>; 49806c3fb27SDimitry Andricdefm V_EXP_F16 : VOP1Inst_t16 <"v_exp_f16", VOP_F16_F16, AMDGPUexpf16>; 499bdd1243dSDimitry Andricdefm V_SIN_F16 : VOP1Inst_t16 <"v_sin_f16", VOP_F16_F16, AMDGPUsin>; 500bdd1243dSDimitry Andricdefm V_COS_F16 : VOP1Inst_t16 <"v_cos_f16", VOP_F16_F16, AMDGPUcos>; 501e8d8bef9SDimitry Andric} // End TRANS = 1, SchedRW = [WriteTrans32] 502bdd1243dSDimitry Andricdefm V_FREXP_MANT_F16 : VOP1Inst_t16 <"v_frexp_mant_f16", VOP_F16_F16, int_amdgcn_frexp_mant>; 503bdd1243dSDimitry Andriclet OtherPredicates = [Has16BitInsts, NotHasTrue16BitInsts] in { 504fe6060f1SDimitry Andricdefm V_FREXP_EXP_I16_F16 : VOP1Inst <"v_frexp_exp_i16_f16", VOP_I16_F16_SPECIAL_OMOD, int_amdgcn_frexp_exp>; 505bdd1243dSDimitry Andric} 506bdd1243dSDimitry Andriclet OtherPredicates = [HasTrue16BitInsts] in { 507bdd1243dSDimitry Andricdefm V_FREXP_EXP_I16_F16_t16 : VOP1Inst <"v_frexp_exp_i16_f16_t16", VOP_I16_F16_SPECIAL_OMOD_t16, int_amdgcn_frexp_exp>; 508bdd1243dSDimitry Andric} 509bdd1243dSDimitry Andricdefm V_FLOOR_F16 : VOP1Inst_t16 <"v_floor_f16", VOP_F16_F16, ffloor>; 510bdd1243dSDimitry Andricdefm V_CEIL_F16 : VOP1Inst_t16 <"v_ceil_f16", VOP_F16_F16, fceil>; 511bdd1243dSDimitry Andricdefm V_TRUNC_F16 : VOP1Inst_t16 <"v_trunc_f16", VOP_F16_F16, ftrunc>; 5125f757f3fSDimitry Andricdefm V_RNDNE_F16 : VOP1Inst_t16 <"v_rndne_f16", VOP_F16_F16, froundeven>; 5130b57cec5SDimitry Andriclet FPDPRounding = 1 in { 514bdd1243dSDimitry Andricdefm V_FRACT_F16 : VOP1Inst_t16 <"v_fract_f16", VOP_F16_F16, AMDGPUfract>; 5150b57cec5SDimitry Andric} // End FPDPRounding = 1 5160b57cec5SDimitry Andric 517bdd1243dSDimitry Andriclet OtherPredicates = [Has16BitInsts, NotHasTrue16BitInsts] in { 5180b57cec5SDimitry Andricdef : GCNPat< 5190b57cec5SDimitry Andric (f32 (f16_to_fp i16:$src)), 5200b57cec5SDimitry Andric (V_CVT_F32_F16_e32 $src) 5210b57cec5SDimitry Andric>; 5220b57cec5SDimitry Andricdef : GCNPat< 5230b57cec5SDimitry Andric (i16 (AMDGPUfp_to_f16 f32:$src)), 5240b57cec5SDimitry Andric (V_CVT_F16_F32_e32 $src) 5250b57cec5SDimitry Andric>; 526bdd1243dSDimitry Andric} 527bdd1243dSDimitry Andriclet OtherPredicates = [HasTrue16BitInsts] in { 528bdd1243dSDimitry Andricdef : GCNPat< 529bdd1243dSDimitry Andric (f32 (f16_to_fp i16:$src)), 530bdd1243dSDimitry Andric (V_CVT_F32_F16_t16_e32 $src) 531bdd1243dSDimitry Andric>; 532bdd1243dSDimitry Andricdef : GCNPat< 533bdd1243dSDimitry Andric (i16 (AMDGPUfp_to_f16 f32:$src)), 534bdd1243dSDimitry Andric (V_CVT_F16_F32_t16_e32 $src) 535bdd1243dSDimitry Andric>; 5360b57cec5SDimitry Andric} 5370b57cec5SDimitry Andric 53806c3fb27SDimitry Andricdef VOP_SWAP_I32 : VOPProfile<[i32, i32, untyped, untyped]> { 53906c3fb27SDimitry Andric let Outs32 = (outs VGPR_32:$vdst, VRegSrc_32:$vdst1); 54006c3fb27SDimitry Andric let Ins32 = (ins VRegSrc_32:$src0, VGPR_32:$src1); 5410b57cec5SDimitry Andric let Asm32 = " $vdst, $src0"; 5420b57cec5SDimitry Andric} 5430b57cec5SDimitry Andric 5440b57cec5SDimitry Andriclet SubtargetPredicate = isGFX9Plus in { 5450b57cec5SDimitry Andric def V_SWAP_B32 : VOP1_Pseudo<"v_swap_b32", VOP_SWAP_I32, [], 1> { 5460b57cec5SDimitry Andric let Constraints = "$vdst = $src1, $vdst1 = $src0"; 5470b57cec5SDimitry Andric let DisableEncoding = "$vdst1,$src1"; 5480b57cec5SDimitry Andric let SchedRW = [Write64Bit, Write64Bit]; 549*0fca6ea1SDimitry Andric let IsInvalidSingleUseConsumer = 1; 5500b57cec5SDimitry Andric } 5510b57cec5SDimitry Andric 552fe6060f1SDimitry Andric let isReMaterializable = 1 in 553bdd1243dSDimitry Andric defm V_SAT_PK_U8_I16 : VOP1Inst_t16<"v_sat_pk_u8_i16", VOP_I16_I32>; 5545ffd83dbSDimitry Andric 5555ffd83dbSDimitry Andric let mayRaiseFPException = 0 in { 556bdd1243dSDimitry Andric let OtherPredicates = [Has16BitInsts, NotHasTrue16BitInsts] in { 557fe6060f1SDimitry Andric defm V_CVT_NORM_I16_F16 : VOP1Inst<"v_cvt_norm_i16_f16", VOP_I16_F16_SPECIAL_OMOD>; 558fe6060f1SDimitry Andric defm V_CVT_NORM_U16_F16 : VOP1Inst<"v_cvt_norm_u16_f16", VOP_I16_F16_SPECIAL_OMOD>; 559bdd1243dSDimitry Andric } 560bdd1243dSDimitry Andric let OtherPredicates = [HasTrue16BitInsts] in { 561bdd1243dSDimitry Andric defm V_CVT_NORM_I16_F16_t16 : VOP1Inst<"v_cvt_norm_i16_f16_t16", VOP_I16_F16_SPECIAL_OMOD_t16>; 562bdd1243dSDimitry Andric defm V_CVT_NORM_U16_F16_t16 : VOP1Inst<"v_cvt_norm_u16_f16_t16", VOP_I16_F16_SPECIAL_OMOD_t16>; 563bdd1243dSDimitry Andric } 5645ffd83dbSDimitry Andric } // End mayRaiseFPException = 0 5650b57cec5SDimitry Andric} // End SubtargetPredicate = isGFX9Plus 5660b57cec5SDimitry Andric 5670b57cec5SDimitry Andriclet SubtargetPredicate = isGFX9Only in { 5680b57cec5SDimitry Andric defm V_SCREEN_PARTITION_4SE_B32 : VOP1Inst <"v_screen_partition_4se_b32", VOP_I32_I32>; 5690b57cec5SDimitry Andric} // End SubtargetPredicate = isGFX9Only 5700b57cec5SDimitry Andric 571fcaf7f86SDimitry Andricclass VOPProfile_Base_CVT_F32_F8<ValueType vt> : VOPProfileI2F <vt, i32> { 572b3edf446SDimitry Andric let HasExtDPP = 1; 573fcaf7f86SDimitry Andric let HasExtSDWA = 1; 574fcaf7f86SDimitry Andric let HasExtSDWA9 = 1; 575fcaf7f86SDimitry Andric let HasExt = 1; 576fcaf7f86SDimitry Andric let DstRCSDWA = getVALUDstForVT<vt>.ret; 577fcaf7f86SDimitry Andric let InsSDWA = (ins Bin32SDWAInputMods:$src0_modifiers, Src0SDWA:$src0, 578*0fca6ea1SDimitry Andric Clamp:$clamp, omod:$omod, src0_sel:$src0_sel); 579fcaf7f86SDimitry Andric let AsmSDWA = "$vdst, $src0_modifiers$clamp$omod $src0_sel"; // No dst_sel 580fcaf7f86SDimitry Andric let AsmSDWA9 = AsmSDWA; 581fcaf7f86SDimitry Andric let EmitDstSel = 0; 582fcaf7f86SDimitry Andric} 583fcaf7f86SDimitry Andric 584fcaf7f86SDimitry Andricdef VOPProfileCVT_F32_F8 : VOPProfile_Base_CVT_F32_F8 <f32>; 585fcaf7f86SDimitry Andricdef VOPProfileCVT_PK_F32_F8 : VOPProfile_Base_CVT_F32_F8 <v2f32>; 586fcaf7f86SDimitry Andric 587*0fca6ea1SDimitry Andriclet OtherPredicates = [HasFP8ConversionInsts], mayRaiseFPException = 0, 588fcaf7f86SDimitry Andric SchedRW = [WriteFloatCvt] in { 589fcaf7f86SDimitry Andric defm V_CVT_F32_FP8 : VOP1Inst<"v_cvt_f32_fp8", VOPProfileCVT_F32_F8>; 590fcaf7f86SDimitry Andric defm V_CVT_F32_BF8 : VOP1Inst<"v_cvt_f32_bf8", VOPProfileCVT_F32_F8>; 591fcaf7f86SDimitry Andric defm V_CVT_PK_F32_FP8 : VOP1Inst<"v_cvt_pk_f32_fp8", VOPProfileCVT_PK_F32_F8>; 592fcaf7f86SDimitry Andric defm V_CVT_PK_F32_BF8 : VOP1Inst<"v_cvt_pk_f32_bf8", VOPProfileCVT_PK_F32_F8>; 593fcaf7f86SDimitry Andric} 594fcaf7f86SDimitry Andric 595fcaf7f86SDimitry Andricclass Cvt_F32_F8_Pat<SDPatternOperator node, int index, 5965f757f3fSDimitry Andric VOP1_SDWA_Pseudo inst_sdwa> : GCNPat< 597fcaf7f86SDimitry Andric (f32 (node i32:$src, index)), 5985f757f3fSDimitry Andric (inst_sdwa 0, $src, 0, 0, index) 599fcaf7f86SDimitry Andric>; 600fcaf7f86SDimitry Andric 601b3edf446SDimitry Andriclet SubtargetPredicate = isGFX9Only in { 6025f757f3fSDimitry Andriclet OtherPredicates = [HasCvtFP8VOP1Bug] in { 6035f757f3fSDimitry Andric def : GCNPat<(f32 (int_amdgcn_cvt_f32_fp8 i32:$src, 0)), 6045f757f3fSDimitry Andric (V_CVT_F32_FP8_sdwa 0, $src, 0, 0, 0)>; 6055f757f3fSDimitry Andric def : GCNPat<(f32 (int_amdgcn_cvt_f32_bf8 i32:$src, 0)), 6065f757f3fSDimitry Andric (V_CVT_F32_BF8_sdwa 0, $src, 0, 0, 0)>; 6075f757f3fSDimitry Andric} 6085f757f3fSDimitry Andric 6095f757f3fSDimitry Andriclet OtherPredicates = [HasNoCvtFP8VOP1Bug] in { 6105f757f3fSDimitry Andric def : GCNPat<(f32 (int_amdgcn_cvt_f32_fp8 i32:$src, 0)), 6115f757f3fSDimitry Andric (V_CVT_F32_FP8_e32 $src)>; 6125f757f3fSDimitry Andric def : GCNPat<(f32 (int_amdgcn_cvt_f32_bf8 i32:$src, 0)), 6135f757f3fSDimitry Andric (V_CVT_F32_BF8_e32 $src)>; 6145f757f3fSDimitry Andric} 6155f757f3fSDimitry Andric 6165f757f3fSDimitry Andricforeach Index = [1, 2, 3] in { 6175f757f3fSDimitry Andric def : Cvt_F32_F8_Pat<int_amdgcn_cvt_f32_fp8, Index, V_CVT_F32_FP8_sdwa>; 6185f757f3fSDimitry Andric def : Cvt_F32_F8_Pat<int_amdgcn_cvt_f32_bf8, Index, V_CVT_F32_BF8_sdwa>; 619fcaf7f86SDimitry Andric} 620b3edf446SDimitry Andric} // End SubtargetPredicate = isGFX9Only 621fcaf7f86SDimitry Andric 622fcaf7f86SDimitry Andricclass Cvt_PK_F32_F8_Pat<SDPatternOperator node, int index, 623fcaf7f86SDimitry Andric VOP1_Pseudo inst_e32, VOP1_SDWA_Pseudo inst_sdwa> : GCNPat< 624fcaf7f86SDimitry Andric (v2f32 (node i32:$src, index)), 625fcaf7f86SDimitry Andric !if (index, 626fcaf7f86SDimitry Andric (inst_sdwa 0, $src, 0, 0, SDWA.WORD_1), 627fcaf7f86SDimitry Andric (inst_e32 $src)) 628fcaf7f86SDimitry Andric>; 629fcaf7f86SDimitry Andric 630b3edf446SDimitry Andriclet SubtargetPredicate = isGFX9Only in { 631fcaf7f86SDimitry Andric foreach Index = [0, -1] in { 632fcaf7f86SDimitry Andric def : Cvt_PK_F32_F8_Pat<int_amdgcn_cvt_pk_f32_fp8, Index, 633fcaf7f86SDimitry Andric V_CVT_PK_F32_FP8_e32, V_CVT_PK_F32_FP8_sdwa>; 634fcaf7f86SDimitry Andric def : Cvt_PK_F32_F8_Pat<int_amdgcn_cvt_pk_f32_bf8, Index, 635fcaf7f86SDimitry Andric V_CVT_PK_F32_BF8_e32, V_CVT_PK_F32_BF8_sdwa>; 636fcaf7f86SDimitry Andric } 637b3edf446SDimitry Andric} 638b3edf446SDimitry Andric 639b3edf446SDimitry Andric 640b3edf446SDimitry Andric// Similar to VOPProfile_Base_CVT_F32_F8, but for VOP3 instructions. 641b3edf446SDimitry Andricdef VOPProfile_Base_CVT_PK_F32_F8_OpSel : VOPProfileI2F <v2f32, i32> { 642b3edf446SDimitry Andric let HasOpSel = 1; 643b3edf446SDimitry Andric let HasExtVOP3DPP = 0; 644b3edf446SDimitry Andric} 645b3edf446SDimitry Andric 646*0fca6ea1SDimitry Andricclass VOPProfile_Base_CVT_F_F8_ByteSel<ValueType DstVT> : VOPProfile<[DstVT, i32, untyped, untyped]> { 647*0fca6ea1SDimitry Andric let IsFP8SrcByteSel = 1; 648*0fca6ea1SDimitry Andric let HasOpSel = 0; 649b3edf446SDimitry Andric let HasExtDPP = 1; 650b3edf446SDimitry Andric let HasExtVOP3DPP = 1; 651*0fca6ea1SDimitry Andric let HasExtSDWA = 0; 652b3edf446SDimitry Andric let HasClamp = 0; 653b3edf446SDimitry Andric let HasOMod = 0; 654*0fca6ea1SDimitry Andric let HasModifiers = 0; 655*0fca6ea1SDimitry Andric 656*0fca6ea1SDimitry Andric defvar bytesel = (ins ByteSel:$byte_sel); 657*0fca6ea1SDimitry Andric let Ins64 = !con(getIns64<Src0RC64, Src1RC64, Src2RC64, NumSrcArgs, 658*0fca6ea1SDimitry Andric HasClamp, HasModifiers, HasSrc2Mods, 659*0fca6ea1SDimitry Andric HasOMod, Src0Mod, Src1Mod, Src2Mod>.ret, 660*0fca6ea1SDimitry Andric bytesel); 661*0fca6ea1SDimitry Andric let InsVOP3Base = !con(getInsVOP3Base<Src0VOP3DPP, Src1VOP3DPP, Src2VOP3DPP, 662*0fca6ea1SDimitry Andric NumSrcArgs, HasClamp, HasModifiers, HasSrc2Mods, 663*0fca6ea1SDimitry Andric HasOMod, Src0ModVOP3DPP, Src1ModVOP3DPP, 664*0fca6ea1SDimitry Andric Src2ModVOP3DPP, HasOpSel>.ret, 665*0fca6ea1SDimitry Andric bytesel); 666b3edf446SDimitry Andric} 667b3edf446SDimitry Andric 668*0fca6ea1SDimitry Andriclet SubtargetPredicate = isGFX12Plus, OtherPredicates = [HasFP8ConversionInsts], 669*0fca6ea1SDimitry Andric mayRaiseFPException = 0, SchedRW = [WriteFloatCvt] in { 670*0fca6ea1SDimitry Andric defm V_CVT_F32_FP8_OP_SEL : VOP1Inst<"v_cvt_f32_fp8_op_sel", VOPProfile_Base_CVT_F_F8_ByteSel<f32>>; 671*0fca6ea1SDimitry Andric defm V_CVT_F32_BF8_OP_SEL : VOP1Inst<"v_cvt_f32_bf8_op_sel", VOPProfile_Base_CVT_F_F8_ByteSel<f32>>; 672b3edf446SDimitry Andric defm V_CVT_PK_F32_FP8_OP_SEL : VOP1Inst<"v_cvt_pk_f32_fp8_op_sel", VOPProfile_Base_CVT_PK_F32_F8_OpSel>; 673b3edf446SDimitry Andric defm V_CVT_PK_F32_BF8_OP_SEL : VOP1Inst<"v_cvt_pk_f32_bf8_op_sel", VOPProfile_Base_CVT_PK_F32_F8_OpSel>; 674b3edf446SDimitry Andric} 675b3edf446SDimitry Andric 676*0fca6ea1SDimitry Andricclass Cvt_F_F8_Pat_ByteSel<SDPatternOperator node, VOP3_Pseudo inst> : GCNPat< 677*0fca6ea1SDimitry Andric (node i32:$src0, timm:$byte_sel), 678*0fca6ea1SDimitry Andric (inst $src0, (as_i32timm $byte_sel)) 679b3edf446SDimitry Andric>; 680b3edf446SDimitry Andric 681*0fca6ea1SDimitry Andriclet SubtargetPredicate = isGFX12Plus, OtherPredicates = [HasFP8ConversionInsts] in { 682*0fca6ea1SDimitry Andric def : Cvt_F_F8_Pat_ByteSel<int_amdgcn_cvt_f32_fp8, V_CVT_F32_FP8_OP_SEL_e64>; 683*0fca6ea1SDimitry Andric def : Cvt_F_F8_Pat_ByteSel<int_amdgcn_cvt_f32_bf8, V_CVT_F32_BF8_OP_SEL_e64>; 684b3edf446SDimitry Andric} 685b3edf446SDimitry Andric 686b3edf446SDimitry Andricclass Cvt_PK_F32_F8_Pat_OpSel<SDPatternOperator node, int index, 687b3edf446SDimitry Andric VOP1_Pseudo inst_e32, VOP3_Pseudo inst_e64> : GCNPat< 688b3edf446SDimitry Andric (v2f32 (node i32:$src, index)), 689b3edf446SDimitry Andric !if (index, 690b3edf446SDimitry Andric (inst_e64 SRCMODS.OP_SEL_0, $src, 0, 0, SRCMODS.NONE), 691b3edf446SDimitry Andric (inst_e32 $src)) 692b3edf446SDimitry Andric>; 693b3edf446SDimitry Andric 694*0fca6ea1SDimitry Andriclet SubtargetPredicate = isGFX12Plus, OtherPredicates = [HasFP8ConversionInsts] in { 695b3edf446SDimitry Andric foreach Index = [0, -1] in { 696b3edf446SDimitry Andric def : Cvt_PK_F32_F8_Pat_OpSel<int_amdgcn_cvt_pk_f32_fp8, Index, 697b3edf446SDimitry Andric V_CVT_PK_F32_FP8_e32, V_CVT_PK_F32_FP8_OP_SEL_e64>; 698b3edf446SDimitry Andric def : Cvt_PK_F32_F8_Pat_OpSel<int_amdgcn_cvt_pk_f32_bf8, Index, 699b3edf446SDimitry Andric V_CVT_PK_F32_BF8_e32, V_CVT_PK_F32_BF8_OP_SEL_e64>; 700b3edf446SDimitry Andric } 701b3edf446SDimitry Andric} 702fcaf7f86SDimitry Andric 7030b57cec5SDimitry Andriclet SubtargetPredicate = isGFX10Plus in { 70481ad6265SDimitry Andric defm V_PIPEFLUSH : VOP1Inst<"v_pipeflush", VOP_NO_EXT<VOP_NONE>>; 7050b57cec5SDimitry Andric 7060b57cec5SDimitry Andric let Uses = [M0] in { 7070b57cec5SDimitry Andric defm V_MOVRELSD_2_B32 : 708480093f4SDimitry Andric VOP1Inst<"v_movrelsd_2_b32", VOP_MOVRELSD>; 7090b57cec5SDimitry Andric 7100b57cec5SDimitry Andric def V_SWAPREL_B32 : VOP1_Pseudo<"v_swaprel_b32", VOP_SWAP_I32, [], 1> { 7110b57cec5SDimitry Andric let Constraints = "$vdst = $src1, $vdst1 = $src0"; 7120b57cec5SDimitry Andric let DisableEncoding = "$vdst1,$src1"; 7130b57cec5SDimitry Andric let SchedRW = [Write64Bit, Write64Bit]; 714*0fca6ea1SDimitry Andric let IsInvalidSingleUseConsumer = 1; 715*0fca6ea1SDimitry Andric let IsInvalidSingleUseProducer = 1; 7160b57cec5SDimitry Andric } 7170b57cec5SDimitry Andric } // End Uses = [M0] 7180b57cec5SDimitry Andric} // End SubtargetPredicate = isGFX10Plus 7190b57cec5SDimitry Andric 720fe6060f1SDimitry Andricdef VOPProfileAccMov : VOP_NO_EXT<VOP_I32_I32> { 721fe6060f1SDimitry Andric let DstRC = RegisterOperand<AGPR_32>; 72206c3fb27SDimitry Andric let Src0RC32 = ARegSrc_32; 723fe6060f1SDimitry Andric let Asm32 = " $vdst, $src0"; 724fe6060f1SDimitry Andric} 725fe6060f1SDimitry Andric 726fe6060f1SDimitry Andricdef V_ACCVGPR_MOV_B32 : VOP1_Pseudo<"v_accvgpr_mov_b32", VOPProfileAccMov, [], 1> { 727fe6060f1SDimitry Andric let SubtargetPredicate = isGFX90APlus; 728fe6060f1SDimitry Andric let isReMaterializable = 1; 729fe6060f1SDimitry Andric let isAsCheapAsAMove = 1; 730fe6060f1SDimitry Andric} 731fe6060f1SDimitry Andric 73281ad6265SDimitry Andriclet SubtargetPredicate = isGFX11Plus in { 73381ad6265SDimitry Andric // Restrict src0 to be VGPR 73481ad6265SDimitry Andric def V_PERMLANE64_B32 : VOP1_Pseudo<"v_permlane64_b32", VOP_MOVRELS, 735*0fca6ea1SDimitry Andric [], /*VOP1Only=*/ 1> { 736*0fca6ea1SDimitry Andric let IsInvalidSingleUseConsumer = 1; 737*0fca6ea1SDimitry Andric let IsInvalidSingleUseProducer = 1; 738*0fca6ea1SDimitry Andric } 7395f757f3fSDimitry Andric defm V_MOV_B16_t16 : VOP1Inst<"v_mov_b16_t16", VOPProfile_True16<VOP_I16_I16>>; 740bdd1243dSDimitry Andric defm V_NOT_B16 : VOP1Inst_t16<"v_not_b16", VOP_I16_I16>; 741bdd1243dSDimitry Andric defm V_CVT_I32_I16 : VOP1Inst_t16<"v_cvt_i32_i16", VOP_I32_I16>; 742bdd1243dSDimitry Andric defm V_CVT_U32_U16 : VOP1Inst_t16<"v_cvt_u32_u16", VOP_I32_I16>; 74381ad6265SDimitry Andric} // End SubtargetPredicate = isGFX11Plus 74481ad6265SDimitry Andric 745*0fca6ea1SDimitry Andricforeach vt = Reg32Types.types in { 746*0fca6ea1SDimitry Andric def : GCNPat<(int_amdgcn_permlane64 (vt VRegSrc_32:$src0)), 747*0fca6ea1SDimitry Andric (vt (V_PERMLANE64_B32 (vt VRegSrc_32:$src0))) 748*0fca6ea1SDimitry Andric >; 749*0fca6ea1SDimitry Andric} 750*0fca6ea1SDimitry Andric 7510b57cec5SDimitry Andric//===----------------------------------------------------------------------===// 7520b57cec5SDimitry Andric// Target-specific instruction encodings. 7530b57cec5SDimitry Andric//===----------------------------------------------------------------------===// 7540b57cec5SDimitry Andric 7558bcb0991SDimitry Andricclass VOP1_DPP<bits<8> op, VOP1_DPP_Pseudo ps, VOPProfile p = ps.Pfl, bit isDPP16 = 0> : 7560b57cec5SDimitry Andric VOP_DPP<ps.OpName, p, isDPP16> { 7570b57cec5SDimitry Andric let hasSideEffects = ps.hasSideEffects; 7580b57cec5SDimitry Andric let Defs = ps.Defs; 7590b57cec5SDimitry Andric let SchedRW = ps.SchedRW; 7600b57cec5SDimitry Andric let Uses = ps.Uses; 761fe6060f1SDimitry Andric let TRANS = ps.TRANS; 762*0fca6ea1SDimitry Andric let SubtargetPredicate = ps.SubtargetPredicate; 763297eecfbSDimitry Andric let OtherPredicates = ps.OtherPredicates; 7640b57cec5SDimitry Andric 7650b57cec5SDimitry Andric bits<8> vdst; 7660b57cec5SDimitry Andric let Inst{8-0} = 0xfa; 7670b57cec5SDimitry Andric let Inst{16-9} = op; 7680b57cec5SDimitry Andric let Inst{24-17} = !if(p.EmitDst, vdst{7-0}, 0); 7690b57cec5SDimitry Andric let Inst{31-25} = 0x3f; 7700b57cec5SDimitry Andric} 7710b57cec5SDimitry Andric 77281ad6265SDimitry Andricclass VOP1_DPP16<bits<8> op, VOP1_DPP_Pseudo ps, int subtarget, VOPProfile p = ps.Pfl> : 7738bcb0991SDimitry Andric VOP1_DPP<op, ps, p, 1>, 77481ad6265SDimitry Andric SIMCInstr <ps.PseudoInstr, subtarget> { 7755ffd83dbSDimitry Andric let AssemblerPredicate = HasDPP16; 7760b57cec5SDimitry Andric} 7770b57cec5SDimitry Andric 7785f757f3fSDimitry Andricclass VOP1_DPP16_Gen<bits<8> op, VOP1_DPP_Pseudo ps, GFXGen Gen, VOPProfile p = ps.Pfl> : 7795f757f3fSDimitry Andric VOP1_DPP16 <op, ps, Gen.Subtarget, p> { 7805f757f3fSDimitry Andric let AssemblerPredicate = Gen.AssemblerPredicate; 781*0fca6ea1SDimitry Andric let DecoderNamespace = Gen.DecoderNamespace; 7825f757f3fSDimitry Andric} 7835f757f3fSDimitry Andric 7840b57cec5SDimitry Andricclass VOP1_DPP8<bits<8> op, VOP1_Pseudo ps, VOPProfile p = ps.Pfl> : 7850b57cec5SDimitry Andric VOP_DPP8<ps.OpName, p> { 7860b57cec5SDimitry Andric let hasSideEffects = ps.hasSideEffects; 7870b57cec5SDimitry Andric let Defs = ps.Defs; 7880b57cec5SDimitry Andric let SchedRW = ps.SchedRW; 7890b57cec5SDimitry Andric let Uses = ps.Uses; 790*0fca6ea1SDimitry Andric let SubtargetPredicate = ps.SubtargetPredicate; 791297eecfbSDimitry Andric let OtherPredicates = ps.OtherPredicates; 7920b57cec5SDimitry Andric 7930b57cec5SDimitry Andric bits<8> vdst; 7940b57cec5SDimitry Andric let Inst{8-0} = fi; 7950b57cec5SDimitry Andric let Inst{16-9} = op; 7960b57cec5SDimitry Andric let Inst{24-17} = !if(p.EmitDst, vdst{7-0}, 0); 7970b57cec5SDimitry Andric let Inst{31-25} = 0x3f; 7980b57cec5SDimitry Andric} 7990b57cec5SDimitry Andric 8005f757f3fSDimitry Andricclass VOP1_DPP8_Gen<bits<8> op, VOP1_Pseudo ps, GFXGen Gen, VOPProfile p = ps.Pfl> : 8015f757f3fSDimitry Andric VOP1_DPP8<op, ps, p> { 8025f757f3fSDimitry Andric let AssemblerPredicate = Gen.AssemblerPredicate; 803*0fca6ea1SDimitry Andric let DecoderNamespace = Gen.DecoderNamespace; 8045f757f3fSDimitry Andric} 8055f757f3fSDimitry Andric 8060b57cec5SDimitry Andric//===----------------------------------------------------------------------===// 8075f757f3fSDimitry Andric// GFX11, GFX12 80881ad6265SDimitry Andric//===----------------------------------------------------------------------===// 80981ad6265SDimitry Andric 8105f757f3fSDimitry Andricmulticlass VOP1Only_Real<GFXGen Gen, bits<9> op> { 81181ad6265SDimitry Andric let IsSingle = 1 in 8125f757f3fSDimitry Andric def Gen.Suffix : 8135f757f3fSDimitry Andric VOP1_Real_Gen<!cast<VOP1_Pseudo>(NAME), Gen>, 81481ad6265SDimitry Andric VOP1e<op{7-0}, !cast<VOP1_Pseudo>(NAME).Pfl>; 81581ad6265SDimitry Andric} 8165f757f3fSDimitry Andric 8175f757f3fSDimitry Andricmulticlass VOP1_Real_e32<GFXGen Gen, bits<9> op, string opName = NAME> { 81881ad6265SDimitry Andric defvar ps = !cast<VOP1_Pseudo>(opName#"_e32"); 8195f757f3fSDimitry Andric def _e32#Gen.Suffix : 8205f757f3fSDimitry Andric VOP1_Real_Gen<ps, Gen>, 82181ad6265SDimitry Andric VOP1e<op{7-0}, ps.Pfl>; 82281ad6265SDimitry Andric} 8235f757f3fSDimitry Andric 8245f757f3fSDimitry Andricmulticlass VOP1_Real_e32_with_name<GFXGen Gen, bits<9> op, string opName, 82581ad6265SDimitry Andric string asmName> { 82681ad6265SDimitry Andric defvar ps = !cast<VOP1_Pseudo>(opName#"_e32"); 827297eecfbSDimitry Andric let AsmString = asmName # ps.AsmOperands, 828297eecfbSDimitry Andric DecoderNamespace = Gen.DecoderNamespace # 829297eecfbSDimitry Andric !if(ps.Pfl.IsRealTrue16, "", "_FAKE16") in { 8305f757f3fSDimitry Andric defm NAME : VOP1_Real_e32<Gen, op, opName>; 83181ad6265SDimitry Andric } 83281ad6265SDimitry Andric} 83381ad6265SDimitry Andric 8345f757f3fSDimitry Andricmulticlass VOP1_Real_e64<GFXGen Gen, bits<9> op> { 8355f757f3fSDimitry Andric def _e64#Gen.Suffix : 8365f757f3fSDimitry Andric VOP3_Real_Gen<!cast<VOP3_Pseudo>(NAME#"_e64"), Gen>, 8375f757f3fSDimitry Andric VOP3e_gfx11_gfx12<{0, 1, 1, op{6-0}}, !cast<VOP3_Pseudo>(NAME#"_e64").Pfl>; 83881ad6265SDimitry Andric} 8395f757f3fSDimitry Andric 8405f757f3fSDimitry Andricmulticlass VOP1_Real_dpp<GFXGen Gen, bits<9> op, string opName = NAME> { 8415f757f3fSDimitry Andric defvar ps = !cast<VOP1_Pseudo>(opName#"_e32"); 8425f757f3fSDimitry Andric def _dpp#Gen.Suffix : VOP1_DPP16_Gen<op{7-0}, !cast<VOP1_DPP_Pseudo>(opName#"_dpp"), Gen>; 8435f757f3fSDimitry Andric} 8445f757f3fSDimitry Andric 8455f757f3fSDimitry Andricmulticlass VOP1_Real_dpp_with_name<GFXGen Gen, bits<9> op, string opName, 84681ad6265SDimitry Andric string asmName> { 8475f757f3fSDimitry Andric defvar ps = !cast<VOP1_Pseudo>(opName#"_e32"); 848297eecfbSDimitry Andric let AsmString = asmName # ps.Pfl.AsmDPP16, 849*0fca6ea1SDimitry Andric DecoderNamespace = Gen.DecoderNamespace # 850297eecfbSDimitry Andric !if(ps.Pfl.IsRealTrue16, "", "_FAKE16") in { 8515f757f3fSDimitry Andric defm NAME : VOP1_Real_dpp<Gen, op, opName>; 8525f757f3fSDimitry Andric } 8535f757f3fSDimitry Andric} 8545f757f3fSDimitry Andric 8555f757f3fSDimitry Andricmulticlass VOP1_Real_dpp8<GFXGen Gen, bits<9> op, string opName = NAME> { 8565f757f3fSDimitry Andric defvar ps = !cast<VOP1_Pseudo>(opName#"_e32"); 8575f757f3fSDimitry Andric def _dpp8#Gen.Suffix : VOP1_DPP8_Gen<op{7-0}, ps, Gen>; 8585f757f3fSDimitry Andric} 8595f757f3fSDimitry Andric 8605f757f3fSDimitry Andricmulticlass VOP1_Real_dpp8_with_name<GFXGen Gen, bits<9> op, string opName, 8615f757f3fSDimitry Andric string asmName> { 8625f757f3fSDimitry Andric defvar ps = !cast<VOP1_Pseudo>(opName#"_e32"); 863297eecfbSDimitry Andric let AsmString = asmName # ps.Pfl.AsmDPP8, 864*0fca6ea1SDimitry Andric DecoderNamespace = Gen.DecoderNamespace # 865297eecfbSDimitry Andric !if(ps.Pfl.IsRealTrue16, "", "_FAKE16") in { 8665f757f3fSDimitry Andric defm NAME : VOP1_Real_dpp8<Gen, op, opName>; 8675f757f3fSDimitry Andric } 8685f757f3fSDimitry Andric} 8695f757f3fSDimitry Andric 8705f757f3fSDimitry Andricmulticlass VOP1_Realtriple_e64<GFXGen Gen, bits<9> op> { 8715f757f3fSDimitry Andric defm NAME : VOP3_Realtriple<Gen, {0, 1, 1, op{6-0}}, /*isSingle=*/ 0, NAME>; 8725f757f3fSDimitry Andric} 8735f757f3fSDimitry Andric 8745f757f3fSDimitry Andricmulticlass VOP1_Realtriple_e64_with_name<GFXGen Gen, bits<9> op, string opName, 8755f757f3fSDimitry Andric string asmName> { 8765f757f3fSDimitry Andric defm NAME : VOP3_Realtriple_with_name<Gen, {0, 1, 1, op{6-0}}, opName, 87781ad6265SDimitry Andric asmName>; 87881ad6265SDimitry Andric} 87981ad6265SDimitry Andric 8805f757f3fSDimitry Andricmulticlass VOP1_Real_FULL<GFXGen Gen, bits<9> op> : 8815f757f3fSDimitry Andric VOP1_Real_e32<Gen, op>, VOP1_Realtriple_e64<Gen, op>, 8825f757f3fSDimitry Andric VOP1_Real_dpp<Gen, op>, VOP1_Real_dpp8<Gen, op>; 88381ad6265SDimitry Andric 88481ad6265SDimitry Andricmulticlass VOP1_Real_NO_VOP3_with_name_gfx11<bits<9> op, string opName, 885bdd1243dSDimitry Andric string asmName> { 8865f757f3fSDimitry Andric defm NAME : VOP1_Real_e32_with_name<GFX11Gen, op, opName, asmName>, 8875f757f3fSDimitry Andric VOP1_Real_dpp_with_name<GFX11Gen, op, opName, asmName>, 8885f757f3fSDimitry Andric VOP1_Real_dpp8_with_name<GFX11Gen, op, opName, asmName>; 889bdd1243dSDimitry Andric defvar ps = !cast<VOP1_Pseudo>(opName#"_e32"); 890*0fca6ea1SDimitry Andric def gfx11_alias : AMDGPUMnemonicAlias<ps.Mnemonic, asmName> { 891*0fca6ea1SDimitry Andric let AssemblerPredicate = isGFX11Plus; 892*0fca6ea1SDimitry Andric } 893bdd1243dSDimitry Andric} 89481ad6265SDimitry Andric 8955f757f3fSDimitry Andricmulticlass VOP1_Real_NO_VOP3_with_name_gfx12<bits<9> op, string opName, 8965f757f3fSDimitry Andric string asmName> { 8975f757f3fSDimitry Andric defm NAME : VOP1_Real_e32_with_name<GFX12Gen, op, opName, asmName>, 8985f757f3fSDimitry Andric VOP1_Real_dpp_with_name<GFX12Gen, op, opName, asmName>, 8995f757f3fSDimitry Andric VOP1_Real_dpp8_with_name<GFX12Gen, op, opName, asmName>; 9005f757f3fSDimitry Andric} 9015f757f3fSDimitry Andric 9025f757f3fSDimitry Andricmulticlass VOP1_Real_FULL_with_name<GFXGen Gen, bits<9> op, string opName, 90381ad6265SDimitry Andric string asmName> : 9045f757f3fSDimitry Andric VOP1_Real_e32_with_name<Gen, op, opName, asmName>, 9055f757f3fSDimitry Andric VOP1_Real_dpp_with_name<Gen, op, opName, asmName>, 9065f757f3fSDimitry Andric VOP1_Real_dpp8_with_name<Gen, op, opName, asmName>, 9075f757f3fSDimitry Andric VOP1_Realtriple_e64_with_name<Gen, op, opName, asmName>; 90881ad6265SDimitry Andric 9095f757f3fSDimitry Andricmulticlass VOP1_Real_NO_DPP<GFXGen Gen, bits<9> op> : 9105f757f3fSDimitry Andric VOP1_Real_e32<Gen, op>, VOP1_Real_e64<Gen, op>; 9115f757f3fSDimitry Andric 9125f757f3fSDimitry Andricmulticlass VOP1_Real_FULL_t16_gfx11_gfx12<bits<9> op, string asmName, 913bdd1243dSDimitry Andric string opName = NAME> : 9145f757f3fSDimitry Andric VOP1_Real_FULL_with_name<GFX11Gen, op, opName, asmName>, 9155f757f3fSDimitry Andric VOP1_Real_FULL_with_name<GFX12Gen, op, opName, asmName>; 916bdd1243dSDimitry Andric 9175f757f3fSDimitry Andricmulticlass VOP1_Real_FULL_with_name_gfx11_gfx12<bits<9> op, string opName, 9185f757f3fSDimitry Andric string asmName> : 9195f757f3fSDimitry Andric VOP1_Real_FULL_with_name<GFX11Gen, op, opName, asmName>, 9205f757f3fSDimitry Andric VOP1_Real_FULL_with_name<GFX12Gen, op, opName, asmName>; 92181ad6265SDimitry Andric 9225f757f3fSDimitry Andricmulticlass VOP1Only_Real_gfx11_gfx12<bits<9> op> : 9235f757f3fSDimitry Andric VOP1Only_Real<GFX11Gen, op>, VOP1Only_Real<GFX12Gen, op>; 9245f757f3fSDimitry Andric 9255f757f3fSDimitry Andricmulticlass VOP1_Real_FULL_gfx11_gfx12<bits<9> op> : 9265f757f3fSDimitry Andric VOP1_Real_FULL<GFX11Gen, op>, VOP1_Real_FULL<GFX12Gen, op>; 9275f757f3fSDimitry Andric 9285f757f3fSDimitry Andricmulticlass VOP1_Real_NO_DPP_OP_SEL_with_name<GFXGen Gen, bits<9> op, 9295f757f3fSDimitry Andric string opName, string asmName> : 9305f757f3fSDimitry Andric VOP1_Real_e32_with_name<Gen, op, opName, asmName>, 9315f757f3fSDimitry Andric VOP3_Real_with_name<Gen, {0, 1, 1, op{6-0}}, opName, asmName>; 9325f757f3fSDimitry Andric 9335f757f3fSDimitry Andric 934*0fca6ea1SDimitry Andricdefm V_CVT_F32_FP8 : VOP1_Real_FULL_with_name<GFX12Gen, 0x06c, "V_CVT_F32_FP8_OP_SEL", "v_cvt_f32_fp8">; 935*0fca6ea1SDimitry Andricdefm V_CVT_F32_BF8 : VOP1_Real_FULL_with_name<GFX12Gen, 0x06d, "V_CVT_F32_BF8_OP_SEL", "v_cvt_f32_bf8">; 936*0fca6ea1SDimitry Andric 937b3edf446SDimitry Andric// Define VOP1 instructions using the pseudo instruction with its old profile and 938b3edf446SDimitry Andric// VOP3 using the OpSel profile for the pseudo instruction. 939b3edf446SDimitry Andricdefm V_CVT_PK_F32_FP8 : VOP1_Real_e32_with_name<GFX12Gen, 0x06e, "V_CVT_PK_F32_FP8", "v_cvt_pk_f32_fp8">; 940b3edf446SDimitry Andricdefm V_CVT_PK_F32_FP8 : VOP3_Real_with_name<GFX12Gen, 0x1ee, "V_CVT_PK_F32_FP8_OP_SEL", "v_cvt_pk_f32_fp8">; 941b3edf446SDimitry Andric 942b3edf446SDimitry Andricdefm V_CVT_PK_F32_BF8 : VOP1_Real_e32_with_name<GFX12Gen, 0x06f, "V_CVT_PK_F32_BF8", "v_cvt_pk_f32_bf8">; 943b3edf446SDimitry Andricdefm V_CVT_PK_F32_BF8 : VOP3_Real_with_name<GFX12Gen, 0x1ef, "V_CVT_PK_F32_BF8_OP_SEL", "v_cvt_pk_f32_bf8">; 944b3edf446SDimitry Andric 9455f757f3fSDimitry Andricdefm V_CVT_NEAREST_I32_F32 : VOP1_Real_FULL_with_name_gfx11_gfx12<0x00c, 94681ad6265SDimitry Andric "V_CVT_RPI_I32_F32", "v_cvt_nearest_i32_f32">; 9475f757f3fSDimitry Andricdefm V_CVT_FLOOR_I32_F32 : VOP1_Real_FULL_with_name_gfx11_gfx12<0x00d, 94881ad6265SDimitry Andric "V_CVT_FLR_I32_F32", "v_cvt_floor_i32_f32">; 9495f757f3fSDimitry Andricdefm V_CLZ_I32_U32 : VOP1_Real_FULL_with_name_gfx11_gfx12<0x039, 95081ad6265SDimitry Andric "V_FFBH_U32", "v_clz_i32_u32">; 9515f757f3fSDimitry Andricdefm V_CTZ_I32_B32 : VOP1_Real_FULL_with_name_gfx11_gfx12<0x03a, 95281ad6265SDimitry Andric "V_FFBL_B32", "v_ctz_i32_b32">; 9535f757f3fSDimitry Andricdefm V_CLS_I32 : VOP1_Real_FULL_with_name_gfx11_gfx12<0x03b, 95481ad6265SDimitry Andric "V_FFBH_I32", "v_cls_i32">; 9555f757f3fSDimitry Andricdefm V_PERMLANE64_B32 : VOP1Only_Real_gfx11_gfx12<0x067>; 9565f757f3fSDimitry Andricdefm V_MOV_B16_t16 : VOP1_Real_FULL_t16_gfx11_gfx12<0x01c, "v_mov_b16">; 957297eecfbSDimitry Andricdefm V_NOT_B16_fake16 : VOP1_Real_FULL_t16_gfx11_gfx12<0x069, "v_not_b16">; 958297eecfbSDimitry Andricdefm V_CVT_I32_I16_fake16 : VOP1_Real_FULL_t16_gfx11_gfx12<0x06a, "v_cvt_i32_i16">; 959297eecfbSDimitry Andricdefm V_CVT_U32_U16_fake16 : VOP1_Real_FULL_t16_gfx11_gfx12<0x06b, "v_cvt_u32_u16">; 960bdd1243dSDimitry Andric 9615f757f3fSDimitry Andricdefm V_CVT_F16_U16_t16 : VOP1_Real_FULL_t16_gfx11_gfx12<0x050, "v_cvt_f16_u16">; 9625f757f3fSDimitry Andricdefm V_CVT_F16_I16_t16 : VOP1_Real_FULL_t16_gfx11_gfx12<0x051, "v_cvt_f16_i16">; 9635f757f3fSDimitry Andricdefm V_CVT_U16_F16_t16 : VOP1_Real_FULL_t16_gfx11_gfx12<0x052, "v_cvt_u16_f16">; 9645f757f3fSDimitry Andricdefm V_CVT_I16_F16_t16 : VOP1_Real_FULL_t16_gfx11_gfx12<0x053, "v_cvt_i16_f16">; 965*0fca6ea1SDimitry Andricdefm V_RCP_F16_t16 : VOP1_Real_FULL_t16_gfx11_gfx12<0x054, "v_rcp_f16">; 966297eecfbSDimitry Andricdefm V_RCP_F16_fake16 : VOP1_Real_FULL_t16_gfx11_gfx12<0x054, "v_rcp_f16">; 967*0fca6ea1SDimitry Andricdefm V_SQRT_F16_t16 : VOP1_Real_FULL_t16_gfx11_gfx12<0x055, "v_sqrt_f16">; 968297eecfbSDimitry Andricdefm V_SQRT_F16_fake16 : VOP1_Real_FULL_t16_gfx11_gfx12<0x055, "v_sqrt_f16">; 969*0fca6ea1SDimitry Andricdefm V_RSQ_F16_t16 : VOP1_Real_FULL_t16_gfx11_gfx12<0x056, "v_rsq_f16">; 970297eecfbSDimitry Andricdefm V_RSQ_F16_fake16 : VOP1_Real_FULL_t16_gfx11_gfx12<0x056, "v_rsq_f16">; 971*0fca6ea1SDimitry Andricdefm V_LOG_F16_t16 : VOP1_Real_FULL_t16_gfx11_gfx12<0x057, "v_log_f16">; 972297eecfbSDimitry Andricdefm V_LOG_F16_fake16 : VOP1_Real_FULL_t16_gfx11_gfx12<0x057, "v_log_f16">; 973*0fca6ea1SDimitry Andricdefm V_EXP_F16_t16 : VOP1_Real_FULL_t16_gfx11_gfx12<0x058, "v_exp_f16">; 974297eecfbSDimitry Andricdefm V_EXP_F16_fake16 : VOP1_Real_FULL_t16_gfx11_gfx12<0x058, "v_exp_f16">; 975297eecfbSDimitry Andricdefm V_FREXP_MANT_F16_fake16 : VOP1_Real_FULL_t16_gfx11_gfx12<0x059, "v_frexp_mant_f16">; 9765f757f3fSDimitry Andricdefm V_FREXP_EXP_I16_F16_t16 : VOP1_Real_FULL_t16_gfx11_gfx12<0x05a, "v_frexp_exp_i16_f16">; 9777a6dacacSDimitry Andricdefm V_FLOOR_F16_t16 : VOP1_Real_FULL_t16_gfx11_gfx12<0x05b, "v_floor_f16">; 978297eecfbSDimitry Andricdefm V_FLOOR_F16_fake16 : VOP1_Real_FULL_t16_gfx11_gfx12<0x05b, "v_floor_f16">; 9795f757f3fSDimitry Andricdefm V_CEIL_F16_t16 : VOP1_Real_FULL_t16_gfx11_gfx12<0x05c, "v_ceil_f16">; 980297eecfbSDimitry Andricdefm V_CEIL_F16_fake16 : VOP1_Real_FULL_t16_gfx11_gfx12<0x05c, "v_ceil_f16">; 981297eecfbSDimitry Andricdefm V_TRUNC_F16_fake16 : VOP1_Real_FULL_t16_gfx11_gfx12<0x05d, "v_trunc_f16">; 982297eecfbSDimitry Andricdefm V_RNDNE_F16_fake16 : VOP1_Real_FULL_t16_gfx11_gfx12<0x05e, "v_rndne_f16">; 983297eecfbSDimitry Andricdefm V_FRACT_F16_fake16 : VOP1_Real_FULL_t16_gfx11_gfx12<0x05f, "v_fract_f16">; 984297eecfbSDimitry Andricdefm V_SIN_F16_fake16 : VOP1_Real_FULL_t16_gfx11_gfx12<0x060, "v_sin_f16">; 985297eecfbSDimitry Andricdefm V_COS_F16_fake16 : VOP1_Real_FULL_t16_gfx11_gfx12<0x061, "v_cos_f16">; 986297eecfbSDimitry Andricdefm V_SAT_PK_U8_I16_fake16 : VOP1_Real_FULL_t16_gfx11_gfx12<0x062, "v_sat_pk_u8_i16">; 9875f757f3fSDimitry Andricdefm V_CVT_NORM_I16_F16_t16 : VOP1_Real_FULL_t16_gfx11_gfx12<0x063, "v_cvt_norm_i16_f16">; 9885f757f3fSDimitry Andricdefm V_CVT_NORM_U16_F16_t16 : VOP1_Real_FULL_t16_gfx11_gfx12<0x064, "v_cvt_norm_u16_f16">; 989bdd1243dSDimitry Andric 9905f757f3fSDimitry Andricdefm V_CVT_F16_F32_t16 : VOP1_Real_FULL_t16_gfx11_gfx12<0x00a, "v_cvt_f16_f32">; 9915f757f3fSDimitry Andricdefm V_CVT_F32_F16_t16 : VOP1_Real_FULL_t16_gfx11_gfx12<0x00b, "v_cvt_f32_f16">; 99281ad6265SDimitry Andric 99381ad6265SDimitry Andric//===----------------------------------------------------------------------===// 9940b57cec5SDimitry Andric// GFX10. 9950b57cec5SDimitry Andric//===----------------------------------------------------------------------===// 9960b57cec5SDimitry Andric 99781ad6265SDimitry Andriclet AssemblerPredicate = isGFX10Only, DecoderNamespace = "GFX10" in { 9980b57cec5SDimitry Andric multiclass VOP1Only_Real_gfx10<bits<9> op> { 9990b57cec5SDimitry Andric def _gfx10 : 10000b57cec5SDimitry Andric VOP1_Real<!cast<VOP1_Pseudo>(NAME), SIEncodingFamily.GFX10>, 10010b57cec5SDimitry Andric VOP1e<op{7-0}, !cast<VOP1_Pseudo>(NAME).Pfl>; 10020b57cec5SDimitry Andric } 10030b57cec5SDimitry Andric multiclass VOP1_Real_e32_gfx10<bits<9> op> { 10040b57cec5SDimitry Andric def _e32_gfx10 : 10050b57cec5SDimitry Andric VOP1_Real<!cast<VOP1_Pseudo>(NAME#"_e32"), SIEncodingFamily.GFX10>, 10060b57cec5SDimitry Andric VOP1e<op{7-0}, !cast<VOP1_Pseudo>(NAME#"_e32").Pfl>; 10070b57cec5SDimitry Andric } 10080b57cec5SDimitry Andric multiclass VOP1_Real_e64_gfx10<bits<9> op> { 10090b57cec5SDimitry Andric def _e64_gfx10 : 10100b57cec5SDimitry Andric VOP3_Real<!cast<VOP3_Pseudo>(NAME#"_e64"), SIEncodingFamily.GFX10>, 10110b57cec5SDimitry Andric VOP3e_gfx10<{0, 1, 1, op{6-0}}, !cast<VOP3_Pseudo>(NAME#"_e64").Pfl>; 10120b57cec5SDimitry Andric } 10130b57cec5SDimitry Andric multiclass VOP1_Real_sdwa_gfx10<bits<9> op> { 101406c3fb27SDimitry Andric if !cast<VOP1_Pseudo>(NAME#"_e32").Pfl.HasExtSDWA9 then 10150b57cec5SDimitry Andric def _sdwa_gfx10 : 10160b57cec5SDimitry Andric VOP_SDWA10_Real<!cast<VOP1_SDWA_Pseudo>(NAME#"_sdwa")>, 1017*0fca6ea1SDimitry Andric VOP1_SDWA9Ae<op{7-0}, !cast<VOP1_SDWA_Pseudo>(NAME#"_sdwa").Pfl>; 10180b57cec5SDimitry Andric } 10190b57cec5SDimitry Andric multiclass VOP1_Real_dpp_gfx10<bits<9> op> { 102006c3fb27SDimitry Andric if !cast<VOP1_Pseudo>(NAME#"_e32").Pfl.HasExt32BitDPP then 1021*0fca6ea1SDimitry Andric def _dpp_gfx10 : VOP1_DPP16<op{7-0}, !cast<VOP1_DPP_Pseudo>(NAME#"_dpp"), SIEncodingFamily.GFX10>; 10220b57cec5SDimitry Andric } 10230b57cec5SDimitry Andric multiclass VOP1_Real_dpp8_gfx10<bits<9> op> { 102406c3fb27SDimitry Andric if !cast<VOP1_Pseudo>(NAME#"_e32").Pfl.HasExt32BitDPP then 1025*0fca6ea1SDimitry Andric def _dpp8_gfx10 : VOP1_DPP8<op{7-0}, !cast<VOP1_Pseudo>(NAME#"_e32")>; 10260b57cec5SDimitry Andric } 102781ad6265SDimitry Andric} // End AssemblerPredicate = isGFX10Only, DecoderNamespace = "GFX10" 10280b57cec5SDimitry Andric 10290b57cec5SDimitry Andricmulticlass VOP1_Real_gfx10<bits<9> op> : 1030480093f4SDimitry Andric VOP1_Real_e32_gfx10<op>, VOP1_Real_e64_gfx10<op>, 1031480093f4SDimitry Andric VOP1_Real_sdwa_gfx10<op>, VOP1_Real_dpp_gfx10<op>, 1032480093f4SDimitry Andric VOP1_Real_dpp8_gfx10<op>; 10330b57cec5SDimitry Andric 10345f757f3fSDimitry Andricmulticlass VOP1_Real_gfx10_FULL_gfx11_gfx12<bits<9> op> : 10355f757f3fSDimitry Andric VOP1_Real_gfx10<op>, 10365f757f3fSDimitry Andric VOP1_Real_FULL<GFX11Gen, op>, 10375f757f3fSDimitry Andric VOP1_Real_FULL<GFX12Gen, op>; 10380b57cec5SDimitry Andric 10395f757f3fSDimitry Andricmulticlass VOP1_Real_gfx10_NO_DPP_gfx11_gfx12<bits<9> op> : 10405f757f3fSDimitry Andric VOP1_Real_gfx10<op>, 10415f757f3fSDimitry Andric VOP1_Real_NO_DPP<GFX11Gen, op>, 10425f757f3fSDimitry Andric VOP1_Real_NO_DPP<GFX12Gen, op>; 104381ad6265SDimitry Andric 10445f757f3fSDimitry Andricmulticlass VOP1Only_Real_gfx10_gfx11_gfx12<bits<9> op> : 10455f757f3fSDimitry Andric VOP1Only_Real_gfx10<op>, 10465f757f3fSDimitry Andric VOP1Only_Real<GFX11Gen, op>, 10475f757f3fSDimitry Andric VOP1Only_Real<GFX12Gen, op>; 104881ad6265SDimitry Andric 10495f757f3fSDimitry Andricdefm V_PIPEFLUSH : VOP1_Real_gfx10_NO_DPP_gfx11_gfx12<0x01b>; 10505f757f3fSDimitry Andricdefm V_MOVRELSD_2_B32 : VOP1_Real_gfx10_FULL_gfx11_gfx12<0x048>; 1051bdd1243dSDimitry Andricdefm V_CVT_F16_U16 : VOP1_Real_gfx10<0x050>; 1052bdd1243dSDimitry Andricdefm V_CVT_F16_I16 : VOP1_Real_gfx10<0x051>; 1053bdd1243dSDimitry Andricdefm V_CVT_U16_F16 : VOP1_Real_gfx10<0x052>; 1054bdd1243dSDimitry Andricdefm V_CVT_I16_F16 : VOP1_Real_gfx10<0x053>; 1055bdd1243dSDimitry Andricdefm V_RCP_F16 : VOP1_Real_gfx10<0x054>; 1056bdd1243dSDimitry Andricdefm V_SQRT_F16 : VOP1_Real_gfx10<0x055>; 1057bdd1243dSDimitry Andricdefm V_RSQ_F16 : VOP1_Real_gfx10<0x056>; 1058bdd1243dSDimitry Andricdefm V_LOG_F16 : VOP1_Real_gfx10<0x057>; 1059bdd1243dSDimitry Andricdefm V_EXP_F16 : VOP1_Real_gfx10<0x058>; 1060bdd1243dSDimitry Andricdefm V_FREXP_MANT_F16 : VOP1_Real_gfx10<0x059>; 1061bdd1243dSDimitry Andricdefm V_FREXP_EXP_I16_F16 : VOP1_Real_gfx10<0x05a>; 1062bdd1243dSDimitry Andricdefm V_FLOOR_F16 : VOP1_Real_gfx10<0x05b>; 1063bdd1243dSDimitry Andricdefm V_CEIL_F16 : VOP1_Real_gfx10<0x05c>; 1064bdd1243dSDimitry Andricdefm V_TRUNC_F16 : VOP1_Real_gfx10<0x05d>; 1065bdd1243dSDimitry Andricdefm V_RNDNE_F16 : VOP1_Real_gfx10<0x05e>; 1066bdd1243dSDimitry Andricdefm V_FRACT_F16 : VOP1_Real_gfx10<0x05f>; 1067bdd1243dSDimitry Andricdefm V_SIN_F16 : VOP1_Real_gfx10<0x060>; 1068bdd1243dSDimitry Andricdefm V_COS_F16 : VOP1_Real_gfx10<0x061>; 1069bdd1243dSDimitry Andricdefm V_SAT_PK_U8_I16 : VOP1_Real_gfx10<0x062>; 1070bdd1243dSDimitry Andricdefm V_CVT_NORM_I16_F16 : VOP1_Real_gfx10<0x063>; 1071bdd1243dSDimitry Andricdefm V_CVT_NORM_U16_F16 : VOP1_Real_gfx10<0x064>; 107281ad6265SDimitry Andric 10735f757f3fSDimitry Andricdefm V_SWAP_B32 : VOP1Only_Real_gfx10_gfx11_gfx12<0x065>; 10745f757f3fSDimitry Andricdefm V_SWAPREL_B32 : VOP1Only_Real_gfx10_gfx11_gfx12<0x068>; 10750b57cec5SDimitry Andric 10760b57cec5SDimitry Andric//===----------------------------------------------------------------------===// 10775f757f3fSDimitry Andric// GFX7, GFX10, GFX11, GFX12 10780b57cec5SDimitry Andric//===----------------------------------------------------------------------===// 10790b57cec5SDimitry Andric 10800b57cec5SDimitry Andriclet AssemblerPredicate = isGFX7Only, DecoderNamespace = "GFX7" in { 10810b57cec5SDimitry Andric multiclass VOP1_Real_e32_gfx7<bits<9> op> { 10820b57cec5SDimitry Andric def _e32_gfx7 : 10830b57cec5SDimitry Andric VOP1_Real<!cast<VOP1_Pseudo>(NAME#"_e32"), SIEncodingFamily.SI>, 10840b57cec5SDimitry Andric VOP1e<op{7-0}, !cast<VOP1_Pseudo>(NAME#"_e32").Pfl>; 10850b57cec5SDimitry Andric } 10860b57cec5SDimitry Andric multiclass VOP1_Real_e64_gfx7<bits<9> op> { 10870b57cec5SDimitry Andric def _e64_gfx7 : 10880b57cec5SDimitry Andric VOP3_Real<!cast<VOP3_Pseudo>(NAME#"_e64"), SIEncodingFamily.SI>, 10890b57cec5SDimitry Andric VOP3e_gfx6_gfx7<{1, 1, op{6-0}}, !cast<VOP3_Pseudo>(NAME#"_e64").Pfl>; 10900b57cec5SDimitry Andric } 10910b57cec5SDimitry Andric} // End AssemblerPredicate = isGFX7Only, DecoderNamespace = "GFX7" 10920b57cec5SDimitry Andric 10930b57cec5SDimitry Andricmulticlass VOP1_Real_gfx7<bits<9> op> : 10940b57cec5SDimitry Andric VOP1_Real_e32_gfx7<op>, VOP1_Real_e64_gfx7<op>; 10950b57cec5SDimitry Andric 10965f757f3fSDimitry Andricmulticlass VOP1_Real_gfx7_gfx10_NO_DPP_gfx11_gfx12<bits<9> op> : 10975f757f3fSDimitry Andric VOP1_Real_gfx7<op>, VOP1_Real_gfx10<op>, VOP1_Real_NO_DPP<GFX11Gen, op>, 10985f757f3fSDimitry Andric VOP1_Real_NO_DPP<GFX12Gen, op>; 109981ad6265SDimitry Andric 11000b57cec5SDimitry Andricdefm V_LOG_LEGACY_F32 : VOP1_Real_gfx7<0x045>; 11010b57cec5SDimitry Andricdefm V_EXP_LEGACY_F32 : VOP1_Real_gfx7<0x046>; 11020b57cec5SDimitry Andric 11035f757f3fSDimitry Andricdefm V_TRUNC_F64 : VOP1_Real_gfx7_gfx10_NO_DPP_gfx11_gfx12<0x017>; 11045f757f3fSDimitry Andricdefm V_CEIL_F64 : VOP1_Real_gfx7_gfx10_NO_DPP_gfx11_gfx12<0x018>; 11055f757f3fSDimitry Andricdefm V_RNDNE_F64 : VOP1_Real_gfx7_gfx10_NO_DPP_gfx11_gfx12<0x019>; 11065f757f3fSDimitry Andricdefm V_FLOOR_F64 : VOP1_Real_gfx7_gfx10_NO_DPP_gfx11_gfx12<0x01a>; 11070b57cec5SDimitry Andric 11080b57cec5SDimitry Andric//===----------------------------------------------------------------------===// 11095f757f3fSDimitry Andric// GFX6, GFX7, GFX10, GFX11, GFX12 11100b57cec5SDimitry Andric//===----------------------------------------------------------------------===// 11110b57cec5SDimitry Andric 11120b57cec5SDimitry Andriclet AssemblerPredicate = isGFX6GFX7, DecoderNamespace = "GFX6GFX7" in { 11130b57cec5SDimitry Andric multiclass VOP1_Real_e32_gfx6_gfx7<bits<9> op> { 11140b57cec5SDimitry Andric def _e32_gfx6_gfx7 : 11150b57cec5SDimitry Andric VOP1_Real<!cast<VOP1_Pseudo>(NAME#"_e32"), SIEncodingFamily.SI>, 11160b57cec5SDimitry Andric VOP1e<op{7-0}, !cast<VOP1_Pseudo>(NAME#"_e32").Pfl>; 11170b57cec5SDimitry Andric } 11180b57cec5SDimitry Andric multiclass VOP1_Real_e64_gfx6_gfx7<bits<9> op> { 11190b57cec5SDimitry Andric def _e64_gfx6_gfx7 : 11200b57cec5SDimitry Andric VOP3_Real<!cast<VOP3_Pseudo>(NAME#"_e64"), SIEncodingFamily.SI>, 11210b57cec5SDimitry Andric VOP3e_gfx6_gfx7<{1, 1, op{6-0}}, !cast<VOP3_Pseudo>(NAME#"_e64").Pfl>; 11220b57cec5SDimitry Andric } 1123*0fca6ea1SDimitry Andric multiclass VOP1Only_Real_gfx6_gfx7<bits<9> op> { 1124*0fca6ea1SDimitry Andric def _gfx6_gfx7 : 1125*0fca6ea1SDimitry Andric VOP1_Real<!cast<VOP1_Pseudo>(NAME), SIEncodingFamily.SI>, 1126*0fca6ea1SDimitry Andric VOP1e<op{7-0}, !cast<VOP1_Pseudo>(NAME).Pfl>; 1127*0fca6ea1SDimitry Andric } 11280b57cec5SDimitry Andric} // End AssemblerPredicate = isGFX6GFX7, DecoderNamespace = "GFX6GFX7" 11290b57cec5SDimitry Andric 11300b57cec5SDimitry Andricmulticlass VOP1_Real_gfx6_gfx7<bits<9> op> : 11310b57cec5SDimitry Andric VOP1_Real_e32_gfx6_gfx7<op>, VOP1_Real_e64_gfx6_gfx7<op>; 11320b57cec5SDimitry Andric 11330b57cec5SDimitry Andricmulticlass VOP1_Real_gfx6_gfx7_gfx10<bits<9> op> : 11340b57cec5SDimitry Andric VOP1_Real_gfx6_gfx7<op>, VOP1_Real_gfx10<op>; 11350b57cec5SDimitry Andric 11365f757f3fSDimitry Andricmulticlass VOP1_Real_gfx6_gfx7_gfx10_FULL_gfx11_gfx12<bits<9> op> : 11375f757f3fSDimitry Andric VOP1_Real_gfx6_gfx7_gfx10<op>, VOP1_Real_FULL<GFX11Gen, op>, 11385f757f3fSDimitry Andric VOP1_Real_FULL<GFX12Gen, op>; 113981ad6265SDimitry Andric 11405f757f3fSDimitry Andricmulticlass VOP1_Real_gfx6_gfx7_gfx10_NO_DPP_gfx11_gfx12<bits<9> op> : 11415f757f3fSDimitry Andric VOP1_Real_gfx6_gfx7_gfx10<op>, VOP1_Real_NO_DPP<GFX11Gen, op>, 11425f757f3fSDimitry Andric VOP1_Real_NO_DPP<GFX12Gen, op>; 114381ad6265SDimitry Andric 1144*0fca6ea1SDimitry Andricmulticlass VOP1Only_Real_gfx6_gfx7_gfx10_gfx11_gfx12<bits<9> op> : 1145*0fca6ea1SDimitry Andric VOP1Only_Real_gfx6_gfx7<op>, VOP1Only_Real_gfx10_gfx11_gfx12<op>; 1146*0fca6ea1SDimitry Andric 11470b57cec5SDimitry Andricdefm V_LOG_CLAMP_F32 : VOP1_Real_gfx6_gfx7<0x026>; 11480b57cec5SDimitry Andricdefm V_RCP_CLAMP_F32 : VOP1_Real_gfx6_gfx7<0x028>; 11490b57cec5SDimitry Andricdefm V_RCP_LEGACY_F32 : VOP1_Real_gfx6_gfx7<0x029>; 11500b57cec5SDimitry Andricdefm V_RSQ_CLAMP_F32 : VOP1_Real_gfx6_gfx7<0x02c>; 11510b57cec5SDimitry Andricdefm V_RSQ_LEGACY_F32 : VOP1_Real_gfx6_gfx7<0x02d>; 11520b57cec5SDimitry Andricdefm V_RCP_CLAMP_F64 : VOP1_Real_gfx6_gfx7<0x030>; 11530b57cec5SDimitry Andricdefm V_RSQ_CLAMP_F64 : VOP1_Real_gfx6_gfx7<0x032>; 11540b57cec5SDimitry Andric 11555f757f3fSDimitry Andricdefm V_NOP : VOP1_Real_gfx6_gfx7_gfx10_NO_DPP_gfx11_gfx12<0x000>; 11565f757f3fSDimitry Andricdefm V_MOV_B32 : VOP1_Real_gfx6_gfx7_gfx10_FULL_gfx11_gfx12<0x001>; 1157*0fca6ea1SDimitry Andricdefm V_READFIRSTLANE_B32 : VOP1Only_Real_gfx6_gfx7_gfx10_gfx11_gfx12<0x002>; 11585f757f3fSDimitry Andricdefm V_CVT_I32_F64 : VOP1_Real_gfx6_gfx7_gfx10_NO_DPP_gfx11_gfx12<0x003>; 11595f757f3fSDimitry Andricdefm V_CVT_F64_I32 : VOP1_Real_gfx6_gfx7_gfx10_NO_DPP_gfx11_gfx12<0x004>; 11605f757f3fSDimitry Andricdefm V_CVT_F32_I32 : VOP1_Real_gfx6_gfx7_gfx10_FULL_gfx11_gfx12<0x005>; 11615f757f3fSDimitry Andricdefm V_CVT_F32_U32 : VOP1_Real_gfx6_gfx7_gfx10_FULL_gfx11_gfx12<0x006>; 11625f757f3fSDimitry Andricdefm V_CVT_U32_F32 : VOP1_Real_gfx6_gfx7_gfx10_FULL_gfx11_gfx12<0x007>; 11635f757f3fSDimitry Andricdefm V_CVT_I32_F32 : VOP1_Real_gfx6_gfx7_gfx10_FULL_gfx11_gfx12<0x008>; 1164bdd1243dSDimitry Andricdefm V_CVT_F16_F32 : VOP1_Real_gfx6_gfx7_gfx10<0x00a>; 1165bdd1243dSDimitry Andricdefm V_CVT_F32_F16 : VOP1_Real_gfx6_gfx7_gfx10<0x00b>; 11660b57cec5SDimitry Andricdefm V_CVT_RPI_I32_F32 : VOP1_Real_gfx6_gfx7_gfx10<0x00c>; 11670b57cec5SDimitry Andricdefm V_CVT_FLR_I32_F32 : VOP1_Real_gfx6_gfx7_gfx10<0x00d>; 11685f757f3fSDimitry Andricdefm V_CVT_OFF_F32_I4 : VOP1_Real_gfx6_gfx7_gfx10_FULL_gfx11_gfx12<0x00e>; 11695f757f3fSDimitry Andricdefm V_CVT_F32_F64 : VOP1_Real_gfx6_gfx7_gfx10_NO_DPP_gfx11_gfx12<0x00f>; 11705f757f3fSDimitry Andricdefm V_CVT_F64_F32 : VOP1_Real_gfx6_gfx7_gfx10_NO_DPP_gfx11_gfx12<0x010>; 11715f757f3fSDimitry Andricdefm V_CVT_F32_UBYTE0 : VOP1_Real_gfx6_gfx7_gfx10_FULL_gfx11_gfx12<0x011>; 11725f757f3fSDimitry Andricdefm V_CVT_F32_UBYTE1 : VOP1_Real_gfx6_gfx7_gfx10_FULL_gfx11_gfx12<0x012>; 11735f757f3fSDimitry Andricdefm V_CVT_F32_UBYTE2 : VOP1_Real_gfx6_gfx7_gfx10_FULL_gfx11_gfx12<0x013>; 11745f757f3fSDimitry Andricdefm V_CVT_F32_UBYTE3 : VOP1_Real_gfx6_gfx7_gfx10_FULL_gfx11_gfx12<0x014>; 11755f757f3fSDimitry Andricdefm V_CVT_U32_F64 : VOP1_Real_gfx6_gfx7_gfx10_NO_DPP_gfx11_gfx12<0x015>; 11765f757f3fSDimitry Andricdefm V_CVT_F64_U32 : VOP1_Real_gfx6_gfx7_gfx10_NO_DPP_gfx11_gfx12<0x016>; 11775f757f3fSDimitry Andricdefm V_FRACT_F32 : VOP1_Real_gfx6_gfx7_gfx10_FULL_gfx11_gfx12<0x020>; 11785f757f3fSDimitry Andricdefm V_TRUNC_F32 : VOP1_Real_gfx6_gfx7_gfx10_FULL_gfx11_gfx12<0x021>; 11795f757f3fSDimitry Andricdefm V_CEIL_F32 : VOP1_Real_gfx6_gfx7_gfx10_FULL_gfx11_gfx12<0x022>; 11805f757f3fSDimitry Andricdefm V_RNDNE_F32 : VOP1_Real_gfx6_gfx7_gfx10_FULL_gfx11_gfx12<0x023>; 11815f757f3fSDimitry Andricdefm V_FLOOR_F32 : VOP1_Real_gfx6_gfx7_gfx10_FULL_gfx11_gfx12<0x024>; 11825f757f3fSDimitry Andricdefm V_EXP_F32 : VOP1_Real_gfx6_gfx7_gfx10_FULL_gfx11_gfx12<0x025>; 11835f757f3fSDimitry Andricdefm V_LOG_F32 : VOP1_Real_gfx6_gfx7_gfx10_FULL_gfx11_gfx12<0x027>; 11845f757f3fSDimitry Andricdefm V_RCP_F32 : VOP1_Real_gfx6_gfx7_gfx10_FULL_gfx11_gfx12<0x02a>; 11855f757f3fSDimitry Andricdefm V_RCP_IFLAG_F32 : VOP1_Real_gfx6_gfx7_gfx10_FULL_gfx11_gfx12<0x02b>; 11865f757f3fSDimitry Andricdefm V_RSQ_F32 : VOP1_Real_gfx6_gfx7_gfx10_FULL_gfx11_gfx12<0x02e>; 11875f757f3fSDimitry Andricdefm V_RCP_F64 : VOP1_Real_gfx6_gfx7_gfx10_NO_DPP_gfx11_gfx12<0x02f>; 11885f757f3fSDimitry Andricdefm V_RSQ_F64 : VOP1_Real_gfx6_gfx7_gfx10_NO_DPP_gfx11_gfx12<0x031>; 11895f757f3fSDimitry Andricdefm V_SQRT_F32 : VOP1_Real_gfx6_gfx7_gfx10_FULL_gfx11_gfx12<0x033>; 11905f757f3fSDimitry Andricdefm V_SQRT_F64 : VOP1_Real_gfx6_gfx7_gfx10_NO_DPP_gfx11_gfx12<0x034>; 11915f757f3fSDimitry Andricdefm V_SIN_F32 : VOP1_Real_gfx6_gfx7_gfx10_FULL_gfx11_gfx12<0x035>; 11925f757f3fSDimitry Andricdefm V_COS_F32 : VOP1_Real_gfx6_gfx7_gfx10_FULL_gfx11_gfx12<0x036>; 11935f757f3fSDimitry Andricdefm V_NOT_B32 : VOP1_Real_gfx6_gfx7_gfx10_FULL_gfx11_gfx12<0x037>; 11945f757f3fSDimitry Andricdefm V_BFREV_B32 : VOP1_Real_gfx6_gfx7_gfx10_FULL_gfx11_gfx12<0x038>; 11950b57cec5SDimitry Andricdefm V_FFBH_U32 : VOP1_Real_gfx6_gfx7_gfx10<0x039>; 11960b57cec5SDimitry Andricdefm V_FFBL_B32 : VOP1_Real_gfx6_gfx7_gfx10<0x03a>; 11970b57cec5SDimitry Andricdefm V_FFBH_I32 : VOP1_Real_gfx6_gfx7_gfx10<0x03b>; 11985f757f3fSDimitry Andricdefm V_FREXP_EXP_I32_F64 : VOP1_Real_gfx6_gfx7_gfx10_NO_DPP_gfx11_gfx12<0x03c>; 11995f757f3fSDimitry Andricdefm V_FREXP_MANT_F64 : VOP1_Real_gfx6_gfx7_gfx10_NO_DPP_gfx11_gfx12<0x03d>; 12005f757f3fSDimitry Andricdefm V_FRACT_F64 : VOP1_Real_gfx6_gfx7_gfx10_NO_DPP_gfx11_gfx12<0x03e>; 12015f757f3fSDimitry Andricdefm V_FREXP_EXP_I32_F32 : VOP1_Real_gfx6_gfx7_gfx10_FULL_gfx11_gfx12<0x03f>; 12025f757f3fSDimitry Andricdefm V_FREXP_MANT_F32 : VOP1_Real_gfx6_gfx7_gfx10_FULL_gfx11_gfx12<0x040>; 12030b57cec5SDimitry Andricdefm V_CLREXCP : VOP1_Real_gfx6_gfx7_gfx10<0x041>; 12045f757f3fSDimitry Andricdefm V_MOVRELD_B32 : VOP1_Real_gfx6_gfx7_gfx10_FULL_gfx11_gfx12<0x042>; 12055f757f3fSDimitry Andricdefm V_MOVRELS_B32 : VOP1_Real_gfx6_gfx7_gfx10_FULL_gfx11_gfx12<0x043>; 12065f757f3fSDimitry Andricdefm V_MOVRELSD_B32 : VOP1_Real_gfx6_gfx7_gfx10_FULL_gfx11_gfx12<0x044>; 12070b57cec5SDimitry Andric 12080b57cec5SDimitry Andric//===----------------------------------------------------------------------===// 12090b57cec5SDimitry Andric// GFX8, GFX9 (VI). 12100b57cec5SDimitry Andric//===----------------------------------------------------------------------===// 12110b57cec5SDimitry Andric 12120b57cec5SDimitry Andricclass VOP1_DPPe <bits<8> op, VOP1_DPP_Pseudo ps, VOPProfile P = ps.Pfl> : 12130b57cec5SDimitry Andric VOP_DPPe <P> { 12140b57cec5SDimitry Andric bits<8> vdst; 12150b57cec5SDimitry Andric let Inst{8-0} = 0xfa; // dpp 12160b57cec5SDimitry Andric let Inst{16-9} = op; 12170b57cec5SDimitry Andric let Inst{24-17} = !if(P.EmitDst, vdst{7-0}, 0); 12180b57cec5SDimitry Andric let Inst{31-25} = 0x3f; //encoding 12190b57cec5SDimitry Andric} 12200b57cec5SDimitry Andric 1221480093f4SDimitry Andriclet AssemblerPredicate = isGFX8GFX9, DecoderNamespace = "GFX8" in { 1222*0fca6ea1SDimitry Andric multiclass VOP1Only_Real_vi <bits<10> op> { 12230b57cec5SDimitry Andric def _vi : 12240b57cec5SDimitry Andric VOP1_Real<!cast<VOP1_Pseudo>(NAME), SIEncodingFamily.VI>, 12250b57cec5SDimitry Andric VOP1e<op{7-0}, !cast<VOP1_Pseudo>(NAME).Pfl>; 12260b57cec5SDimitry Andric } 12270b57cec5SDimitry Andric 12280b57cec5SDimitry Andric multiclass VOP1_Real_e32e64_vi <bits<10> op> { 12290b57cec5SDimitry Andric def _e32_vi : 12300b57cec5SDimitry Andric VOP1_Real<!cast<VOP1_Pseudo>(NAME#"_e32"), SIEncodingFamily.VI>, 12310b57cec5SDimitry Andric VOP1e<op{7-0}, !cast<VOP1_Pseudo>(NAME#"_e32").Pfl>; 12320b57cec5SDimitry Andric def _e64_vi : 12330b57cec5SDimitry Andric VOP3_Real<!cast<VOP3_Pseudo>(NAME#"_e64"), SIEncodingFamily.VI>, 12340b57cec5SDimitry Andric VOP3e_vi <!add(0x140, op), !cast<VOP3_Pseudo>(NAME#"_e64").Pfl>; 12350b57cec5SDimitry Andric } 12360b57cec5SDimitry Andric} 12370b57cec5SDimitry Andric 12380b57cec5SDimitry Andricmulticlass VOP1_Real_vi <bits<10> op> { 12390b57cec5SDimitry Andric defm NAME : VOP1_Real_e32e64_vi <op>; 12400b57cec5SDimitry Andric 124106c3fb27SDimitry Andric if !cast<VOP1_Pseudo>(NAME#"_e32").Pfl.HasExtSDWA then 12420b57cec5SDimitry Andric def _sdwa_vi : 12430b57cec5SDimitry Andric VOP_SDWA_Real <!cast<VOP1_SDWA_Pseudo>(NAME#"_sdwa")>, 12440b57cec5SDimitry Andric VOP1_SDWAe <op{7-0}, !cast<VOP1_SDWA_Pseudo>(NAME#"_sdwa").Pfl>; 12450b57cec5SDimitry Andric 124606c3fb27SDimitry Andric if !cast<VOP1_Pseudo>(NAME#"_e32").Pfl.HasExtSDWA9 then 12470b57cec5SDimitry Andric def _sdwa_gfx9 : 12480b57cec5SDimitry Andric VOP_SDWA9_Real <!cast<VOP1_SDWA_Pseudo>(NAME#"_sdwa")>, 12490b57cec5SDimitry Andric VOP1_SDWA9Ae <op{7-0}, !cast<VOP1_SDWA_Pseudo>(NAME#"_sdwa").Pfl>; 12500b57cec5SDimitry Andric 125106c3fb27SDimitry Andric if !cast<VOP1_Pseudo>(NAME#"_e32").Pfl.HasExtDPP then 12520b57cec5SDimitry Andric def _dpp_vi : 12530b57cec5SDimitry Andric VOP_DPP_Real<!cast<VOP1_DPP_Pseudo>(NAME#"_dpp"), SIEncodingFamily.VI>, 12540b57cec5SDimitry Andric VOP1_DPPe<op{7-0}, !cast<VOP1_DPP_Pseudo>(NAME#"_dpp")>; 12550b57cec5SDimitry Andric} 12560b57cec5SDimitry Andric 12570b57cec5SDimitry Andricdefm V_NOP : VOP1_Real_vi <0x0>; 12580b57cec5SDimitry Andricdefm V_MOV_B32 : VOP1_Real_vi <0x1>; 1259*0fca6ea1SDimitry Andricdefm V_READFIRSTLANE_B32 : VOP1Only_Real_vi <0x2>; 12600b57cec5SDimitry Andricdefm V_CVT_I32_F64 : VOP1_Real_vi <0x3>; 12610b57cec5SDimitry Andricdefm V_CVT_F64_I32 : VOP1_Real_vi <0x4>; 12620b57cec5SDimitry Andricdefm V_CVT_F32_I32 : VOP1_Real_vi <0x5>; 12630b57cec5SDimitry Andricdefm V_CVT_F32_U32 : VOP1_Real_vi <0x6>; 12640b57cec5SDimitry Andricdefm V_CVT_U32_F32 : VOP1_Real_vi <0x7>; 12650b57cec5SDimitry Andricdefm V_CVT_I32_F32 : VOP1_Real_vi <0x8>; 12660b57cec5SDimitry Andricdefm V_CVT_F16_F32 : VOP1_Real_vi <0xa>; 12670b57cec5SDimitry Andricdefm V_CVT_F32_F16 : VOP1_Real_vi <0xb>; 12680b57cec5SDimitry Andricdefm V_CVT_RPI_I32_F32 : VOP1_Real_vi <0xc>; 12690b57cec5SDimitry Andricdefm V_CVT_FLR_I32_F32 : VOP1_Real_vi <0xd>; 12700b57cec5SDimitry Andricdefm V_CVT_OFF_F32_I4 : VOP1_Real_vi <0xe>; 12710b57cec5SDimitry Andricdefm V_CVT_F32_F64 : VOP1_Real_vi <0xf>; 12720b57cec5SDimitry Andricdefm V_CVT_F64_F32 : VOP1_Real_vi <0x10>; 12730b57cec5SDimitry Andricdefm V_CVT_F32_UBYTE0 : VOP1_Real_vi <0x11>; 12740b57cec5SDimitry Andricdefm V_CVT_F32_UBYTE1 : VOP1_Real_vi <0x12>; 12750b57cec5SDimitry Andricdefm V_CVT_F32_UBYTE2 : VOP1_Real_vi <0x13>; 12760b57cec5SDimitry Andricdefm V_CVT_F32_UBYTE3 : VOP1_Real_vi <0x14>; 12770b57cec5SDimitry Andricdefm V_CVT_U32_F64 : VOP1_Real_vi <0x15>; 12780b57cec5SDimitry Andricdefm V_CVT_F64_U32 : VOP1_Real_vi <0x16>; 12790b57cec5SDimitry Andricdefm V_FRACT_F32 : VOP1_Real_vi <0x1b>; 12800b57cec5SDimitry Andricdefm V_TRUNC_F32 : VOP1_Real_vi <0x1c>; 12810b57cec5SDimitry Andricdefm V_CEIL_F32 : VOP1_Real_vi <0x1d>; 12820b57cec5SDimitry Andricdefm V_RNDNE_F32 : VOP1_Real_vi <0x1e>; 12830b57cec5SDimitry Andricdefm V_FLOOR_F32 : VOP1_Real_vi <0x1f>; 12840b57cec5SDimitry Andricdefm V_EXP_F32 : VOP1_Real_vi <0x20>; 12850b57cec5SDimitry Andricdefm V_LOG_F32 : VOP1_Real_vi <0x21>; 12860b57cec5SDimitry Andricdefm V_RCP_F32 : VOP1_Real_vi <0x22>; 12870b57cec5SDimitry Andricdefm V_RCP_IFLAG_F32 : VOP1_Real_vi <0x23>; 12880b57cec5SDimitry Andricdefm V_RSQ_F32 : VOP1_Real_vi <0x24>; 12890b57cec5SDimitry Andricdefm V_RCP_F64 : VOP1_Real_vi <0x25>; 12900b57cec5SDimitry Andricdefm V_RSQ_F64 : VOP1_Real_vi <0x26>; 12910b57cec5SDimitry Andricdefm V_SQRT_F32 : VOP1_Real_vi <0x27>; 12920b57cec5SDimitry Andricdefm V_SQRT_F64 : VOP1_Real_vi <0x28>; 12930b57cec5SDimitry Andricdefm V_SIN_F32 : VOP1_Real_vi <0x29>; 12940b57cec5SDimitry Andricdefm V_COS_F32 : VOP1_Real_vi <0x2a>; 12950b57cec5SDimitry Andricdefm V_NOT_B32 : VOP1_Real_vi <0x2b>; 12960b57cec5SDimitry Andricdefm V_BFREV_B32 : VOP1_Real_vi <0x2c>; 12970b57cec5SDimitry Andricdefm V_FFBH_U32 : VOP1_Real_vi <0x2d>; 12980b57cec5SDimitry Andricdefm V_FFBL_B32 : VOP1_Real_vi <0x2e>; 12990b57cec5SDimitry Andricdefm V_FFBH_I32 : VOP1_Real_vi <0x2f>; 13000b57cec5SDimitry Andricdefm V_FREXP_EXP_I32_F64 : VOP1_Real_vi <0x30>; 13010b57cec5SDimitry Andricdefm V_FREXP_MANT_F64 : VOP1_Real_vi <0x31>; 13020b57cec5SDimitry Andricdefm V_FRACT_F64 : VOP1_Real_vi <0x32>; 13030b57cec5SDimitry Andricdefm V_FREXP_EXP_I32_F32 : VOP1_Real_vi <0x33>; 13040b57cec5SDimitry Andricdefm V_FREXP_MANT_F32 : VOP1_Real_vi <0x34>; 13050b57cec5SDimitry Andricdefm V_CLREXCP : VOP1_Real_vi <0x35>; 13060b57cec5SDimitry Andricdefm V_MOVRELD_B32 : VOP1_Real_e32e64_vi <0x36>; 13070b57cec5SDimitry Andricdefm V_MOVRELS_B32 : VOP1_Real_e32e64_vi <0x37>; 13080b57cec5SDimitry Andricdefm V_MOVRELSD_B32 : VOP1_Real_e32e64_vi <0x38>; 13090b57cec5SDimitry Andricdefm V_TRUNC_F64 : VOP1_Real_vi <0x17>; 13100b57cec5SDimitry Andricdefm V_CEIL_F64 : VOP1_Real_vi <0x18>; 13110b57cec5SDimitry Andricdefm V_FLOOR_F64 : VOP1_Real_vi <0x1A>; 13120b57cec5SDimitry Andricdefm V_RNDNE_F64 : VOP1_Real_vi <0x19>; 13130b57cec5SDimitry Andricdefm V_LOG_LEGACY_F32 : VOP1_Real_vi <0x4c>; 13140b57cec5SDimitry Andricdefm V_EXP_LEGACY_F32 : VOP1_Real_vi <0x4b>; 13150b57cec5SDimitry Andricdefm V_CVT_F16_U16 : VOP1_Real_vi <0x39>; 13160b57cec5SDimitry Andricdefm V_CVT_F16_I16 : VOP1_Real_vi <0x3a>; 13170b57cec5SDimitry Andricdefm V_CVT_U16_F16 : VOP1_Real_vi <0x3b>; 13180b57cec5SDimitry Andricdefm V_CVT_I16_F16 : VOP1_Real_vi <0x3c>; 13190b57cec5SDimitry Andricdefm V_RCP_F16 : VOP1_Real_vi <0x3d>; 13200b57cec5SDimitry Andricdefm V_SQRT_F16 : VOP1_Real_vi <0x3e>; 13210b57cec5SDimitry Andricdefm V_RSQ_F16 : VOP1_Real_vi <0x3f>; 13220b57cec5SDimitry Andricdefm V_LOG_F16 : VOP1_Real_vi <0x40>; 13230b57cec5SDimitry Andricdefm V_EXP_F16 : VOP1_Real_vi <0x41>; 13240b57cec5SDimitry Andricdefm V_FREXP_MANT_F16 : VOP1_Real_vi <0x42>; 13250b57cec5SDimitry Andricdefm V_FREXP_EXP_I16_F16 : VOP1_Real_vi <0x43>; 13260b57cec5SDimitry Andricdefm V_FLOOR_F16 : VOP1_Real_vi <0x44>; 13270b57cec5SDimitry Andricdefm V_CEIL_F16 : VOP1_Real_vi <0x45>; 13280b57cec5SDimitry Andricdefm V_TRUNC_F16 : VOP1_Real_vi <0x46>; 13290b57cec5SDimitry Andricdefm V_RNDNE_F16 : VOP1_Real_vi <0x47>; 13300b57cec5SDimitry Andricdefm V_FRACT_F16 : VOP1_Real_vi <0x48>; 13310b57cec5SDimitry Andricdefm V_SIN_F16 : VOP1_Real_vi <0x49>; 13320b57cec5SDimitry Andricdefm V_COS_F16 : VOP1_Real_vi <0x4a>; 13330b57cec5SDimitry Andricdefm V_SWAP_B32 : VOP1Only_Real_vi <0x51>; 13340b57cec5SDimitry Andric 13350b57cec5SDimitry Andricdefm V_SAT_PK_U8_I16 : VOP1_Real_vi<0x4f>; 13360b57cec5SDimitry Andricdefm V_CVT_NORM_I16_F16 : VOP1_Real_vi<0x4d>; 13370b57cec5SDimitry Andricdefm V_CVT_NORM_U16_F16 : VOP1_Real_vi<0x4e>; 13380b57cec5SDimitry Andric 1339fe6060f1SDimitry Andricdefm V_ACCVGPR_MOV_B32 : VOP1Only_Real_vi<0x52>; 1340fe6060f1SDimitry Andric 13415f757f3fSDimitry Andriclet VOP1 = 1, SubtargetPredicate = isGFX8GFX9, Uses = [EXEC, M0], Size = V_MOV_B32_e32.Size in { 1342349cc55cSDimitry Andric 13430b57cec5SDimitry Andric// Copy of v_mov_b32 with $vdst as a use operand for use with VGPR 13440b57cec5SDimitry Andric// indexing mode. vdst can't be treated as a def for codegen purposes, 13450b57cec5SDimitry Andric// and an implicit use and def of the super register should be added. 1346349cc55cSDimitry Andricdef V_MOV_B32_indirect_write : VPseudoInstSI<(outs), 1347bdd1243dSDimitry Andric (ins getVALUDstForVT<i32>.ret:$vdst, getVOPSrc0ForVT<i32, 0>.ret:$src0)>, 13480b57cec5SDimitry Andric PseudoInstExpansion<(V_MOV_B32_e32_vi getVALUDstForVT<i32>.ret:$vdst, 1349bdd1243dSDimitry Andric getVOPSrc0ForVT<i32, 0>.ret:$src0)>; 1350349cc55cSDimitry Andric 1351349cc55cSDimitry Andric// Copy of v_mov_b32 for use with VGPR indexing mode. An implicit use of the 1352349cc55cSDimitry Andric// super register should be added. 1353349cc55cSDimitry Andricdef V_MOV_B32_indirect_read : VPseudoInstSI< 1354349cc55cSDimitry Andric (outs getVALUDstForVT<i32>.ret:$vdst), 1355bdd1243dSDimitry Andric (ins getVOPSrc0ForVT<i32, 0>.ret:$src0)>, 1356349cc55cSDimitry Andric PseudoInstExpansion<(V_MOV_B32_e32_vi getVALUDstForVT<i32>.ret:$vdst, 1357bdd1243dSDimitry Andric getVOPSrc0ForVT<i32, 0>.ret:$src0)>; 1358349cc55cSDimitry Andric 1359349cc55cSDimitry Andric} // End VOP1 = 1, SubtargetPredicate = isGFX8GFX9, Uses = [M0] 13600b57cec5SDimitry Andric 13618bcb0991SDimitry Andriclet OtherPredicates = [isGFX8Plus] in { 13620b57cec5SDimitry Andric 13630b57cec5SDimitry Andricdef : GCNPat < 13645ffd83dbSDimitry Andric (i32 (int_amdgcn_mov_dpp i32:$src, timm:$dpp_ctrl, timm:$row_mask, 13655ffd83dbSDimitry Andric timm:$bank_mask, timm:$bound_ctrl)), 13665ffd83dbSDimitry Andric (V_MOV_B32_dpp VGPR_32:$src, VGPR_32:$src, (as_i32timm $dpp_ctrl), 13675ffd83dbSDimitry Andric (as_i32timm $row_mask), (as_i32timm $bank_mask), 13685ffd83dbSDimitry Andric (as_i1timm $bound_ctrl)) 13690b57cec5SDimitry Andric>; 13700b57cec5SDimitry Andric 1371*0fca6ea1SDimitry Andricforeach vt = Reg32Types.types in { 1372*0fca6ea1SDimitry Andricdef : GCNPat < 13735f757f3fSDimitry Andric (vt (int_amdgcn_update_dpp vt:$old, vt:$src, timm:$dpp_ctrl, 13745ffd83dbSDimitry Andric timm:$row_mask, timm:$bank_mask, 13755ffd83dbSDimitry Andric timm:$bound_ctrl)), 13765ffd83dbSDimitry Andric (V_MOV_B32_dpp VGPR_32:$old, VGPR_32:$src, (as_i32timm $dpp_ctrl), 13775ffd83dbSDimitry Andric (as_i32timm $row_mask), (as_i32timm $bank_mask), 13785ffd83dbSDimitry Andric (as_i1timm $bound_ctrl)) 13790b57cec5SDimitry Andric>; 1380*0fca6ea1SDimitry Andric} 13815f757f3fSDimitry Andric 13828bcb0991SDimitry Andric} // End OtherPredicates = [isGFX8Plus] 13830b57cec5SDimitry Andric 13840b57cec5SDimitry Andriclet OtherPredicates = [isGFX8Plus] in { 13850b57cec5SDimitry Andricdef : GCNPat< 13860b57cec5SDimitry Andric (i32 (anyext i16:$src)), 13870b57cec5SDimitry Andric (COPY $src) 13880b57cec5SDimitry Andric>; 13890b57cec5SDimitry Andric 13900b57cec5SDimitry Andricdef : GCNPat< 13910b57cec5SDimitry Andric (i64 (anyext i16:$src)), 13920b57cec5SDimitry Andric (REG_SEQUENCE VReg_64, 13930b57cec5SDimitry Andric (i32 (COPY $src)), sub0, 13940b57cec5SDimitry Andric (V_MOV_B32_e32 (i32 0)), sub1) 13950b57cec5SDimitry Andric>; 13960b57cec5SDimitry Andric 13970b57cec5SDimitry Andricdef : GCNPat< 13980b57cec5SDimitry Andric (i16 (trunc i32:$src)), 13990b57cec5SDimitry Andric (COPY $src) 14000b57cec5SDimitry Andric>; 14010b57cec5SDimitry Andric 14020b57cec5SDimitry Andricdef : GCNPat < 14030b57cec5SDimitry Andric (i16 (trunc i64:$src)), 14040b57cec5SDimitry Andric (EXTRACT_SUBREG $src, sub0) 14050b57cec5SDimitry Andric>; 14060b57cec5SDimitry Andric 14070b57cec5SDimitry Andric} // End OtherPredicates = [isGFX8Plus] 14080b57cec5SDimitry Andric 14090b57cec5SDimitry Andric//===----------------------------------------------------------------------===// 14100b57cec5SDimitry Andric// GFX9 14110b57cec5SDimitry Andric//===----------------------------------------------------------------------===// 14120b57cec5SDimitry Andric 1413480093f4SDimitry Andriclet AssemblerPredicate = isGFX9Only, DecoderNamespace = "GFX9" in { 1414*0fca6ea1SDimitry Andric multiclass VOP1_Real_gfx9 <bits<10> op> { 14150b57cec5SDimitry Andric defm NAME : VOP1_Real_e32e64_vi <op>; 14160b57cec5SDimitry Andric 141706c3fb27SDimitry Andric if !cast<VOP1_Pseudo>(NAME#"_e32").Pfl.HasExtSDWA9 then 14180b57cec5SDimitry Andric def _sdwa_gfx9 : 14190b57cec5SDimitry Andric VOP_SDWA9_Real <!cast<VOP1_SDWA_Pseudo>(NAME#"_sdwa")>, 14200b57cec5SDimitry Andric VOP1_SDWA9Ae <op{7-0}, !cast<VOP1_SDWA_Pseudo>(NAME#"_sdwa").Pfl>; 14210b57cec5SDimitry Andric 142206c3fb27SDimitry Andric if !cast<VOP1_Pseudo>(NAME#"_e32").Pfl.HasExtDPP then 14230b57cec5SDimitry Andric def _dpp_gfx9 : 14240b57cec5SDimitry Andric VOP_DPP_Real<!cast<VOP1_DPP_Pseudo>(NAME#"_dpp"), SIEncodingFamily.GFX9>, 14250b57cec5SDimitry Andric VOP1_DPPe<op{7-0}, !cast<VOP1_DPP_Pseudo>(NAME#"_dpp")>; 14260b57cec5SDimitry Andric } 14270b57cec5SDimitry Andric 1428fcaf7f86SDimitry Andric multiclass VOP1_Real_NoDstSel_SDWA_gfx9 <bits<10> op> { 1429fcaf7f86SDimitry Andric defm NAME : VOP1_Real_e32e64_vi <op>; 1430fcaf7f86SDimitry Andric 143106c3fb27SDimitry Andric if !cast<VOP1_Pseudo>(NAME#"_e32").Pfl.HasExtSDWA9 then 1432fcaf7f86SDimitry Andric def _sdwa_gfx9 : 1433fcaf7f86SDimitry Andric VOP_SDWA9_Real <!cast<VOP1_SDWA_Pseudo>(NAME#"_sdwa")>, 1434fcaf7f86SDimitry Andric VOP1_SDWA9Ae <op{7-0}, !cast<VOP1_SDWA_Pseudo>(NAME#"_sdwa").Pfl> { 1435fcaf7f86SDimitry Andric let Inst{42-40} = 6; 1436fcaf7f86SDimitry Andric } 1437fcaf7f86SDimitry Andric 143806c3fb27SDimitry Andric if !cast<VOP1_Pseudo>(NAME#"_e32").Pfl.HasExtDPP then 1439fcaf7f86SDimitry Andric def _dpp_gfx9 : 1440fcaf7f86SDimitry Andric VOP_DPP_Real<!cast<VOP1_DPP_Pseudo>(NAME#"_dpp"), SIEncodingFamily.GFX9>, 1441fcaf7f86SDimitry Andric VOP1_DPPe<op{7-0}, !cast<VOP1_DPP_Pseudo>(NAME#"_dpp")>; 1442fcaf7f86SDimitry Andric } 1443*0fca6ea1SDimitry Andric} 1444fcaf7f86SDimitry Andric 14450b57cec5SDimitry Andricdefm V_SCREEN_PARTITION_4SE_B32 : VOP1_Real_gfx9 <0x37>; 14460b57cec5SDimitry Andric 1447*0fca6ea1SDimitry Andriclet AssemblerPredicate = isGFX940Plus in 144881ad6265SDimitry Andricdefm V_MOV_B64 : VOP1_Real_gfx9 <0x38>; 144981ad6265SDimitry Andric 1450fcaf7f86SDimitry Andricdefm V_CVT_F32_FP8 : VOP1_Real_NoDstSel_SDWA_gfx9<0x54>; 1451fcaf7f86SDimitry Andricdefm V_CVT_F32_BF8 : VOP1_Real_NoDstSel_SDWA_gfx9<0x55>; 1452fcaf7f86SDimitry Andricdefm V_CVT_PK_F32_FP8 : VOP1_Real_NoDstSel_SDWA_gfx9<0x56>; 1453fcaf7f86SDimitry Andricdefm V_CVT_PK_F32_BF8 : VOP1_Real_NoDstSel_SDWA_gfx9<0x57>; 1454*0fca6ea1SDimitry Andric 1455*0fca6ea1SDimitry Andricclass MovDPP8Pattern<Predicate Pred, Instruction Inst> : GCNPat < 1456*0fca6ea1SDimitry Andric (i32 (int_amdgcn_mov_dpp8 i32:$src, timm:$dpp8)), 1457*0fca6ea1SDimitry Andric (Inst VGPR_32:$src, VGPR_32:$src, (as_i32timm $dpp8), (i32 DPP8Mode.FI_0))> { 1458*0fca6ea1SDimitry Andric let OtherPredicates = [Pred]; 1459fcaf7f86SDimitry Andric} 1460fcaf7f86SDimitry Andric 1461*0fca6ea1SDimitry Andricdef : MovDPP8Pattern<isGFX10Only, V_MOV_B32_dpp8_gfx10>; 1462*0fca6ea1SDimitry Andricdef : MovDPP8Pattern<isGFX11Only, V_MOV_B32_dpp8_gfx11>; 1463*0fca6ea1SDimitry Andricdef : MovDPP8Pattern<isGFX12Only, V_MOV_B32_dpp8_gfx12>; 1464