@@ -1147,6 +1147,21 @@ let SubtargetPredicate = HasGFX950Insts, mayRaiseFPException = 0 in {
11471147 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>;
11481148}
11491149
1150+ let SubtargetPredicate = HasCvtPkF16F32Inst in {
1151+ let ReadsModeReg = 0 in {
1152+ defm V_CVT_PK_F16_F32 : VOP3Inst<"v_cvt_pk_f16_f32", VOP3_Profile<VOP_V2F16_F32_F32>>;
1153+ }
1154+
1155+ def : GCNPat<(v2f16 (fpround v2f32:$src)),
1156+ (V_CVT_PK_F16_F32_e64 0, (EXTRACT_SUBREG VReg_64:$src, sub0), 0, (EXTRACT_SUBREG VReg_64:$src, sub1))>;
1157+ def : GCNPat<(v2f16 (fpround v2f64:$src)),
1158+ (V_CVT_PK_F16_F32_e64 0, (V_CVT_F32_F64_e64 0, (EXTRACT_SUBREG VReg_128:$src, sub0_sub1)),
1159+ 0, (V_CVT_F32_F64_e64 0, (EXTRACT_SUBREG VReg_128:$src, sub2_sub3)))>;
1160+ def : GCNPat<(v2f16 (build_vector (f16 (fpround (f32 (VOP3Mods f32:$src0, i32:$src0_modifiers)))),
1161+ (f16 (fpround (f32 (VOP3Mods f32:$src1, i32:$src1_modifiers)))))),
1162+ (V_CVT_PK_F16_F32_e64 $src0_modifiers, $src0, $src1_modifiers, $src1)>;
1163+ }
1164+
11501165class Cvt_Scale_FP4FP8BF8ToF16F32_Pat<SDPatternOperator node, VOP3_Pseudo inst, ValueType DstTy> : GCNPat<
11511166 (DstTy (node i32:$src0, f32:$src1, timm:$index)),
11521167 (inst (SrcAndDstSelToOpSelXForm_0_0 $index), $src0, (SrcAndDstSelToOpSelXForm_1_0 $index), $src1)
@@ -2274,6 +2289,9 @@ defm V_CVT_SR_BF16_F32: VOP3OpSel_Real_gfx9 <0x2a7>;
22742289
22752290defm V_ASHR_PK_I8_I32 : VOP3OpSel_Real_gfx9 <0x265>;
22762291defm V_ASHR_PK_U8_I32 : VOP3OpSel_Real_gfx9 <0x266>;
2292+ let OtherPredicates = [HasCvtPkF16F32Inst] in {
2293+ defm V_CVT_PK_F16_F32 : VOP3_Real_gfx9<0x267, "v_cvt_pk_f16_f32">;
2294+ }
22772295
22782296defm V_CVT_SCALEF32_2XPK16_FP6_F32 : VOP3_Real_gfx9<0x252, "v_cvt_scalef32_2xpk16_fp6_f32">;
22792297defm V_CVT_SCALEF32_2XPK16_BF6_F32 : VOP3_Real_gfx9<0x253, "v_cvt_scalef32_2xpk16_bf6_f32">;
0 commit comments