@@ -1146,6 +1146,21 @@ let SubtargetPredicate = HasGFX950Insts, mayRaiseFPException = 0 in {
11461146 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>;
11471147}
11481148
1149+ let SubtargetPredicate = HasCvtPkF16F32Inst in {
1150+ let ReadsModeReg = 0 in {
1151+ defm V_CVT_PK_F16_F32 : VOP3Inst<"v_cvt_pk_f16_f32", VOP3_Profile<VOP_V2F16_F32_F32>>;
1152+ }
1153+
1154+ def : GCNPat<(v2f16 (fpround v2f32:$src)),
1155+ (V_CVT_PK_F16_F32_e64 0, (EXTRACT_SUBREG VReg_64:$src, sub0), 0, (EXTRACT_SUBREG VReg_64:$src, sub1))>;
1156+ def : GCNPat<(v2f16 (fpround v2f64:$src)),
1157+ (V_CVT_PK_F16_F32_e64 0, (V_CVT_F32_F64_e64 0, (EXTRACT_SUBREG VReg_128:$src, sub0_sub1)),
1158+ 0, (V_CVT_F32_F64_e64 0, (EXTRACT_SUBREG VReg_128:$src, sub2_sub3)))>;
1159+ def : GCNPat<(v2f16 (build_vector (f16 (fpround (f32 (VOP3Mods f32:$src0, i32:$src0_modifiers)))),
1160+ (f16 (fpround (f32 (VOP3Mods f32:$src1, i32:$src1_modifiers)))))),
1161+ (V_CVT_PK_F16_F32_e64 $src0_modifiers, $src0, $src1_modifiers, $src1)>;
1162+ }
1163+
11491164class Cvt_Scale_FP4FP8BF8ToF16F32_Pat<SDPatternOperator node, VOP3_Pseudo inst, ValueType DstTy> : GCNPat<
11501165 (DstTy (node i32:$src0, f32:$src1, timm:$index)),
11511166 (inst (SrcAndDstSelToOpSelXForm_0_0 $index), $src0, (SrcAndDstSelToOpSelXForm_1_0 $index), $src1)
@@ -2250,6 +2265,9 @@ defm V_CVT_SR_BF16_F32: VOP3OpSel_Real_gfx9 <0x2a7>;
22502265
22512266defm V_ASHR_PK_I8_I32 : VOP3OpSel_Real_gfx9 <0x265>;
22522267defm V_ASHR_PK_U8_I32 : VOP3OpSel_Real_gfx9 <0x266>;
2268+ let OtherPredicates = [HasCvtPkF16F32Inst] in {
2269+ defm V_CVT_PK_F16_F32 : VOP3_Real_gfx9<0x267, "v_cvt_pk_f16_f32">;
2270+ }
22532271
22542272defm V_CVT_SCALEF32_2XPK16_FP6_F32 : VOP3_Real_gfx9<0x252, "v_cvt_scalef32_2xpk16_fp6_f32">;
22552273defm V_CVT_SCALEF32_2XPK16_BF6_F32 : VOP3_Real_gfx9<0x253, "v_cvt_scalef32_2xpk16_bf6_f32">;
0 commit comments