@@ -1143,6 +1143,21 @@ let SubtargetPredicate = HasGFX950Insts, mayRaiseFPException = 0 in {
11431143 defm V_CVT_SCALEF32_2XPK16_BF6_F32 : VOP3Inst<"v_cvt_scalef32_2xpk16_bf6_f32", VOP3_CVT_SCALEF32_PK_F864_Profile<VOP_V6I32_V16F32_V16F32_F32>, int_amdgcn_cvt_scalef32_2xpk16_bf6_f32>;
11441144}
11451145
1146+ let SubtargetPredicate = HasCvtPkF16F32Inst in {
1147+ let ReadsModeReg = 0 in {
1148+ defm V_CVT_PK_F16_F32 : VOP3Inst<"v_cvt_pk_f16_f32", VOP3_Profile<VOP_V2F16_F32_F32>>;
1149+ }
1150+
1151+ def : GCNPat<(v2f16 (fpround v2f32:$src)),
1152+ (V_CVT_PK_F16_F32_e64 0, (EXTRACT_SUBREG VReg_64:$src, sub0), 0, (EXTRACT_SUBREG VReg_64:$src, sub1))>;
1153+ def : GCNPat<(v2f16 (fpround v2f64:$src)),
1154+ (V_CVT_PK_F16_F32_e64 0, (V_CVT_F32_F64_e64 0, (EXTRACT_SUBREG VReg_128:$src, sub0_sub1)),
1155+ 0, (V_CVT_F32_F64_e64 0, (EXTRACT_SUBREG VReg_128:$src, sub2_sub3)))>;
1156+ def : GCNPat<(v2f16 (build_vector (f16 (fpround (f32 (VOP3Mods f32:$src0, i32:$src0_modifiers)))),
1157+ (f16 (fpround (f32 (VOP3Mods f32:$src1, i32:$src1_modifiers)))))),
1158+ (V_CVT_PK_F16_F32_e64 $src0_modifiers, $src0, $src1_modifiers, $src1)>;
1159+ }
1160+
11461161class Cvt_Scale_FP4FP8BF8ToF16F32_Pat<SDPatternOperator node, VOP3_Pseudo inst, ValueType DstTy> : GCNPat<
11471162 (DstTy (node i32:$src0, f32:$src1, timm:$index)),
11481163 (inst (SrcAndDstSelToOpSelXForm_0_0 $index), $src0, (SrcAndDstSelToOpSelXForm_1_0 $index), $src1)
@@ -2270,6 +2285,9 @@ defm V_CVT_SR_BF16_F32: VOP3OpSel_Real_gfx9 <0x2a7>;
22702285
22712286defm V_ASHR_PK_I8_I32 : VOP3OpSel_Real_gfx9 <0x265>;
22722287defm V_ASHR_PK_U8_I32 : VOP3OpSel_Real_gfx9 <0x266>;
2288+ let OtherPredicates = [HasCvtPkF16F32Inst] in {
2289+ defm V_CVT_PK_F16_F32 : VOP3_Real_gfx9<0x267, "v_cvt_pk_f16_f32">;
2290+ }
22732291
22742292defm V_CVT_SCALEF32_2XPK16_FP6_F32 : VOP3_Real_gfx9<0x252, "v_cvt_scalef32_2xpk16_fp6_f32">;
22752293defm V_CVT_SCALEF32_2XPK16_BF6_F32 : VOP3_Real_gfx9<0x253, "v_cvt_scalef32_2xpk16_bf6_f32">;
0 commit comments