[llvm] 1ec3313 - TTI: Check legalization cost of fptosi_sat/fptoui_sat nodes (#100521)

via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 9 01:32:07 PDT 2024


Author: Matt Arsenault
Date: 2024-08-09T12:32:03+04:00
New Revision: 1ec33131250f6d7daa94c60b6176d5fff64b7319

URL: https://github.com/llvm/llvm-project/commit/1ec33131250f6d7daa94c60b6176d5fff64b7319
DIFF: https://github.com/llvm/llvm-project/commit/1ec33131250f6d7daa94c60b6176d5fff64b7319.diff

LOG: TTI: Check legalization cost of fptosi_sat/fptoui_sat nodes (#100521)

Added: 
    

Modified: 
    llvm/include/llvm/CodeGen/BasicTTIImpl.h
    llvm/test/Analysis/CostModel/X86/fptoi_sat.ll

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/CodeGen/BasicTTIImpl.h b/llvm/include/llvm/CodeGen/BasicTTIImpl.h
index 890c2b8ca36e11..8a14c8a37577ad 100644
--- a/llvm/include/llvm/CodeGen/BasicTTIImpl.h
+++ b/llvm/include/llvm/CodeGen/BasicTTIImpl.h
@@ -2183,31 +2183,11 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
       ISD = ISD::UMULO;
       break;
     case Intrinsic::fptosi_sat:
-    case Intrinsic::fptoui_sat: {
-      if (Tys.empty())
-        break;
-      Type *FromTy = Tys[0];
-      bool IsSigned = IID == Intrinsic::fptosi_sat;
-
-      InstructionCost Cost = 0;
-      IntrinsicCostAttributes Attrs1(Intrinsic::minnum, FromTy,
-                                     {FromTy, FromTy});
-      Cost += thisT()->getIntrinsicInstrCost(Attrs1, CostKind);
-      IntrinsicCostAttributes Attrs2(Intrinsic::maxnum, FromTy,
-                                     {FromTy, FromTy});
-      Cost += thisT()->getIntrinsicInstrCost(Attrs2, CostKind);
-      Cost += thisT()->getCastInstrCost(
-          IsSigned ? Instruction::FPToSI : Instruction::FPToUI, RetTy, FromTy,
-          TTI::CastContextHint::None, CostKind);
-      if (IsSigned) {
-        Type *CondTy = RetTy->getWithNewBitWidth(1);
-        Cost += thisT()->getCmpSelInstrCost(
-            BinaryOperator::FCmp, FromTy, CondTy, CmpInst::FCMP_UNO, CostKind);
-        Cost += thisT()->getCmpSelInstrCost(
-            BinaryOperator::Select, RetTy, CondTy, CmpInst::FCMP_UNO, CostKind);
-      }
-      return Cost;
-    }
+      ISD = ISD::FP_TO_SINT_SAT;
+      break;
+    case Intrinsic::fptoui_sat:
+      ISD = ISD::FP_TO_UINT_SAT;
+      break;
     case Intrinsic::ctpop:
       ISD = ISD::CTPOP;
       // In case of legalization use TCC_Expensive. This is cheaper than a
@@ -2422,6 +2402,32 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
       Cost += thisT()->getArithmeticInstrCost(Instruction::Or, RetTy, CostKind);
       return Cost;
     }
+    case Intrinsic::fptosi_sat:
+    case Intrinsic::fptoui_sat: {
+      if (Tys.empty())
+        break;
+      Type *FromTy = Tys[0];
+      bool IsSigned = IID == Intrinsic::fptosi_sat;
+
+      InstructionCost Cost = 0;
+      IntrinsicCostAttributes Attrs1(Intrinsic::minnum, FromTy,
+                                     {FromTy, FromTy});
+      Cost += thisT()->getIntrinsicInstrCost(Attrs1, CostKind);
+      IntrinsicCostAttributes Attrs2(Intrinsic::maxnum, FromTy,
+                                     {FromTy, FromTy});
+      Cost += thisT()->getIntrinsicInstrCost(Attrs2, CostKind);
+      Cost += thisT()->getCastInstrCost(
+          IsSigned ? Instruction::FPToSI : Instruction::FPToUI, RetTy, FromTy,
+          TTI::CastContextHint::None, CostKind);
+      if (IsSigned) {
+        Type *CondTy = RetTy->getWithNewBitWidth(1);
+        Cost += thisT()->getCmpSelInstrCost(
+            BinaryOperator::FCmp, FromTy, CondTy, CmpInst::FCMP_UNO, CostKind);
+        Cost += thisT()->getCmpSelInstrCost(
+            BinaryOperator::Select, RetTy, CondTy, CmpInst::FCMP_UNO, CostKind);
+      }
+      return Cost;
+    }
     default:
       break;
     }

diff  --git a/llvm/test/Analysis/CostModel/X86/fptoi_sat.ll b/llvm/test/Analysis/CostModel/X86/fptoi_sat.ll
index 3f5c79f2d59c6d..55b80350f595ea 100644
--- a/llvm/test/Analysis/CostModel/X86/fptoi_sat.ll
+++ b/llvm/test/Analysis/CostModel/X86/fptoi_sat.ll
@@ -12,26 +12,26 @@
 
 define void @casts() {
 ; SSE2-LABEL: 'casts'
-; SSE2-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %f32s1 = call i1 @llvm.fptosi.sat.i1.f32(float undef)
-; SSE2-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %f32u1 = call i1 @llvm.fptoui.sat.i1.f32(float undef)
-; SSE2-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %f32s8 = call i8 @llvm.fptosi.sat.i8.f32(float undef)
-; SSE2-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %f32u8 = call i8 @llvm.fptoui.sat.i8.f32(float undef)
-; SSE2-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %f32s16 = call i16 @llvm.fptosi.sat.i16.f32(float undef)
-; SSE2-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %f32u16 = call i16 @llvm.fptoui.sat.i16.f32(float undef)
-; SSE2-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %f32s32 = call i32 @llvm.fptosi.sat.i32.f32(float undef)
-; SSE2-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %f32u32 = call i32 @llvm.fptoui.sat.i32.f32(float undef)
-; SSE2-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %f32s64 = call i64 @llvm.fptosi.sat.i64.f32(float undef)
-; SSE2-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %f32u64 = call i64 @llvm.fptoui.sat.i64.f32(float undef)
-; SSE2-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %f64s1 = call i1 @llvm.fptosi.sat.i1.f64(double undef)
-; SSE2-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %f64u1 = call i1 @llvm.fptoui.sat.i1.f64(double undef)
-; SSE2-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %f64s8 = call i8 @llvm.fptosi.sat.i8.f64(double undef)
-; SSE2-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %f64u8 = call i8 @llvm.fptoui.sat.i8.f64(double undef)
-; SSE2-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %f64s16 = call i16 @llvm.fptosi.sat.i16.f64(double undef)
-; SSE2-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %f64u16 = call i16 @llvm.fptoui.sat.i16.f64(double undef)
-; SSE2-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %f64s32 = call i32 @llvm.fptosi.sat.i32.f64(double undef)
-; SSE2-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %f64u32 = call i32 @llvm.fptoui.sat.i32.f64(double undef)
-; SSE2-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %f64s64 = call i64 @llvm.fptosi.sat.i64.f64(double undef)
-; SSE2-NEXT:  Cost Model: Found an estimated cost of 25 for instruction: %f64u64 = call i64 @llvm.fptoui.sat.i64.f64(double undef)
+; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32s1 = call i1 @llvm.fptosi.sat.i1.f32(float undef)
+; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32u1 = call i1 @llvm.fptoui.sat.i1.f32(float undef)
+; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32s8 = call i8 @llvm.fptosi.sat.i8.f32(float undef)
+; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32u8 = call i8 @llvm.fptoui.sat.i8.f32(float undef)
+; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32s16 = call i16 @llvm.fptosi.sat.i16.f32(float undef)
+; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32u16 = call i16 @llvm.fptoui.sat.i16.f32(float undef)
+; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32s32 = call i32 @llvm.fptosi.sat.i32.f32(float undef)
+; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32u32 = call i32 @llvm.fptoui.sat.i32.f32(float undef)
+; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32s64 = call i64 @llvm.fptosi.sat.i64.f32(float undef)
+; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32u64 = call i64 @llvm.fptoui.sat.i64.f32(float undef)
+; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64s1 = call i1 @llvm.fptosi.sat.i1.f64(double undef)
+; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64u1 = call i1 @llvm.fptoui.sat.i1.f64(double undef)
+; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64s8 = call i8 @llvm.fptosi.sat.i8.f64(double undef)
+; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64u8 = call i8 @llvm.fptoui.sat.i8.f64(double undef)
+; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64s16 = call i16 @llvm.fptosi.sat.i16.f64(double undef)
+; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64u16 = call i16 @llvm.fptoui.sat.i16.f64(double undef)
+; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64s32 = call i32 @llvm.fptosi.sat.i32.f64(double undef)
+; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64u32 = call i32 @llvm.fptoui.sat.i32.f64(double undef)
+; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64s64 = call i64 @llvm.fptosi.sat.i64.f64(double undef)
+; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64u64 = call i64 @llvm.fptoui.sat.i64.f64(double undef)
 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 19 for instruction: %v2f32s1 = call <2 x i1> @llvm.fptosi.sat.v2i1.v2f32(<2 x float> undef)
 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v2f32u1 = call <2 x i1> @llvm.fptoui.sat.v2i1.v2f32(<2 x float> undef)
 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 18 for instruction: %v2f32s8 = call <2 x i8> @llvm.fptosi.sat.v2i8.v2f32(<2 x float> undef)
@@ -115,26 +115,26 @@ define void @casts() {
 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
 ;
 ; SSE42-LABEL: 'casts'
-; SSE42-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %f32s1 = call i1 @llvm.fptosi.sat.i1.f32(float undef)
-; SSE42-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %f32u1 = call i1 @llvm.fptoui.sat.i1.f32(float undef)
-; SSE42-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %f32s8 = call i8 @llvm.fptosi.sat.i8.f32(float undef)
-; SSE42-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %f32u8 = call i8 @llvm.fptoui.sat.i8.f32(float undef)
-; SSE42-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %f32s16 = call i16 @llvm.fptosi.sat.i16.f32(float undef)
-; SSE42-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %f32u16 = call i16 @llvm.fptoui.sat.i16.f32(float undef)
-; SSE42-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %f32s32 = call i32 @llvm.fptosi.sat.i32.f32(float undef)
-; SSE42-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %f32u32 = call i32 @llvm.fptoui.sat.i32.f32(float undef)
-; SSE42-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %f32s64 = call i64 @llvm.fptosi.sat.i64.f32(float undef)
-; SSE42-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %f32u64 = call i64 @llvm.fptoui.sat.i64.f32(float undef)
-; SSE42-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %f64s1 = call i1 @llvm.fptosi.sat.i1.f64(double undef)
-; SSE42-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %f64u1 = call i1 @llvm.fptoui.sat.i1.f64(double undef)
-; SSE42-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %f64s8 = call i8 @llvm.fptosi.sat.i8.f64(double undef)
-; SSE42-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %f64u8 = call i8 @llvm.fptoui.sat.i8.f64(double undef)
-; SSE42-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %f64s16 = call i16 @llvm.fptosi.sat.i16.f64(double undef)
-; SSE42-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %f64u16 = call i16 @llvm.fptoui.sat.i16.f64(double undef)
-; SSE42-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %f64s32 = call i32 @llvm.fptosi.sat.i32.f64(double undef)
-; SSE42-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %f64u32 = call i32 @llvm.fptoui.sat.i32.f64(double undef)
-; SSE42-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %f64s64 = call i64 @llvm.fptosi.sat.i64.f64(double undef)
-; SSE42-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %f64u64 = call i64 @llvm.fptoui.sat.i64.f64(double undef)
+; SSE42-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32s1 = call i1 @llvm.fptosi.sat.i1.f32(float undef)
+; SSE42-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32u1 = call i1 @llvm.fptoui.sat.i1.f32(float undef)
+; SSE42-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32s8 = call i8 @llvm.fptosi.sat.i8.f32(float undef)
+; SSE42-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32u8 = call i8 @llvm.fptoui.sat.i8.f32(float undef)
+; SSE42-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32s16 = call i16 @llvm.fptosi.sat.i16.f32(float undef)
+; SSE42-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32u16 = call i16 @llvm.fptoui.sat.i16.f32(float undef)
+; SSE42-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32s32 = call i32 @llvm.fptosi.sat.i32.f32(float undef)
+; SSE42-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32u32 = call i32 @llvm.fptoui.sat.i32.f32(float undef)
+; SSE42-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32s64 = call i64 @llvm.fptosi.sat.i64.f32(float undef)
+; SSE42-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32u64 = call i64 @llvm.fptoui.sat.i64.f32(float undef)
+; SSE42-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64s1 = call i1 @llvm.fptosi.sat.i1.f64(double undef)
+; SSE42-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64u1 = call i1 @llvm.fptoui.sat.i1.f64(double undef)
+; SSE42-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64s8 = call i8 @llvm.fptosi.sat.i8.f64(double undef)
+; SSE42-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64u8 = call i8 @llvm.fptoui.sat.i8.f64(double undef)
+; SSE42-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64s16 = call i16 @llvm.fptosi.sat.i16.f64(double undef)
+; SSE42-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64u16 = call i16 @llvm.fptoui.sat.i16.f64(double undef)
+; SSE42-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64s32 = call i32 @llvm.fptosi.sat.i32.f64(double undef)
+; SSE42-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64u32 = call i32 @llvm.fptoui.sat.i32.f64(double undef)
+; SSE42-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64s64 = call i64 @llvm.fptosi.sat.i64.f64(double undef)
+; SSE42-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64u64 = call i64 @llvm.fptoui.sat.i64.f64(double undef)
 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 17 for instruction: %v2f32s1 = call <2 x i1> @llvm.fptosi.sat.v2i1.v2f32(<2 x float> undef)
 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %v2f32u1 = call <2 x i1> @llvm.fptoui.sat.v2i1.v2f32(<2 x float> undef)
 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %v2f32s8 = call <2 x i8> @llvm.fptosi.sat.v2i8.v2f32(<2 x float> undef)
@@ -218,26 +218,26 @@ define void @casts() {
 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
 ;
 ; AVX1-LABEL: 'casts'
-; AVX1-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %f32s1 = call i1 @llvm.fptosi.sat.i1.f32(float undef)
-; AVX1-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %f32u1 = call i1 @llvm.fptoui.sat.i1.f32(float undef)
-; AVX1-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %f32s8 = call i8 @llvm.fptosi.sat.i8.f32(float undef)
-; AVX1-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %f32u8 = call i8 @llvm.fptoui.sat.i8.f32(float undef)
-; AVX1-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %f32s16 = call i16 @llvm.fptosi.sat.i16.f32(float undef)
-; AVX1-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %f32u16 = call i16 @llvm.fptoui.sat.i16.f32(float undef)
-; AVX1-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %f32s32 = call i32 @llvm.fptosi.sat.i32.f32(float undef)
-; AVX1-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %f32u32 = call i32 @llvm.fptoui.sat.i32.f32(float undef)
-; AVX1-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %f32s64 = call i64 @llvm.fptosi.sat.i64.f32(float undef)
-; AVX1-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %f32u64 = call i64 @llvm.fptoui.sat.i64.f32(float undef)
-; AVX1-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %f64s1 = call i1 @llvm.fptosi.sat.i1.f64(double undef)
-; AVX1-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %f64u1 = call i1 @llvm.fptoui.sat.i1.f64(double undef)
-; AVX1-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %f64s8 = call i8 @llvm.fptosi.sat.i8.f64(double undef)
-; AVX1-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %f64u8 = call i8 @llvm.fptoui.sat.i8.f64(double undef)
-; AVX1-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %f64s16 = call i16 @llvm.fptosi.sat.i16.f64(double undef)
-; AVX1-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %f64u16 = call i16 @llvm.fptoui.sat.i16.f64(double undef)
-; AVX1-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %f64s32 = call i32 @llvm.fptosi.sat.i32.f64(double undef)
-; AVX1-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %f64u32 = call i32 @llvm.fptoui.sat.i32.f64(double undef)
-; AVX1-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %f64s64 = call i64 @llvm.fptosi.sat.i64.f64(double undef)
-; AVX1-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %f64u64 = call i64 @llvm.fptoui.sat.i64.f64(double undef)
+; AVX1-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32s1 = call i1 @llvm.fptosi.sat.i1.f32(float undef)
+; AVX1-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32u1 = call i1 @llvm.fptoui.sat.i1.f32(float undef)
+; AVX1-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32s8 = call i8 @llvm.fptosi.sat.i8.f32(float undef)
+; AVX1-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32u8 = call i8 @llvm.fptoui.sat.i8.f32(float undef)
+; AVX1-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32s16 = call i16 @llvm.fptosi.sat.i16.f32(float undef)
+; AVX1-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32u16 = call i16 @llvm.fptoui.sat.i16.f32(float undef)
+; AVX1-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32s32 = call i32 @llvm.fptosi.sat.i32.f32(float undef)
+; AVX1-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32u32 = call i32 @llvm.fptoui.sat.i32.f32(float undef)
+; AVX1-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32s64 = call i64 @llvm.fptosi.sat.i64.f32(float undef)
+; AVX1-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32u64 = call i64 @llvm.fptoui.sat.i64.f32(float undef)
+; AVX1-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64s1 = call i1 @llvm.fptosi.sat.i1.f64(double undef)
+; AVX1-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64u1 = call i1 @llvm.fptoui.sat.i1.f64(double undef)
+; AVX1-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64s8 = call i8 @llvm.fptosi.sat.i8.f64(double undef)
+; AVX1-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64u8 = call i8 @llvm.fptoui.sat.i8.f64(double undef)
+; AVX1-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64s16 = call i16 @llvm.fptosi.sat.i16.f64(double undef)
+; AVX1-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64u16 = call i16 @llvm.fptoui.sat.i16.f64(double undef)
+; AVX1-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64s32 = call i32 @llvm.fptosi.sat.i32.f64(double undef)
+; AVX1-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64u32 = call i32 @llvm.fptoui.sat.i32.f64(double undef)
+; AVX1-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64s64 = call i64 @llvm.fptosi.sat.i64.f64(double undef)
+; AVX1-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64u64 = call i64 @llvm.fptoui.sat.i64.f64(double undef)
 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v2f32s1 = call <2 x i1> @llvm.fptosi.sat.v2i1.v2f32(<2 x float> undef)
 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %v2f32u1 = call <2 x i1> @llvm.fptoui.sat.v2i1.v2f32(<2 x float> undef)
 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %v2f32s8 = call <2 x i8> @llvm.fptosi.sat.v2i8.v2f32(<2 x float> undef)
@@ -321,26 +321,26 @@ define void @casts() {
 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
 ;
 ; AVX2-LABEL: 'casts'
-; AVX2-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %f32s1 = call i1 @llvm.fptosi.sat.i1.f32(float undef)
-; AVX2-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f32u1 = call i1 @llvm.fptoui.sat.i1.f32(float undef)
-; AVX2-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %f32s8 = call i8 @llvm.fptosi.sat.i8.f32(float undef)
-; AVX2-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f32u8 = call i8 @llvm.fptoui.sat.i8.f32(float undef)
-; AVX2-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %f32s16 = call i16 @llvm.fptosi.sat.i16.f32(float undef)
-; AVX2-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f32u16 = call i16 @llvm.fptoui.sat.i16.f32(float undef)
-; AVX2-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %f32s32 = call i32 @llvm.fptosi.sat.i32.f32(float undef)
-; AVX2-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f32u32 = call i32 @llvm.fptoui.sat.i32.f32(float undef)
-; AVX2-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %f32s64 = call i64 @llvm.fptosi.sat.i64.f32(float undef)
-; AVX2-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %f32u64 = call i64 @llvm.fptoui.sat.i64.f32(float undef)
-; AVX2-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %f64s1 = call i1 @llvm.fptosi.sat.i1.f64(double undef)
-; AVX2-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f64u1 = call i1 @llvm.fptoui.sat.i1.f64(double undef)
-; AVX2-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %f64s8 = call i8 @llvm.fptosi.sat.i8.f64(double undef)
-; AVX2-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f64u8 = call i8 @llvm.fptoui.sat.i8.f64(double undef)
-; AVX2-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %f64s16 = call i16 @llvm.fptosi.sat.i16.f64(double undef)
-; AVX2-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f64u16 = call i16 @llvm.fptoui.sat.i16.f64(double undef)
-; AVX2-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %f64s32 = call i32 @llvm.fptosi.sat.i32.f64(double undef)
-; AVX2-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f64u32 = call i32 @llvm.fptoui.sat.i32.f64(double undef)
-; AVX2-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %f64s64 = call i64 @llvm.fptosi.sat.i64.f64(double undef)
-; AVX2-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %f64u64 = call i64 @llvm.fptoui.sat.i64.f64(double undef)
+; AVX2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32s1 = call i1 @llvm.fptosi.sat.i1.f32(float undef)
+; AVX2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32u1 = call i1 @llvm.fptoui.sat.i1.f32(float undef)
+; AVX2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32s8 = call i8 @llvm.fptosi.sat.i8.f32(float undef)
+; AVX2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32u8 = call i8 @llvm.fptoui.sat.i8.f32(float undef)
+; AVX2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32s16 = call i16 @llvm.fptosi.sat.i16.f32(float undef)
+; AVX2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32u16 = call i16 @llvm.fptoui.sat.i16.f32(float undef)
+; AVX2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32s32 = call i32 @llvm.fptosi.sat.i32.f32(float undef)
+; AVX2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32u32 = call i32 @llvm.fptoui.sat.i32.f32(float undef)
+; AVX2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32s64 = call i64 @llvm.fptosi.sat.i64.f32(float undef)
+; AVX2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32u64 = call i64 @llvm.fptoui.sat.i64.f32(float undef)
+; AVX2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64s1 = call i1 @llvm.fptosi.sat.i1.f64(double undef)
+; AVX2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64u1 = call i1 @llvm.fptoui.sat.i1.f64(double undef)
+; AVX2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64s8 = call i8 @llvm.fptosi.sat.i8.f64(double undef)
+; AVX2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64u8 = call i8 @llvm.fptoui.sat.i8.f64(double undef)
+; AVX2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64s16 = call i16 @llvm.fptosi.sat.i16.f64(double undef)
+; AVX2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64u16 = call i16 @llvm.fptoui.sat.i16.f64(double undef)
+; AVX2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64s32 = call i32 @llvm.fptosi.sat.i32.f64(double undef)
+; AVX2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64u32 = call i32 @llvm.fptoui.sat.i32.f64(double undef)
+; AVX2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64s64 = call i64 @llvm.fptosi.sat.i64.f64(double undef)
+; AVX2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64u64 = call i64 @llvm.fptoui.sat.i64.f64(double undef)
 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %v2f32s1 = call <2 x i1> @llvm.fptosi.sat.v2i1.v2f32(<2 x float> undef)
 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v2f32u1 = call <2 x i1> @llvm.fptoui.sat.v2i1.v2f32(<2 x float> undef)
 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v2f32s8 = call <2 x i8> @llvm.fptosi.sat.v2i8.v2f32(<2 x float> undef)
@@ -424,26 +424,26 @@ define void @casts() {
 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
 ;
 ; AVX512F-LABEL: 'casts'
-; AVX512F-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %f32s1 = call i1 @llvm.fptosi.sat.i1.f32(float undef)
-; AVX512F-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f32u1 = call i1 @llvm.fptoui.sat.i1.f32(float undef)
-; AVX512F-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %f32s8 = call i8 @llvm.fptosi.sat.i8.f32(float undef)
-; AVX512F-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f32u8 = call i8 @llvm.fptoui.sat.i8.f32(float undef)
-; AVX512F-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %f32s16 = call i16 @llvm.fptosi.sat.i16.f32(float undef)
-; AVX512F-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f32u16 = call i16 @llvm.fptoui.sat.i16.f32(float undef)
-; AVX512F-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %f32s32 = call i32 @llvm.fptosi.sat.i32.f32(float undef)
-; AVX512F-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f32u32 = call i32 @llvm.fptoui.sat.i32.f32(float undef)
-; AVX512F-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %f32s64 = call i64 @llvm.fptosi.sat.i64.f32(float undef)
-; AVX512F-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f32u64 = call i64 @llvm.fptoui.sat.i64.f32(float undef)
-; AVX512F-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %f64s1 = call i1 @llvm.fptosi.sat.i1.f64(double undef)
-; AVX512F-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f64u1 = call i1 @llvm.fptoui.sat.i1.f64(double undef)
-; AVX512F-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %f64s8 = call i8 @llvm.fptosi.sat.i8.f64(double undef)
-; AVX512F-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f64u8 = call i8 @llvm.fptoui.sat.i8.f64(double undef)
-; AVX512F-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %f64s16 = call i16 @llvm.fptosi.sat.i16.f64(double undef)
-; AVX512F-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f64u16 = call i16 @llvm.fptoui.sat.i16.f64(double undef)
-; AVX512F-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %f64s32 = call i32 @llvm.fptosi.sat.i32.f64(double undef)
-; AVX512F-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f64u32 = call i32 @llvm.fptoui.sat.i32.f64(double undef)
-; AVX512F-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %f64s64 = call i64 @llvm.fptosi.sat.i64.f64(double undef)
-; AVX512F-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f64u64 = call i64 @llvm.fptoui.sat.i64.f64(double undef)
+; AVX512F-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32s1 = call i1 @llvm.fptosi.sat.i1.f32(float undef)
+; AVX512F-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32u1 = call i1 @llvm.fptoui.sat.i1.f32(float undef)
+; AVX512F-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32s8 = call i8 @llvm.fptosi.sat.i8.f32(float undef)
+; AVX512F-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32u8 = call i8 @llvm.fptoui.sat.i8.f32(float undef)
+; AVX512F-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32s16 = call i16 @llvm.fptosi.sat.i16.f32(float undef)
+; AVX512F-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32u16 = call i16 @llvm.fptoui.sat.i16.f32(float undef)
+; AVX512F-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32s32 = call i32 @llvm.fptosi.sat.i32.f32(float undef)
+; AVX512F-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32u32 = call i32 @llvm.fptoui.sat.i32.f32(float undef)
+; AVX512F-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32s64 = call i64 @llvm.fptosi.sat.i64.f32(float undef)
+; AVX512F-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32u64 = call i64 @llvm.fptoui.sat.i64.f32(float undef)
+; AVX512F-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64s1 = call i1 @llvm.fptosi.sat.i1.f64(double undef)
+; AVX512F-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64u1 = call i1 @llvm.fptoui.sat.i1.f64(double undef)
+; AVX512F-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64s8 = call i8 @llvm.fptosi.sat.i8.f64(double undef)
+; AVX512F-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64u8 = call i8 @llvm.fptoui.sat.i8.f64(double undef)
+; AVX512F-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64s16 = call i16 @llvm.fptosi.sat.i16.f64(double undef)
+; AVX512F-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64u16 = call i16 @llvm.fptoui.sat.i16.f64(double undef)
+; AVX512F-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64s32 = call i32 @llvm.fptosi.sat.i32.f64(double undef)
+; AVX512F-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64u32 = call i32 @llvm.fptoui.sat.i32.f64(double undef)
+; AVX512F-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64s64 = call i64 @llvm.fptosi.sat.i64.f64(double undef)
+; AVX512F-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64u64 = call i64 @llvm.fptoui.sat.i64.f64(double undef)
 ; AVX512F-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %v2f32s1 = call <2 x i1> @llvm.fptosi.sat.v2i1.v2f32(<2 x float> undef)
 ; AVX512F-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v2f32u1 = call <2 x i1> @llvm.fptoui.sat.v2i1.v2f32(<2 x float> undef)
 ; AVX512F-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v2f32s8 = call <2 x i8> @llvm.fptosi.sat.v2i8.v2f32(<2 x float> undef)
@@ -527,26 +527,26 @@ define void @casts() {
 ; AVX512F-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
 ;
 ; AVX512DQ-LABEL: 'casts'
-; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %f32s1 = call i1 @llvm.fptosi.sat.i1.f32(float undef)
-; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f32u1 = call i1 @llvm.fptoui.sat.i1.f32(float undef)
-; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %f32s8 = call i8 @llvm.fptosi.sat.i8.f32(float undef)
-; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f32u8 = call i8 @llvm.fptoui.sat.i8.f32(float undef)
-; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %f32s16 = call i16 @llvm.fptosi.sat.i16.f32(float undef)
-; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f32u16 = call i16 @llvm.fptoui.sat.i16.f32(float undef)
-; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %f32s32 = call i32 @llvm.fptosi.sat.i32.f32(float undef)
-; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f32u32 = call i32 @llvm.fptoui.sat.i32.f32(float undef)
-; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %f32s64 = call i64 @llvm.fptosi.sat.i64.f32(float undef)
-; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f32u64 = call i64 @llvm.fptoui.sat.i64.f32(float undef)
-; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %f64s1 = call i1 @llvm.fptosi.sat.i1.f64(double undef)
-; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f64u1 = call i1 @llvm.fptoui.sat.i1.f64(double undef)
-; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %f64s8 = call i8 @llvm.fptosi.sat.i8.f64(double undef)
-; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f64u8 = call i8 @llvm.fptoui.sat.i8.f64(double undef)
-; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %f64s16 = call i16 @llvm.fptosi.sat.i16.f64(double undef)
-; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f64u16 = call i16 @llvm.fptoui.sat.i16.f64(double undef)
-; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %f64s32 = call i32 @llvm.fptosi.sat.i32.f64(double undef)
-; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f64u32 = call i32 @llvm.fptoui.sat.i32.f64(double undef)
-; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %f64s64 = call i64 @llvm.fptosi.sat.i64.f64(double undef)
-; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f64u64 = call i64 @llvm.fptoui.sat.i64.f64(double undef)
+; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32s1 = call i1 @llvm.fptosi.sat.i1.f32(float undef)
+; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32u1 = call i1 @llvm.fptoui.sat.i1.f32(float undef)
+; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32s8 = call i8 @llvm.fptosi.sat.i8.f32(float undef)
+; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32u8 = call i8 @llvm.fptoui.sat.i8.f32(float undef)
+; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32s16 = call i16 @llvm.fptosi.sat.i16.f32(float undef)
+; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32u16 = call i16 @llvm.fptoui.sat.i16.f32(float undef)
+; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32s32 = call i32 @llvm.fptosi.sat.i32.f32(float undef)
+; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32u32 = call i32 @llvm.fptoui.sat.i32.f32(float undef)
+; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32s64 = call i64 @llvm.fptosi.sat.i64.f32(float undef)
+; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32u64 = call i64 @llvm.fptoui.sat.i64.f32(float undef)
+; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64s1 = call i1 @llvm.fptosi.sat.i1.f64(double undef)
+; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64u1 = call i1 @llvm.fptoui.sat.i1.f64(double undef)
+; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64s8 = call i8 @llvm.fptosi.sat.i8.f64(double undef)
+; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64u8 = call i8 @llvm.fptoui.sat.i8.f64(double undef)
+; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64s16 = call i16 @llvm.fptosi.sat.i16.f64(double undef)
+; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64u16 = call i16 @llvm.fptoui.sat.i16.f64(double undef)
+; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64s32 = call i32 @llvm.fptosi.sat.i32.f64(double undef)
+; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64u32 = call i32 @llvm.fptoui.sat.i32.f64(double undef)
+; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64s64 = call i64 @llvm.fptosi.sat.i64.f64(double undef)
+; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64u64 = call i64 @llvm.fptoui.sat.i64.f64(double undef)
 ; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %v2f32s1 = call <2 x i1> @llvm.fptosi.sat.v2i1.v2f32(<2 x float> undef)
 ; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v2f32u1 = call <2 x i1> @llvm.fptoui.sat.v2i1.v2f32(<2 x float> undef)
 ; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v2f32s8 = call <2 x i8> @llvm.fptosi.sat.v2i8.v2f32(<2 x float> undef)
@@ -630,26 +630,26 @@ define void @casts() {
 ; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
 ;
 ; SLM-LABEL: 'casts'
-; SLM-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %f32s1 = call i1 @llvm.fptosi.sat.i1.f32(float undef)
-; SLM-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %f32u1 = call i1 @llvm.fptoui.sat.i1.f32(float undef)
-; SLM-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %f32s8 = call i8 @llvm.fptosi.sat.i8.f32(float undef)
-; SLM-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %f32u8 = call i8 @llvm.fptoui.sat.i8.f32(float undef)
-; SLM-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %f32s16 = call i16 @llvm.fptosi.sat.i16.f32(float undef)
-; SLM-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %f32u16 = call i16 @llvm.fptoui.sat.i16.f32(float undef)
-; SLM-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %f32s32 = call i32 @llvm.fptosi.sat.i32.f32(float undef)
-; SLM-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %f32u32 = call i32 @llvm.fptoui.sat.i32.f32(float undef)
-; SLM-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %f32s64 = call i64 @llvm.fptosi.sat.i64.f32(float undef)
-; SLM-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %f32u64 = call i64 @llvm.fptoui.sat.i64.f32(float undef)
-; SLM-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %f64s1 = call i1 @llvm.fptosi.sat.i1.f64(double undef)
-; SLM-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %f64u1 = call i1 @llvm.fptoui.sat.i1.f64(double undef)
-; SLM-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %f64s8 = call i8 @llvm.fptosi.sat.i8.f64(double undef)
-; SLM-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %f64u8 = call i8 @llvm.fptoui.sat.i8.f64(double undef)
-; SLM-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %f64s16 = call i16 @llvm.fptosi.sat.i16.f64(double undef)
-; SLM-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %f64u16 = call i16 @llvm.fptoui.sat.i16.f64(double undef)
-; SLM-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %f64s32 = call i32 @llvm.fptosi.sat.i32.f64(double undef)
-; SLM-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %f64u32 = call i32 @llvm.fptoui.sat.i32.f64(double undef)
-; SLM-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %f64s64 = call i64 @llvm.fptosi.sat.i64.f64(double undef)
-; SLM-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %f64u64 = call i64 @llvm.fptoui.sat.i64.f64(double undef)
+; SLM-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32s1 = call i1 @llvm.fptosi.sat.i1.f32(float undef)
+; SLM-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32u1 = call i1 @llvm.fptoui.sat.i1.f32(float undef)
+; SLM-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32s8 = call i8 @llvm.fptosi.sat.i8.f32(float undef)
+; SLM-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32u8 = call i8 @llvm.fptoui.sat.i8.f32(float undef)
+; SLM-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32s16 = call i16 @llvm.fptosi.sat.i16.f32(float undef)
+; SLM-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32u16 = call i16 @llvm.fptoui.sat.i16.f32(float undef)
+; SLM-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32s32 = call i32 @llvm.fptosi.sat.i32.f32(float undef)
+; SLM-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32u32 = call i32 @llvm.fptoui.sat.i32.f32(float undef)
+; SLM-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32s64 = call i64 @llvm.fptosi.sat.i64.f32(float undef)
+; SLM-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32u64 = call i64 @llvm.fptoui.sat.i64.f32(float undef)
+; SLM-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64s1 = call i1 @llvm.fptosi.sat.i1.f64(double undef)
+; SLM-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64u1 = call i1 @llvm.fptoui.sat.i1.f64(double undef)
+; SLM-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64s8 = call i8 @llvm.fptosi.sat.i8.f64(double undef)
+; SLM-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64u8 = call i8 @llvm.fptoui.sat.i8.f64(double undef)
+; SLM-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64s16 = call i16 @llvm.fptosi.sat.i16.f64(double undef)
+; SLM-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64u16 = call i16 @llvm.fptoui.sat.i16.f64(double undef)
+; SLM-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64s32 = call i32 @llvm.fptosi.sat.i32.f64(double undef)
+; SLM-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64u32 = call i32 @llvm.fptoui.sat.i32.f64(double undef)
+; SLM-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64s64 = call i64 @llvm.fptosi.sat.i64.f64(double undef)
+; SLM-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64u64 = call i64 @llvm.fptoui.sat.i64.f64(double undef)
 ; SLM-NEXT:  Cost Model: Found an estimated cost of 19 for instruction: %v2f32s1 = call <2 x i1> @llvm.fptosi.sat.v2i1.v2f32(<2 x float> undef)
 ; SLM-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %v2f32u1 = call <2 x i1> @llvm.fptoui.sat.v2i1.v2f32(<2 x float> undef)
 ; SLM-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v2f32s8 = call <2 x i8> @llvm.fptosi.sat.v2i8.v2f32(<2 x float> undef)
@@ -847,16 +847,16 @@ define void @casts() {
 
 define void @fp16() {
 ; SSE2-LABEL: 'fp16'
-; SSE2-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f16s1 = call i1 @llvm.fptosi.sat.i1.f16(half undef)
-; SSE2-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %f16u1 = call i1 @llvm.fptoui.sat.i1.f16(half undef)
-; SSE2-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f16s8 = call i8 @llvm.fptosi.sat.i8.f16(half undef)
-; SSE2-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %f16u8 = call i8 @llvm.fptoui.sat.i8.f16(half undef)
-; SSE2-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f16s16 = call i16 @llvm.fptosi.sat.i16.f16(half undef)
-; SSE2-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %f16u16 = call i16 @llvm.fptoui.sat.i16.f16(half undef)
-; SSE2-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f16s32 = call i32 @llvm.fptosi.sat.i32.f16(half undef)
-; SSE2-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %f16u32 = call i32 @llvm.fptoui.sat.i32.f16(half undef)
-; SSE2-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f16s64 = call i64 @llvm.fptosi.sat.i64.f16(half undef)
-; SSE2-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %f16u64 = call i64 @llvm.fptoui.sat.i64.f16(half undef)
+; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16s1 = call i1 @llvm.fptosi.sat.i1.f16(half undef)
+; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16u1 = call i1 @llvm.fptoui.sat.i1.f16(half undef)
+; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16s8 = call i8 @llvm.fptosi.sat.i8.f16(half undef)
+; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16u8 = call i8 @llvm.fptoui.sat.i8.f16(half undef)
+; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16s16 = call i16 @llvm.fptosi.sat.i16.f16(half undef)
+; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16u16 = call i16 @llvm.fptoui.sat.i16.f16(half undef)
+; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16s32 = call i32 @llvm.fptosi.sat.i32.f16(half undef)
+; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16u32 = call i32 @llvm.fptoui.sat.i32.f16(half undef)
+; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16s64 = call i64 @llvm.fptosi.sat.i64.f16(half undef)
+; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16u64 = call i64 @llvm.fptoui.sat.i64.f16(half undef)
 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v2f16s1 = call <2 x i1> @llvm.fptosi.sat.v2i1.v2f16(<2 x half> undef)
 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %v2f16u1 = call <2 x i1> @llvm.fptoui.sat.v2i1.v2f16(<2 x half> undef)
 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 18 for instruction: %v2f16s8 = call <2 x i8> @llvm.fptosi.sat.v2i8.v2f16(<2 x half> undef)
@@ -900,16 +900,16 @@ define void @fp16() {
 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
 ;
 ; SSE42-LABEL: 'fp16'
-; SSE42-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f16s1 = call i1 @llvm.fptosi.sat.i1.f16(half undef)
-; SSE42-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %f16u1 = call i1 @llvm.fptoui.sat.i1.f16(half undef)
-; SSE42-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f16s8 = call i8 @llvm.fptosi.sat.i8.f16(half undef)
-; SSE42-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %f16u8 = call i8 @llvm.fptoui.sat.i8.f16(half undef)
-; SSE42-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f16s16 = call i16 @llvm.fptosi.sat.i16.f16(half undef)
-; SSE42-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %f16u16 = call i16 @llvm.fptoui.sat.i16.f16(half undef)
-; SSE42-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f16s32 = call i32 @llvm.fptosi.sat.i32.f16(half undef)
-; SSE42-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %f16u32 = call i32 @llvm.fptoui.sat.i32.f16(half undef)
-; SSE42-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f16s64 = call i64 @llvm.fptosi.sat.i64.f16(half undef)
-; SSE42-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %f16u64 = call i64 @llvm.fptoui.sat.i64.f16(half undef)
+; SSE42-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16s1 = call i1 @llvm.fptosi.sat.i1.f16(half undef)
+; SSE42-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16u1 = call i1 @llvm.fptoui.sat.i1.f16(half undef)
+; SSE42-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16s8 = call i8 @llvm.fptosi.sat.i8.f16(half undef)
+; SSE42-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16u8 = call i8 @llvm.fptoui.sat.i8.f16(half undef)
+; SSE42-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16s16 = call i16 @llvm.fptosi.sat.i16.f16(half undef)
+; SSE42-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16u16 = call i16 @llvm.fptoui.sat.i16.f16(half undef)
+; SSE42-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16s32 = call i32 @llvm.fptosi.sat.i32.f16(half undef)
+; SSE42-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16u32 = call i32 @llvm.fptoui.sat.i32.f16(half undef)
+; SSE42-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16s64 = call i64 @llvm.fptosi.sat.i64.f16(half undef)
+; SSE42-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16u64 = call i64 @llvm.fptoui.sat.i64.f16(half undef)
 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v2f16s1 = call <2 x i1> @llvm.fptosi.sat.v2i1.v2f16(<2 x half> undef)
 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %v2f16u1 = call <2 x i1> @llvm.fptoui.sat.v2i1.v2f16(<2 x half> undef)
 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 17 for instruction: %v2f16s8 = call <2 x i8> @llvm.fptosi.sat.v2i8.v2f16(<2 x half> undef)
@@ -953,16 +953,16 @@ define void @fp16() {
 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
 ;
 ; AVX2-LABEL: 'fp16'
-; AVX2-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f16s1 = call i1 @llvm.fptosi.sat.i1.f16(half undef)
-; AVX2-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %f16u1 = call i1 @llvm.fptoui.sat.i1.f16(half undef)
-; AVX2-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f16s8 = call i8 @llvm.fptosi.sat.i8.f16(half undef)
-; AVX2-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %f16u8 = call i8 @llvm.fptoui.sat.i8.f16(half undef)
-; AVX2-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f16s16 = call i16 @llvm.fptosi.sat.i16.f16(half undef)
-; AVX2-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %f16u16 = call i16 @llvm.fptoui.sat.i16.f16(half undef)
-; AVX2-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f16s32 = call i32 @llvm.fptosi.sat.i32.f16(half undef)
-; AVX2-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %f16u32 = call i32 @llvm.fptoui.sat.i32.f16(half undef)
-; AVX2-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f16s64 = call i64 @llvm.fptosi.sat.i64.f16(half undef)
-; AVX2-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %f16u64 = call i64 @llvm.fptoui.sat.i64.f16(half undef)
+; AVX2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16s1 = call i1 @llvm.fptosi.sat.i1.f16(half undef)
+; AVX2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16u1 = call i1 @llvm.fptoui.sat.i1.f16(half undef)
+; AVX2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16s8 = call i8 @llvm.fptosi.sat.i8.f16(half undef)
+; AVX2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16u8 = call i8 @llvm.fptoui.sat.i8.f16(half undef)
+; AVX2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16s16 = call i16 @llvm.fptosi.sat.i16.f16(half undef)
+; AVX2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16u16 = call i16 @llvm.fptoui.sat.i16.f16(half undef)
+; AVX2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16s32 = call i32 @llvm.fptosi.sat.i32.f16(half undef)
+; AVX2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16u32 = call i32 @llvm.fptoui.sat.i32.f16(half undef)
+; AVX2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16s64 = call i64 @llvm.fptosi.sat.i64.f16(half undef)
+; AVX2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16u64 = call i64 @llvm.fptoui.sat.i64.f16(half undef)
 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v2f16s1 = call <2 x i1> @llvm.fptosi.sat.v2i1.v2f16(<2 x half> undef)
 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %v2f16u1 = call <2 x i1> @llvm.fptoui.sat.v2i1.v2f16(<2 x half> undef)
 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v2f16s8 = call <2 x i8> @llvm.fptosi.sat.v2i8.v2f16(<2 x half> undef)
@@ -1006,16 +1006,16 @@ define void @fp16() {
 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
 ;
 ; AVX512F-LABEL: 'fp16'
-; AVX512F-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f16s1 = call i1 @llvm.fptosi.sat.i1.f16(half undef)
-; AVX512F-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %f16u1 = call i1 @llvm.fptoui.sat.i1.f16(half undef)
-; AVX512F-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f16s8 = call i8 @llvm.fptosi.sat.i8.f16(half undef)
-; AVX512F-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %f16u8 = call i8 @llvm.fptoui.sat.i8.f16(half undef)
-; AVX512F-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f16s16 = call i16 @llvm.fptosi.sat.i16.f16(half undef)
-; AVX512F-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %f16u16 = call i16 @llvm.fptoui.sat.i16.f16(half undef)
-; AVX512F-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f16s32 = call i32 @llvm.fptosi.sat.i32.f16(half undef)
-; AVX512F-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %f16u32 = call i32 @llvm.fptoui.sat.i32.f16(half undef)
-; AVX512F-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f16s64 = call i64 @llvm.fptosi.sat.i64.f16(half undef)
-; AVX512F-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %f16u64 = call i64 @llvm.fptoui.sat.i64.f16(half undef)
+; AVX512F-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16s1 = call i1 @llvm.fptosi.sat.i1.f16(half undef)
+; AVX512F-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16u1 = call i1 @llvm.fptoui.sat.i1.f16(half undef)
+; AVX512F-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16s8 = call i8 @llvm.fptosi.sat.i8.f16(half undef)
+; AVX512F-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16u8 = call i8 @llvm.fptoui.sat.i8.f16(half undef)
+; AVX512F-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16s16 = call i16 @llvm.fptosi.sat.i16.f16(half undef)
+; AVX512F-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16u16 = call i16 @llvm.fptoui.sat.i16.f16(half undef)
+; AVX512F-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16s32 = call i32 @llvm.fptosi.sat.i32.f16(half undef)
+; AVX512F-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16u32 = call i32 @llvm.fptoui.sat.i32.f16(half undef)
+; AVX512F-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16s64 = call i64 @llvm.fptosi.sat.i64.f16(half undef)
+; AVX512F-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16u64 = call i64 @llvm.fptoui.sat.i64.f16(half undef)
 ; AVX512F-NEXT:  Cost Model: Found an estimated cost of 23 for instruction: %v2f16s1 = call <2 x i1> @llvm.fptosi.sat.v2i1.v2f16(<2 x half> undef)
 ; AVX512F-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v2f16u1 = call <2 x i1> @llvm.fptoui.sat.v2i1.v2f16(<2 x half> undef)
 ; AVX512F-NEXT:  Cost Model: Found an estimated cost of 17 for instruction: %v2f16s8 = call <2 x i8> @llvm.fptosi.sat.v2i8.v2f16(<2 x half> undef)
@@ -1059,16 +1059,16 @@ define void @fp16() {
 ; AVX512F-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
 ;
 ; AVX512DQ-LABEL: 'fp16'
-; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f16s1 = call i1 @llvm.fptosi.sat.i1.f16(half undef)
-; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %f16u1 = call i1 @llvm.fptoui.sat.i1.f16(half undef)
-; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f16s8 = call i8 @llvm.fptosi.sat.i8.f16(half undef)
-; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %f16u8 = call i8 @llvm.fptoui.sat.i8.f16(half undef)
-; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f16s16 = call i16 @llvm.fptosi.sat.i16.f16(half undef)
-; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %f16u16 = call i16 @llvm.fptoui.sat.i16.f16(half undef)
-; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f16s32 = call i32 @llvm.fptosi.sat.i32.f16(half undef)
-; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %f16u32 = call i32 @llvm.fptoui.sat.i32.f16(half undef)
-; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f16s64 = call i64 @llvm.fptosi.sat.i64.f16(half undef)
-; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %f16u64 = call i64 @llvm.fptoui.sat.i64.f16(half undef)
+; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16s1 = call i1 @llvm.fptosi.sat.i1.f16(half undef)
+; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16u1 = call i1 @llvm.fptoui.sat.i1.f16(half undef)
+; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16s8 = call i8 @llvm.fptosi.sat.i8.f16(half undef)
+; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16u8 = call i8 @llvm.fptoui.sat.i8.f16(half undef)
+; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16s16 = call i16 @llvm.fptosi.sat.i16.f16(half undef)
+; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16u16 = call i16 @llvm.fptoui.sat.i16.f16(half undef)
+; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16s32 = call i32 @llvm.fptosi.sat.i32.f16(half undef)
+; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16u32 = call i32 @llvm.fptoui.sat.i32.f16(half undef)
+; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16s64 = call i64 @llvm.fptosi.sat.i64.f16(half undef)
+; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16u64 = call i64 @llvm.fptoui.sat.i64.f16(half undef)
 ; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 23 for instruction: %v2f16s1 = call <2 x i1> @llvm.fptosi.sat.v2i1.v2f16(<2 x half> undef)
 ; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v2f16u1 = call <2 x i1> @llvm.fptoui.sat.v2i1.v2f16(<2 x half> undef)
 ; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 17 for instruction: %v2f16s8 = call <2 x i8> @llvm.fptosi.sat.v2i8.v2f16(<2 x half> undef)
@@ -1112,16 +1112,16 @@ define void @fp16() {
 ; AVX512DQ-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
 ;
 ; SLM-LABEL: 'fp16'
-; SLM-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f16s1 = call i1 @llvm.fptosi.sat.i1.f16(half undef)
-; SLM-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %f16u1 = call i1 @llvm.fptoui.sat.i1.f16(half undef)
-; SLM-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f16s8 = call i8 @llvm.fptosi.sat.i8.f16(half undef)
-; SLM-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %f16u8 = call i8 @llvm.fptoui.sat.i8.f16(half undef)
-; SLM-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f16s16 = call i16 @llvm.fptosi.sat.i16.f16(half undef)
-; SLM-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %f16u16 = call i16 @llvm.fptoui.sat.i16.f16(half undef)
-; SLM-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f16s32 = call i32 @llvm.fptosi.sat.i32.f16(half undef)
-; SLM-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %f16u32 = call i32 @llvm.fptoui.sat.i32.f16(half undef)
-; SLM-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f16s64 = call i64 @llvm.fptosi.sat.i64.f16(half undef)
-; SLM-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %f16u64 = call i64 @llvm.fptoui.sat.i64.f16(half undef)
+; SLM-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16s1 = call i1 @llvm.fptosi.sat.i1.f16(half undef)
+; SLM-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16u1 = call i1 @llvm.fptoui.sat.i1.f16(half undef)
+; SLM-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16s8 = call i8 @llvm.fptosi.sat.i8.f16(half undef)
+; SLM-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16u8 = call i8 @llvm.fptoui.sat.i8.f16(half undef)
+; SLM-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16s16 = call i16 @llvm.fptosi.sat.i16.f16(half undef)
+; SLM-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16u16 = call i16 @llvm.fptoui.sat.i16.f16(half undef)
+; SLM-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16s32 = call i32 @llvm.fptosi.sat.i32.f16(half undef)
+; SLM-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16u32 = call i32 @llvm.fptoui.sat.i32.f16(half undef)
+; SLM-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16s64 = call i64 @llvm.fptosi.sat.i64.f16(half undef)
+; SLM-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16u64 = call i64 @llvm.fptoui.sat.i64.f16(half undef)
 ; SLM-NEXT:  Cost Model: Found an estimated cost of 17 for instruction: %v2f16s1 = call <2 x i1> @llvm.fptosi.sat.v2i1.v2f16(<2 x half> undef)
 ; SLM-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %v2f16u1 = call <2 x i1> @llvm.fptoui.sat.v2i1.v2f16(<2 x half> undef)
 ; SLM-NEXT:  Cost Model: Found an estimated cost of 19 for instruction: %v2f16s8 = call <2 x i8> @llvm.fptosi.sat.v2i8.v2f16(<2 x half> undef)


        


More information about the llvm-commits mailing list