@@ -676,13 +676,14 @@ let HasClamp = 0, HasOMod = 0, HasExtDPP = 0, HasExtVOP3DPP = 0,
676
676
}
677
677
}
678
678
679
- class VOPProfile_Base_CVT_F_F8_ByteSel<ValueType DstVT> : VOPProfile<[DstVT, i32, untyped, untyped]> {
679
+ class VOPProfile_Base_CVT_F_F8_ByteSel<ValueType DstVT, bit _HasClamp = 0> :
680
+ VOPProfile<[DstVT, i32, untyped, untyped]> {
681
+ let HasClamp = _HasClamp;
680
682
let HasFP8SrcByteSel = 1;
681
683
let HasOpSel = 0;
682
684
let HasExtDPP = 1;
683
685
let HasExtVOP3DPP = 1;
684
686
let HasExtSDWA = 0;
685
- let HasClamp = 0;
686
687
let HasOMod = 0;
687
688
let HasModifiers = 0;
688
689
}
@@ -695,7 +696,12 @@ def V_CVT_F16_F8_Fake16_Profile : VOP3_Profile_Fake16<V_CVT_F16_F8_Profile>;
695
696
696
697
let SubtargetPredicate = isGFX12Plus, OtherPredicates = [HasFP8ConversionInsts],
697
698
mayRaiseFPException = 0, SchedRW = [WriteFloatCvt] in {
698
- defm V_CVT_F32_FP8_OP_SEL : VOP1Inst<"v_cvt_f32_fp8_op_sel", VOPProfile_Base_CVT_F_F8_ByteSel<f32>>;
699
+ // FIXME: This differs from downstream due to changes that haven't been upstreamed yet.
700
+ let SubtargetPredicate = isGFX12PlusNot12_50 in
701
+ defm V_CVT_F32_FP8_OP_SEL : VOP1Inst<"v_cvt_f32_fp8_op_sel", VOPProfile_Base_CVT_F_F8_ByteSel<f32>>;
702
+ let SubtargetPredicate = isGFX125xOnly in
703
+ defm V_CVT_F32_FP8_gfx1250 : VOP1Inst<"v_cvt_f32_fp8_gfx1250", VOPProfile_Base_CVT_F_F8_ByteSel<f32, 1>>;
704
+
699
705
defm V_CVT_F32_BF8_OP_SEL : VOP1Inst<"v_cvt_f32_bf8_op_sel", VOPProfile_Base_CVT_F_F8_ByteSel<f32>>;
700
706
701
707
let True16Predicate = UseFakeTrue16Insts in {
@@ -714,9 +720,19 @@ class Cvt_F_F8_Pat_ByteSel<SDPatternOperator node, VOP3_Pseudo inst, bit HasOpSe
714
720
(inst $src0, (as_i32timm $byte_sel)))
715
721
>;
716
722
717
- let SubtargetPredicate = isGFX12Plus, OtherPredicates = [HasFP8ConversionInsts] in {
718
- def : Cvt_F_F8_Pat_ByteSel<int_amdgcn_cvt_f32_fp8, V_CVT_F32_FP8_OP_SEL_e64>;
719
- def : Cvt_F_F8_Pat_ByteSel<int_amdgcn_cvt_f32_bf8, V_CVT_F32_BF8_OP_SEL_e64>;
723
+ let OtherPredicates = [HasFP8ConversionInsts] in {
724
+ // FIXME: This differs from downstream due to changes that haven't been upstreamed yet.
725
+ let SubtargetPredicate = isGFX12PlusNot12_50 in
726
+ def : Cvt_F_F8_Pat_ByteSel<int_amdgcn_cvt_f32_fp8, V_CVT_F32_FP8_OP_SEL_e64>;
727
+ let SubtargetPredicate = isGFX125xOnly in {
728
+ def : GCNPat<(int_amdgcn_cvt_f32_fp8 i32:$src0, timm:$byte_sel),
729
+ (V_CVT_F32_FP8_gfx1250_e64 $src0, DSTCLAMP.NONE, (as_i32timm $byte_sel))>;
730
+ def : GCNPat<(int_amdgcn_cvt_f32_fp8_e5m3 i32:$src0, timm:$byte_sel),
731
+ (V_CVT_F32_FP8_gfx1250_e64 $src0, DSTCLAMP.ENABLE, (as_i32timm $byte_sel))>;
732
+ }
733
+ // FIXME: This differs from downstream due to changes that haven't been upstreamed yet.
734
+ let SubtargetPredicate = isGFX12Plus in
735
+ def : Cvt_F_F8_Pat_ByteSel<int_amdgcn_cvt_f32_bf8, V_CVT_F32_BF8_OP_SEL_e64>;
720
736
}
721
737
722
738
class Cvt_PK_F32_F8_Pat_OpSel<SDPatternOperator node, int index,
@@ -1038,7 +1054,9 @@ multiclass VOP1_Real_FULL_t16_and_fake16_gfx1250<
1038
1054
VOP1_Real_FULL_with_name<GFX1250Gen, op, opName#"_fake16", asmName>;
1039
1055
}
1040
1056
1041
- defm V_CVT_F32_FP8 : VOP1_Real_FULL_with_name<GFX12Gen, 0x06c, "V_CVT_F32_FP8_OP_SEL", "v_cvt_f32_fp8">;
1057
+ defm V_CVT_F32_FP8 : VOP1_Real_FULL_with_name<GFX12Not12_50Gen, 0x06c, "V_CVT_F32_FP8_OP_SEL", "v_cvt_f32_fp8">;
1058
+ defm V_CVT_F32_FP8 : VOP1_Real_FULL_with_name<GFX1250Gen, 0x06c, "V_CVT_F32_FP8_gfx1250", "v_cvt_f32_fp8">;
1059
+
1042
1060
defm V_CVT_F32_BF8 : VOP1_Real_FULL_with_name<GFX12Gen, 0x06d, "V_CVT_F32_BF8_OP_SEL", "v_cvt_f32_bf8">;
1043
1061
1044
1062
defm V_CVT_PK_F32_FP8_fake16 : VOP1_Real_e32_with_name<GFX12Gen, 0x06e, "V_CVT_PK_F32_FP8_fake16", "v_cvt_pk_f32_fp8">;
0 commit comments