[llvm-branch-commits] [llvm] [AMDGPU] Price scalar integer to fp casts by source width and sign (PR #225343)

Dmitry Sidorov via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sun Sep 27 14:48:20 PDT 2026


https://github.com/MrSidims updated https://github.com/llvm/llvm-project/pull/225343

>From 521b663e028739301cbccfd1b8070bf3e2a39803 Mon Sep 17 00:00:00 2001
From: Dmitry Sidorov <Dmitry.Sidorov at amd.com>
Date: Thu, 17 Sep 2026 01:40:15 +0200
Subject: [PATCH 1/2] [AMDGPU] Price scalar integer to fp casts by source width
 and sign

Scalar sources between a byte and 31 bits fell to the default cost of one
while the matching vector lanes were already priced, which skewed the
difference SLP weighs a bundle against. Such a source is extended before
the conversion, and what the extension takes depends on the width, on the
sign and on whether the subtarget has SDWA and 16 bit instructions.
Sources narrower than a byte are left alone, because their vector form is
not priced either.
---
 .../AMDGPU/AMDGPUTargetTransformInfo.cpp      |  38 +-
 .../CostModel/AMDGPU/narrow-int-to-bfloat.ll  |  90 +--
 .../CostModel/AMDGPU/narrow-int-to-fp.ll      | 518 +++++++++---------
 3 files changed, 333 insertions(+), 313 deletions(-)

diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
index 25550ffb5369d..9942b5133dbc1 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
@@ -1087,20 +1087,16 @@ InstructionCost GCNTTIImpl::getCastInstrCost(unsigned Opcode, Type *Dst,
   if (IsIntToFP) {
     const unsigned ExtOps = UsesInt64 && SrcBits < 64 ? (IsSigned ? 2 : 1) : 0;
     if (FPTy->isBFloatTy()) {
-      const bool NarrowLanes =
-          SrcBits >= 8 && SrcBits < 32 && isa<FixedVectorType>(Src);
-      if (!NarrowLanes && SrcBits != 8 && SrcBits != 16 && SrcBits != 32 &&
-          !UsesInt64)
+      if (SrcBits < 8 || (SrcBits > 32 && !UsesInt64))
         return BaseT::getCastInstrCost(Opcode, Dst, Src, CCH, CostKind, I);
 
       // Each integer is converted to f32 first.
       InstructionCost FloatCost =
           Scale(UsesInt64 ? ExtOps + (IsSigned ? 12 : 8) : 1);
-      if (NarrowLanes) {
-        auto *FloatTy =
-            FixedVectorType::get(Type::getFloatTy(Dst->getContext()), NElts);
-        FloatCost = getCastInstrCost(Opcode, FloatTy, Src, CCH, CostKind);
-      }
+      if (SrcBits < 32)
+        FloatCost = getCastInstrCost(
+            Opcode, Dst->getWithNewType(Type::getFloatTy(Dst->getContext())),
+            Src, CCH, CostKind);
 
       // Native rounding can convert a pair. With 16 bit instructions the
       // expansion extracts the low significand bit, adds the rounding bias,
@@ -1174,6 +1170,30 @@ InstructionCost GCNTTIImpl::getCastInstrCost(unsigned Opcode, Type *Dst,
       return Scale(PerElt);
     }
 
+    // A narrow scalar source is extended before the conversion. An unsigned
+    // byte is converted straight out of its register, and a signed one with
+    // SDWA. A source wider than a byte but narrower than 16 bits is masked
+    // or sign extended first. Without 16 bit instructions a half result is
+    // rounded from f32.
+    if (SrcBits >= 8 && SrcBits < 32) {
+      const bool Narrow = SrcBits > 8 && SrcBits < 16;
+      const bool SignExtend16 = IsSigned && Narrow && ST->has16BitInsts();
+      if (FPTy->isDoubleTy())
+        return Scale(1 + 2 * SignExtend16, 1);
+      if (SrcBits > 16)
+        return Scale(FPTy->isHalfTy() ? 3 : 2);
+      if (FPTy->isHalfTy() && ST->has16BitInsts())
+        return Scale(Narrow ? (IsSigned ? 3 : 2)
+                     : SrcBits == 8 && !ST->hasSDWA() ? 2
+                                                      : 1);
+      const InstructionCost FloatCost =
+          SignExtend16                ? Scale(ST->hasSDWA() ? 3 : 4)
+          : Narrow                    ? Scale(2)
+          : SrcBits == 8 && !IsSigned ? Scale(1)
+                                      : Scale(ST->hasSDWA() ? 1 : 2);
+      return FPTy->isHalfTy() ? FloatCost + Scale(1) : FloatCost;
+    }
+
     return BaseT::getCastInstrCost(Opcode, Dst, Src, CCH, CostKind, I);
   }
 
diff --git a/llvm/test/Analysis/CostModel/AMDGPU/narrow-int-to-bfloat.ll b/llvm/test/Analysis/CostModel/AMDGPU/narrow-int-to-bfloat.ll
index 0e15b10325bc3..6e62f25e7d674 100644
--- a/llvm/test/Analysis/CostModel/AMDGPU/narrow-int-to-bfloat.ll
+++ b/llvm/test/Analysis/CostModel/AMDGPU/narrow-int-to-bfloat.ll
@@ -156,76 +156,76 @@ define void @narrow_to_bfloat(<4 x i8> %a, <4 x i12> %b, <4 x i16> %c, <4 x i17>
 
 define void @narrow_scalars_to_bfloat(i8 %a, i12 %b, i16 %c, i17 %d, i31 %e) {
 ; GFX6-LABEL: 'narrow_scalars_to_bfloat'
-; GFX6:  Cost Model: Found an estimated cost of 2 for instruction: %as = sitofp i8 %a to bfloat
+; GFX6:  Cost Model: Found an estimated cost of 3 for instruction: %as = sitofp i8 %a to bfloat
 ; GFX6:  Cost Model: Found an estimated cost of 2 for instruction: %au = uitofp i8 %a to bfloat
-; GFX6:  Cost Model: Found an estimated cost of 1 for instruction: %bs = sitofp i12 %b to bfloat
-; GFX6:  Cost Model: Found an estimated cost of 1 for instruction: %bu = uitofp i12 %b to bfloat
-; GFX6:  Cost Model: Found an estimated cost of 2 for instruction: %cs = sitofp i16 %c to bfloat
-; GFX6:  Cost Model: Found an estimated cost of 2 for instruction: %cu = uitofp i16 %c to bfloat
-; GFX6:  Cost Model: Found an estimated cost of 1 for instruction: %ds = sitofp i17 %d to bfloat
-; GFX6:  Cost Model: Found an estimated cost of 1 for instruction: %du = uitofp i17 %d to bfloat
-; GFX6:  Cost Model: Found an estimated cost of 1 for instruction: %es = sitofp i31 %e to bfloat
-; GFX6:  Cost Model: Found an estimated cost of 1 for instruction: %eu = uitofp i31 %e to bfloat
+; GFX6:  Cost Model: Found an estimated cost of 3 for instruction: %bs = sitofp i12 %b to bfloat
+; GFX6:  Cost Model: Found an estimated cost of 3 for instruction: %bu = uitofp i12 %b to bfloat
+; GFX6:  Cost Model: Found an estimated cost of 3 for instruction: %cs = sitofp i16 %c to bfloat
+; GFX6:  Cost Model: Found an estimated cost of 3 for instruction: %cu = uitofp i16 %c to bfloat
+; GFX6:  Cost Model: Found an estimated cost of 3 for instruction: %ds = sitofp i17 %d to bfloat
+; GFX6:  Cost Model: Found an estimated cost of 3 for instruction: %du = uitofp i17 %d to bfloat
+; GFX6:  Cost Model: Found an estimated cost of 3 for instruction: %es = sitofp i31 %e to bfloat
+; GFX6:  Cost Model: Found an estimated cost of 3 for instruction: %eu = uitofp i31 %e to bfloat
 ;
 ; GFX8-LABEL: 'narrow_scalars_to_bfloat'
 ; GFX8:  Cost Model: Found an estimated cost of 8 for instruction: %as = sitofp i8 %a to bfloat
 ; GFX8:  Cost Model: Found an estimated cost of 8 for instruction: %au = uitofp i8 %a to bfloat
-; GFX8:  Cost Model: Found an estimated cost of 1 for instruction: %bs = sitofp i12 %b to bfloat
-; GFX8:  Cost Model: Found an estimated cost of 1 for instruction: %bu = uitofp i12 %b to bfloat
+; GFX8:  Cost Model: Found an estimated cost of 10 for instruction: %bs = sitofp i12 %b to bfloat
+; GFX8:  Cost Model: Found an estimated cost of 9 for instruction: %bu = uitofp i12 %b to bfloat
 ; GFX8:  Cost Model: Found an estimated cost of 8 for instruction: %cs = sitofp i16 %c to bfloat
 ; GFX8:  Cost Model: Found an estimated cost of 8 for instruction: %cu = uitofp i16 %c to bfloat
-; GFX8:  Cost Model: Found an estimated cost of 1 for instruction: %ds = sitofp i17 %d to bfloat
-; GFX8:  Cost Model: Found an estimated cost of 1 for instruction: %du = uitofp i17 %d to bfloat
-; GFX8:  Cost Model: Found an estimated cost of 1 for instruction: %es = sitofp i31 %e to bfloat
-; GFX8:  Cost Model: Found an estimated cost of 1 for instruction: %eu = uitofp i31 %e to bfloat
+; GFX8:  Cost Model: Found an estimated cost of 9 for instruction: %ds = sitofp i17 %d to bfloat
+; GFX8:  Cost Model: Found an estimated cost of 9 for instruction: %du = uitofp i17 %d to bfloat
+; GFX8:  Cost Model: Found an estimated cost of 9 for instruction: %es = sitofp i31 %e to bfloat
+; GFX8:  Cost Model: Found an estimated cost of 9 for instruction: %eu = uitofp i31 %e to bfloat
 ;
 ; GFX9-LABEL: 'narrow_scalars_to_bfloat'
 ; GFX9:  Cost Model: Found an estimated cost of 7 for instruction: %as = sitofp i8 %a to bfloat
 ; GFX9:  Cost Model: Found an estimated cost of 7 for instruction: %au = uitofp i8 %a to bfloat
-; GFX9:  Cost Model: Found an estimated cost of 1 for instruction: %bs = sitofp i12 %b to bfloat
-; GFX9:  Cost Model: Found an estimated cost of 1 for instruction: %bu = uitofp i12 %b to bfloat
+; GFX9:  Cost Model: Found an estimated cost of 9 for instruction: %bs = sitofp i12 %b to bfloat
+; GFX9:  Cost Model: Found an estimated cost of 8 for instruction: %bu = uitofp i12 %b to bfloat
 ; GFX9:  Cost Model: Found an estimated cost of 7 for instruction: %cs = sitofp i16 %c to bfloat
 ; GFX9:  Cost Model: Found an estimated cost of 7 for instruction: %cu = uitofp i16 %c to bfloat
-; GFX9:  Cost Model: Found an estimated cost of 1 for instruction: %ds = sitofp i17 %d to bfloat
-; GFX9:  Cost Model: Found an estimated cost of 1 for instruction: %du = uitofp i17 %d to bfloat
-; GFX9:  Cost Model: Found an estimated cost of 1 for instruction: %es = sitofp i31 %e to bfloat
-; GFX9:  Cost Model: Found an estimated cost of 1 for instruction: %eu = uitofp i31 %e to bfloat
+; GFX9:  Cost Model: Found an estimated cost of 8 for instruction: %ds = sitofp i17 %d to bfloat
+; GFX9:  Cost Model: Found an estimated cost of 8 for instruction: %du = uitofp i17 %d to bfloat
+; GFX9:  Cost Model: Found an estimated cost of 8 for instruction: %es = sitofp i31 %e to bfloat
+; GFX9:  Cost Model: Found an estimated cost of 8 for instruction: %eu = uitofp i31 %e to bfloat
 ;
 ; NOSDWA-LABEL: 'narrow_scalars_to_bfloat'
-; NOSDWA:  Cost Model: Found an estimated cost of 7 for instruction: %as = sitofp i8 %a to bfloat
+; NOSDWA:  Cost Model: Found an estimated cost of 8 for instruction: %as = sitofp i8 %a to bfloat
 ; NOSDWA:  Cost Model: Found an estimated cost of 7 for instruction: %au = uitofp i8 %a to bfloat
-; NOSDWA:  Cost Model: Found an estimated cost of 1 for instruction: %bs = sitofp i12 %b to bfloat
-; NOSDWA:  Cost Model: Found an estimated cost of 1 for instruction: %bu = uitofp i12 %b to bfloat
-; NOSDWA:  Cost Model: Found an estimated cost of 7 for instruction: %cs = sitofp i16 %c to bfloat
-; NOSDWA:  Cost Model: Found an estimated cost of 7 for instruction: %cu = uitofp i16 %c to bfloat
-; NOSDWA:  Cost Model: Found an estimated cost of 1 for instruction: %ds = sitofp i17 %d to bfloat
-; NOSDWA:  Cost Model: Found an estimated cost of 1 for instruction: %du = uitofp i17 %d to bfloat
-; NOSDWA:  Cost Model: Found an estimated cost of 1 for instruction: %es = sitofp i31 %e to bfloat
-; NOSDWA:  Cost Model: Found an estimated cost of 1 for instruction: %eu = uitofp i31 %e to bfloat
+; NOSDWA:  Cost Model: Found an estimated cost of 10 for instruction: %bs = sitofp i12 %b to bfloat
+; NOSDWA:  Cost Model: Found an estimated cost of 8 for instruction: %bu = uitofp i12 %b to bfloat
+; NOSDWA:  Cost Model: Found an estimated cost of 8 for instruction: %cs = sitofp i16 %c to bfloat
+; NOSDWA:  Cost Model: Found an estimated cost of 8 for instruction: %cu = uitofp i16 %c to bfloat
+; NOSDWA:  Cost Model: Found an estimated cost of 8 for instruction: %ds = sitofp i17 %d to bfloat
+; NOSDWA:  Cost Model: Found an estimated cost of 8 for instruction: %du = uitofp i17 %d to bfloat
+; NOSDWA:  Cost Model: Found an estimated cost of 8 for instruction: %es = sitofp i31 %e to bfloat
+; NOSDWA:  Cost Model: Found an estimated cost of 8 for instruction: %eu = uitofp i31 %e to bfloat
 ;
 ; GFX950-LABEL: 'narrow_scalars_to_bfloat'
 ; GFX950:  Cost Model: Found an estimated cost of 2 for instruction: %as = sitofp i8 %a to bfloat
 ; GFX950:  Cost Model: Found an estimated cost of 2 for instruction: %au = uitofp i8 %a to bfloat
-; GFX950:  Cost Model: Found an estimated cost of 1 for instruction: %bs = sitofp i12 %b to bfloat
-; GFX950:  Cost Model: Found an estimated cost of 1 for instruction: %bu = uitofp i12 %b to bfloat
+; GFX950:  Cost Model: Found an estimated cost of 4 for instruction: %bs = sitofp i12 %b to bfloat
+; GFX950:  Cost Model: Found an estimated cost of 3 for instruction: %bu = uitofp i12 %b to bfloat
 ; GFX950:  Cost Model: Found an estimated cost of 2 for instruction: %cs = sitofp i16 %c to bfloat
 ; GFX950:  Cost Model: Found an estimated cost of 2 for instruction: %cu = uitofp i16 %c to bfloat
-; GFX950:  Cost Model: Found an estimated cost of 1 for instruction: %ds = sitofp i17 %d to bfloat
-; GFX950:  Cost Model: Found an estimated cost of 1 for instruction: %du = uitofp i17 %d to bfloat
-; GFX950:  Cost Model: Found an estimated cost of 1 for instruction: %es = sitofp i31 %e to bfloat
-; GFX950:  Cost Model: Found an estimated cost of 1 for instruction: %eu = uitofp i31 %e to bfloat
+; GFX950:  Cost Model: Found an estimated cost of 3 for instruction: %ds = sitofp i17 %d to bfloat
+; GFX950:  Cost Model: Found an estimated cost of 3 for instruction: %du = uitofp i17 %d to bfloat
+; GFX950:  Cost Model: Found an estimated cost of 3 for instruction: %es = sitofp i31 %e to bfloat
+; GFX950:  Cost Model: Found an estimated cost of 3 for instruction: %eu = uitofp i31 %e to bfloat
 ;
 ; GFX1250-LABEL: 'narrow_scalars_to_bfloat'
-; GFX1250:  Cost Model: Found an estimated cost of 2 for instruction: %as = sitofp i8 %a to bfloat
+; GFX1250:  Cost Model: Found an estimated cost of 3 for instruction: %as = sitofp i8 %a to bfloat
 ; GFX1250:  Cost Model: Found an estimated cost of 2 for instruction: %au = uitofp i8 %a to bfloat
-; GFX1250:  Cost Model: Found an estimated cost of 1 for instruction: %bs = sitofp i12 %b to bfloat
-; GFX1250:  Cost Model: Found an estimated cost of 1 for instruction: %bu = uitofp i12 %b to bfloat
-; GFX1250:  Cost Model: Found an estimated cost of 2 for instruction: %cs = sitofp i16 %c to bfloat
-; GFX1250:  Cost Model: Found an estimated cost of 2 for instruction: %cu = uitofp i16 %c to bfloat
-; GFX1250:  Cost Model: Found an estimated cost of 1 for instruction: %ds = sitofp i17 %d to bfloat
-; GFX1250:  Cost Model: Found an estimated cost of 1 for instruction: %du = uitofp i17 %d to bfloat
-; GFX1250:  Cost Model: Found an estimated cost of 1 for instruction: %es = sitofp i31 %e to bfloat
-; GFX1250:  Cost Model: Found an estimated cost of 1 for instruction: %eu = uitofp i31 %e to bfloat
+; GFX1250:  Cost Model: Found an estimated cost of 5 for instruction: %bs = sitofp i12 %b to bfloat
+; GFX1250:  Cost Model: Found an estimated cost of 3 for instruction: %bu = uitofp i12 %b to bfloat
+; GFX1250:  Cost Model: Found an estimated cost of 3 for instruction: %cs = sitofp i16 %c to bfloat
+; GFX1250:  Cost Model: Found an estimated cost of 3 for instruction: %cu = uitofp i16 %c to bfloat
+; GFX1250:  Cost Model: Found an estimated cost of 3 for instruction: %ds = sitofp i17 %d to bfloat
+; GFX1250:  Cost Model: Found an estimated cost of 3 for instruction: %du = uitofp i17 %d to bfloat
+; GFX1250:  Cost Model: Found an estimated cost of 3 for instruction: %es = sitofp i31 %e to bfloat
+; GFX1250:  Cost Model: Found an estimated cost of 3 for instruction: %eu = uitofp i31 %e to bfloat
 ;
   %as = sitofp i8 %a to bfloat
   %au = uitofp i8 %a to bfloat
diff --git a/llvm/test/Analysis/CostModel/AMDGPU/narrow-int-to-fp.ll b/llvm/test/Analysis/CostModel/AMDGPU/narrow-int-to-fp.ll
index 8f4ec6ddbffd0..aaaaa7cf13dac 100644
--- a/llvm/test/Analysis/CostModel/AMDGPU/narrow-int-to-fp.ll
+++ b/llvm/test/Analysis/CostModel/AMDGPU/narrow-int-to-fp.ll
@@ -307,364 +307,364 @@ define void @wide_lanes_to_fp(<4 x i16> %a, <4 x i17> %b, <4 x i31> %c, <3 x i17
 
 define void @wide_scalars_to_fp(i16 %a, i17 %b, i31 %c, i12 %d, i32 %e, i8 %f) {
 ; NO16BIT-LABEL: 'wide_scalars_to_fp'
-; NO16BIT:  Cost Model: Found an estimated cost of 1 for instruction: %asf = sitofp i16 %a to float
-; NO16BIT:  Cost Model: Found an estimated cost of 1 for instruction: %auf = uitofp i16 %a to float
-; NO16BIT:  Cost Model: Found an estimated cost of 1 for instruction: %ash = sitofp i16 %a to half
-; NO16BIT:  Cost Model: Found an estimated cost of 1 for instruction: %auh = uitofp i16 %a to half
-; NO16BIT:  Cost Model: Found an estimated cost of 1 for instruction: %bsf = sitofp i17 %b to float
-; NO16BIT:  Cost Model: Found an estimated cost of 1 for instruction: %buf = uitofp i17 %b to float
-; NO16BIT:  Cost Model: Found an estimated cost of 1 for instruction: %bsh = sitofp i17 %b to half
-; NO16BIT:  Cost Model: Found an estimated cost of 1 for instruction: %buh = uitofp i17 %b to half
-; NO16BIT:  Cost Model: Found an estimated cost of 1 for instruction: %bsd = sitofp i17 %b to double
-; NO16BIT:  Cost Model: Found an estimated cost of 1 for instruction: %bud = uitofp i17 %b to double
-; NO16BIT:  Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp i31 %c to float
-; NO16BIT:  Cost Model: Found an estimated cost of 1 for instruction: %cuf = uitofp i31 %c to float
-; NO16BIT:  Cost Model: Found an estimated cost of 1 for instruction: %csh = sitofp i31 %c to half
-; NO16BIT:  Cost Model: Found an estimated cost of 1 for instruction: %cuh = uitofp i31 %c to half
-; NO16BIT:  Cost Model: Found an estimated cost of 1 for instruction: %dsf = sitofp i12 %d to float
-; NO16BIT:  Cost Model: Found an estimated cost of 1 for instruction: %duf = uitofp i12 %d to float
-; NO16BIT:  Cost Model: Found an estimated cost of 1 for instruction: %dsh = sitofp i12 %d to half
-; NO16BIT:  Cost Model: Found an estimated cost of 1 for instruction: %duh = uitofp i12 %d to half
+; NO16BIT:  Cost Model: Found an estimated cost of 2 for instruction: %asf = sitofp i16 %a to float
+; NO16BIT:  Cost Model: Found an estimated cost of 2 for instruction: %auf = uitofp i16 %a to float
+; NO16BIT:  Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i16 %a to half
+; NO16BIT:  Cost Model: Found an estimated cost of 3 for instruction: %auh = uitofp i16 %a to half
+; NO16BIT:  Cost Model: Found an estimated cost of 2 for instruction: %bsf = sitofp i17 %b to float
+; NO16BIT:  Cost Model: Found an estimated cost of 2 for instruction: %buf = uitofp i17 %b to float
+; NO16BIT:  Cost Model: Found an estimated cost of 3 for instruction: %bsh = sitofp i17 %b to half
+; NO16BIT:  Cost Model: Found an estimated cost of 3 for instruction: %buh = uitofp i17 %b to half
+; NO16BIT:  Cost Model: Found an estimated cost of 5 for instruction: %bsd = sitofp i17 %b to double
+; NO16BIT:  Cost Model: Found an estimated cost of 5 for instruction: %bud = uitofp i17 %b to double
+; NO16BIT:  Cost Model: Found an estimated cost of 2 for instruction: %csf = sitofp i31 %c to float
+; NO16BIT:  Cost Model: Found an estimated cost of 2 for instruction: %cuf = uitofp i31 %c to float
+; NO16BIT:  Cost Model: Found an estimated cost of 3 for instruction: %csh = sitofp i31 %c to half
+; NO16BIT:  Cost Model: Found an estimated cost of 3 for instruction: %cuh = uitofp i31 %c to half
+; NO16BIT:  Cost Model: Found an estimated cost of 2 for instruction: %dsf = sitofp i12 %d to float
+; NO16BIT:  Cost Model: Found an estimated cost of 2 for instruction: %duf = uitofp i12 %d to float
+; NO16BIT:  Cost Model: Found an estimated cost of 3 for instruction: %dsh = sitofp i12 %d to half
+; NO16BIT:  Cost Model: Found an estimated cost of 3 for instruction: %duh = uitofp i12 %d to half
 ; NO16BIT:  Cost Model: Found an estimated cost of 1 for instruction: %esf = sitofp i32 %e to float
 ; NO16BIT:  Cost Model: Found an estimated cost of 1 for instruction: %euf = uitofp i32 %e to float
 ; NO16BIT:  Cost Model: Found an estimated cost of 1 for instruction: %esh = sitofp i32 %e to half
 ; NO16BIT:  Cost Model: Found an estimated cost of 1 for instruction: %euh = uitofp i32 %e to half
-; NO16BIT:  Cost Model: Found an estimated cost of 1 for instruction: %asd = sitofp i16 %a to double
-; NO16BIT:  Cost Model: Found an estimated cost of 1 for instruction: %aud = uitofp i16 %a to double
-; NO16BIT:  Cost Model: Found an estimated cost of 1 for instruction: %csd = sitofp i31 %c to double
-; NO16BIT:  Cost Model: Found an estimated cost of 1 for instruction: %cud = uitofp i31 %c to double
-; NO16BIT:  Cost Model: Found an estimated cost of 1 for instruction: %dsd = sitofp i12 %d to double
-; NO16BIT:  Cost Model: Found an estimated cost of 1 for instruction: %dud = uitofp i12 %d to double
-; NO16BIT:  Cost Model: Found an estimated cost of 1 for instruction: %fsf = sitofp i8 %f to float
+; NO16BIT:  Cost Model: Found an estimated cost of 5 for instruction: %asd = sitofp i16 %a to double
+; NO16BIT:  Cost Model: Found an estimated cost of 5 for instruction: %aud = uitofp i16 %a to double
+; NO16BIT:  Cost Model: Found an estimated cost of 5 for instruction: %csd = sitofp i31 %c to double
+; NO16BIT:  Cost Model: Found an estimated cost of 5 for instruction: %cud = uitofp i31 %c to double
+; NO16BIT:  Cost Model: Found an estimated cost of 5 for instruction: %dsd = sitofp i12 %d to double
+; NO16BIT:  Cost Model: Found an estimated cost of 5 for instruction: %dud = uitofp i12 %d to double
+; NO16BIT:  Cost Model: Found an estimated cost of 2 for instruction: %fsf = sitofp i8 %f to float
 ; NO16BIT:  Cost Model: Found an estimated cost of 1 for instruction: %fuf = uitofp i8 %f to float
-; NO16BIT:  Cost Model: Found an estimated cost of 1 for instruction: %fsh = sitofp i8 %f to half
-; NO16BIT:  Cost Model: Found an estimated cost of 1 for instruction: %fuh = uitofp i8 %f to half
-; NO16BIT:  Cost Model: Found an estimated cost of 1 for instruction: %fsd = sitofp i8 %f to double
-; NO16BIT:  Cost Model: Found an estimated cost of 1 for instruction: %fud = uitofp i8 %f to double
+; NO16BIT:  Cost Model: Found an estimated cost of 3 for instruction: %fsh = sitofp i8 %f to half
+; NO16BIT:  Cost Model: Found an estimated cost of 2 for instruction: %fuh = uitofp i8 %f to half
+; NO16BIT:  Cost Model: Found an estimated cost of 5 for instruction: %fsd = sitofp i8 %f to double
+; NO16BIT:  Cost Model: Found an estimated cost of 5 for instruction: %fud = uitofp i8 %f to double
 ;
 ; GFX9-LABEL: 'wide_scalars_to_fp'
 ; GFX9:  Cost Model: Found an estimated cost of 1 for instruction: %asf = sitofp i16 %a to float
 ; GFX9:  Cost Model: Found an estimated cost of 1 for instruction: %auf = uitofp i16 %a to float
 ; GFX9:  Cost Model: Found an estimated cost of 1 for instruction: %ash = sitofp i16 %a to half
 ; GFX9:  Cost Model: Found an estimated cost of 1 for instruction: %auh = uitofp i16 %a to half
-; GFX9:  Cost Model: Found an estimated cost of 1 for instruction: %bsf = sitofp i17 %b to float
-; GFX9:  Cost Model: Found an estimated cost of 1 for instruction: %buf = uitofp i17 %b to float
-; GFX9:  Cost Model: Found an estimated cost of 1 for instruction: %bsh = sitofp i17 %b to half
-; GFX9:  Cost Model: Found an estimated cost of 1 for instruction: %buh = uitofp i17 %b to half
-; GFX9:  Cost Model: Found an estimated cost of 1 for instruction: %bsd = sitofp i17 %b to double
-; GFX9:  Cost Model: Found an estimated cost of 1 for instruction: %bud = uitofp i17 %b to double
-; GFX9:  Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp i31 %c to float
-; GFX9:  Cost Model: Found an estimated cost of 1 for instruction: %cuf = uitofp i31 %c to float
-; GFX9:  Cost Model: Found an estimated cost of 1 for instruction: %csh = sitofp i31 %c to half
-; GFX9:  Cost Model: Found an estimated cost of 1 for instruction: %cuh = uitofp i31 %c to half
-; GFX9:  Cost Model: Found an estimated cost of 1 for instruction: %dsf = sitofp i12 %d to float
-; GFX9:  Cost Model: Found an estimated cost of 1 for instruction: %duf = uitofp i12 %d to float
-; GFX9:  Cost Model: Found an estimated cost of 1 for instruction: %dsh = sitofp i12 %d to half
-; GFX9:  Cost Model: Found an estimated cost of 1 for instruction: %duh = uitofp i12 %d to half
+; GFX9:  Cost Model: Found an estimated cost of 2 for instruction: %bsf = sitofp i17 %b to float
+; GFX9:  Cost Model: Found an estimated cost of 2 for instruction: %buf = uitofp i17 %b to float
+; GFX9:  Cost Model: Found an estimated cost of 3 for instruction: %bsh = sitofp i17 %b to half
+; GFX9:  Cost Model: Found an estimated cost of 3 for instruction: %buh = uitofp i17 %b to half
+; GFX9:  Cost Model: Found an estimated cost of 5 for instruction: %bsd = sitofp i17 %b to double
+; GFX9:  Cost Model: Found an estimated cost of 5 for instruction: %bud = uitofp i17 %b to double
+; GFX9:  Cost Model: Found an estimated cost of 2 for instruction: %csf = sitofp i31 %c to float
+; GFX9:  Cost Model: Found an estimated cost of 2 for instruction: %cuf = uitofp i31 %c to float
+; GFX9:  Cost Model: Found an estimated cost of 3 for instruction: %csh = sitofp i31 %c to half
+; GFX9:  Cost Model: Found an estimated cost of 3 for instruction: %cuh = uitofp i31 %c to half
+; GFX9:  Cost Model: Found an estimated cost of 3 for instruction: %dsf = sitofp i12 %d to float
+; GFX9:  Cost Model: Found an estimated cost of 2 for instruction: %duf = uitofp i12 %d to float
+; GFX9:  Cost Model: Found an estimated cost of 3 for instruction: %dsh = sitofp i12 %d to half
+; GFX9:  Cost Model: Found an estimated cost of 2 for instruction: %duh = uitofp i12 %d to half
 ; GFX9:  Cost Model: Found an estimated cost of 1 for instruction: %esf = sitofp i32 %e to float
 ; GFX9:  Cost Model: Found an estimated cost of 1 for instruction: %euf = uitofp i32 %e to float
 ; GFX9:  Cost Model: Found an estimated cost of 1 for instruction: %esh = sitofp i32 %e to half
 ; GFX9:  Cost Model: Found an estimated cost of 1 for instruction: %euh = uitofp i32 %e to half
-; GFX9:  Cost Model: Found an estimated cost of 1 for instruction: %asd = sitofp i16 %a to double
-; GFX9:  Cost Model: Found an estimated cost of 1 for instruction: %aud = uitofp i16 %a to double
-; GFX9:  Cost Model: Found an estimated cost of 1 for instruction: %csd = sitofp i31 %c to double
-; GFX9:  Cost Model: Found an estimated cost of 1 for instruction: %cud = uitofp i31 %c to double
-; GFX9:  Cost Model: Found an estimated cost of 1 for instruction: %dsd = sitofp i12 %d to double
-; GFX9:  Cost Model: Found an estimated cost of 1 for instruction: %dud = uitofp i12 %d to double
+; GFX9:  Cost Model: Found an estimated cost of 5 for instruction: %asd = sitofp i16 %a to double
+; GFX9:  Cost Model: Found an estimated cost of 5 for instruction: %aud = uitofp i16 %a to double
+; GFX9:  Cost Model: Found an estimated cost of 5 for instruction: %csd = sitofp i31 %c to double
+; GFX9:  Cost Model: Found an estimated cost of 5 for instruction: %cud = uitofp i31 %c to double
+; GFX9:  Cost Model: Found an estimated cost of 7 for instruction: %dsd = sitofp i12 %d to double
+; GFX9:  Cost Model: Found an estimated cost of 5 for instruction: %dud = uitofp i12 %d to double
 ; GFX9:  Cost Model: Found an estimated cost of 1 for instruction: %fsf = sitofp i8 %f to float
 ; GFX9:  Cost Model: Found an estimated cost of 1 for instruction: %fuf = uitofp i8 %f to float
 ; GFX9:  Cost Model: Found an estimated cost of 1 for instruction: %fsh = sitofp i8 %f to half
 ; GFX9:  Cost Model: Found an estimated cost of 1 for instruction: %fuh = uitofp i8 %f to half
-; GFX9:  Cost Model: Found an estimated cost of 1 for instruction: %fsd = sitofp i8 %f to double
-; GFX9:  Cost Model: Found an estimated cost of 1 for instruction: %fud = uitofp i8 %f to double
+; GFX9:  Cost Model: Found an estimated cost of 5 for instruction: %fsd = sitofp i8 %f to double
+; GFX9:  Cost Model: Found an estimated cost of 5 for instruction: %fud = uitofp i8 %f to double
 ;
 ; GFX9-NOSDWA-LABEL: 'wide_scalars_to_fp'
-; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 1 for instruction: %asf = sitofp i16 %a to float
-; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 1 for instruction: %auf = uitofp i16 %a to float
+; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 2 for instruction: %asf = sitofp i16 %a to float
+; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 2 for instruction: %auf = uitofp i16 %a to float
 ; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 1 for instruction: %ash = sitofp i16 %a to half
 ; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 1 for instruction: %auh = uitofp i16 %a to half
-; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 1 for instruction: %bsf = sitofp i17 %b to float
-; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 1 for instruction: %buf = uitofp i17 %b to float
-; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 1 for instruction: %bsh = sitofp i17 %b to half
-; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 1 for instruction: %buh = uitofp i17 %b to half
-; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 1 for instruction: %bsd = sitofp i17 %b to double
-; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 1 for instruction: %bud = uitofp i17 %b to double
-; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp i31 %c to float
-; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 1 for instruction: %cuf = uitofp i31 %c to float
-; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 1 for instruction: %csh = sitofp i31 %c to half
-; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 1 for instruction: %cuh = uitofp i31 %c to half
-; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 1 for instruction: %dsf = sitofp i12 %d to float
-; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 1 for instruction: %duf = uitofp i12 %d to float
-; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 1 for instruction: %dsh = sitofp i12 %d to half
-; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 1 for instruction: %duh = uitofp i12 %d to half
+; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 2 for instruction: %bsf = sitofp i17 %b to float
+; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 2 for instruction: %buf = uitofp i17 %b to float
+; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 3 for instruction: %bsh = sitofp i17 %b to half
+; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 3 for instruction: %buh = uitofp i17 %b to half
+; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 5 for instruction: %bsd = sitofp i17 %b to double
+; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 5 for instruction: %bud = uitofp i17 %b to double
+; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 2 for instruction: %csf = sitofp i31 %c to float
+; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 2 for instruction: %cuf = uitofp i31 %c to float
+; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 3 for instruction: %csh = sitofp i31 %c to half
+; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 3 for instruction: %cuh = uitofp i31 %c to half
+; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 4 for instruction: %dsf = sitofp i12 %d to float
+; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 2 for instruction: %duf = uitofp i12 %d to float
+; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 3 for instruction: %dsh = sitofp i12 %d to half
+; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 2 for instruction: %duh = uitofp i12 %d to half
 ; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 1 for instruction: %esf = sitofp i32 %e to float
 ; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 1 for instruction: %euf = uitofp i32 %e to float
 ; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 1 for instruction: %esh = sitofp i32 %e to half
 ; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 1 for instruction: %euh = uitofp i32 %e to half
-; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 1 for instruction: %asd = sitofp i16 %a to double
-; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 1 for instruction: %aud = uitofp i16 %a to double
-; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 1 for instruction: %csd = sitofp i31 %c to double
-; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 1 for instruction: %cud = uitofp i31 %c to double
-; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 1 for instruction: %dsd = sitofp i12 %d to double
-; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 1 for instruction: %dud = uitofp i12 %d to double
-; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 1 for instruction: %fsf = sitofp i8 %f to float
+; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 5 for instruction: %asd = sitofp i16 %a to double
+; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 5 for instruction: %aud = uitofp i16 %a to double
+; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 5 for instruction: %csd = sitofp i31 %c to double
+; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 5 for instruction: %cud = uitofp i31 %c to double
+; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 7 for instruction: %dsd = sitofp i12 %d to double
+; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 5 for instruction: %dud = uitofp i12 %d to double
+; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 2 for instruction: %fsf = sitofp i8 %f to float
 ; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 1 for instruction: %fuf = uitofp i8 %f to float
-; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 1 for instruction: %fsh = sitofp i8 %f to half
-; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 1 for instruction: %fuh = uitofp i8 %f to half
-; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 1 for instruction: %fsd = sitofp i8 %f to double
-; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 1 for instruction: %fud = uitofp i8 %f to double
+; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 2 for instruction: %fsh = sitofp i8 %f to half
+; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 2 for instruction: %fuh = uitofp i8 %f to half
+; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 5 for instruction: %fsd = sitofp i8 %f to double
+; GFX9-NOSDWA:  Cost Model: Found an estimated cost of 5 for instruction: %fud = uitofp i8 %f to double
 ;
 ; GFX11-FAKE16-LABEL: 'wide_scalars_to_fp'
-; GFX11-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %asf = sitofp i16 %a to float
-; GFX11-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %auf = uitofp i16 %a to float
+; GFX11-FAKE16:  Cost Model: Found an estimated cost of 2 for instruction: %asf = sitofp i16 %a to float
+; GFX11-FAKE16:  Cost Model: Found an estimated cost of 2 for instruction: %auf = uitofp i16 %a to float
 ; GFX11-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %ash = sitofp i16 %a to half
 ; GFX11-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %auh = uitofp i16 %a to half
-; GFX11-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %bsf = sitofp i17 %b to float
-; GFX11-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %buf = uitofp i17 %b to float
-; GFX11-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %bsh = sitofp i17 %b to half
-; GFX11-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %buh = uitofp i17 %b to half
-; GFX11-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %bsd = sitofp i17 %b to double
-; GFX11-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %bud = uitofp i17 %b to double
-; GFX11-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp i31 %c to float
-; GFX11-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %cuf = uitofp i31 %c to float
-; GFX11-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %csh = sitofp i31 %c to half
-; GFX11-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %cuh = uitofp i31 %c to half
-; GFX11-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %dsf = sitofp i12 %d to float
-; GFX11-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %duf = uitofp i12 %d to float
-; GFX11-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %dsh = sitofp i12 %d to half
-; GFX11-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %duh = uitofp i12 %d to half
+; GFX11-FAKE16:  Cost Model: Found an estimated cost of 2 for instruction: %bsf = sitofp i17 %b to float
+; GFX11-FAKE16:  Cost Model: Found an estimated cost of 2 for instruction: %buf = uitofp i17 %b to float
+; GFX11-FAKE16:  Cost Model: Found an estimated cost of 3 for instruction: %bsh = sitofp i17 %b to half
+; GFX11-FAKE16:  Cost Model: Found an estimated cost of 3 for instruction: %buh = uitofp i17 %b to half
+; GFX11-FAKE16:  Cost Model: Found an estimated cost of 5 for instruction: %bsd = sitofp i17 %b to double
+; GFX11-FAKE16:  Cost Model: Found an estimated cost of 5 for instruction: %bud = uitofp i17 %b to double
+; GFX11-FAKE16:  Cost Model: Found an estimated cost of 2 for instruction: %csf = sitofp i31 %c to float
+; GFX11-FAKE16:  Cost Model: Found an estimated cost of 2 for instruction: %cuf = uitofp i31 %c to float
+; GFX11-FAKE16:  Cost Model: Found an estimated cost of 3 for instruction: %csh = sitofp i31 %c to half
+; GFX11-FAKE16:  Cost Model: Found an estimated cost of 3 for instruction: %cuh = uitofp i31 %c to half
+; GFX11-FAKE16:  Cost Model: Found an estimated cost of 4 for instruction: %dsf = sitofp i12 %d to float
+; GFX11-FAKE16:  Cost Model: Found an estimated cost of 2 for instruction: %duf = uitofp i12 %d to float
+; GFX11-FAKE16:  Cost Model: Found an estimated cost of 3 for instruction: %dsh = sitofp i12 %d to half
+; GFX11-FAKE16:  Cost Model: Found an estimated cost of 2 for instruction: %duh = uitofp i12 %d to half
 ; GFX11-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %esf = sitofp i32 %e to float
 ; GFX11-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %euf = uitofp i32 %e to float
 ; GFX11-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %esh = sitofp i32 %e to half
 ; GFX11-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %euh = uitofp i32 %e to half
-; GFX11-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %asd = sitofp i16 %a to double
-; GFX11-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %aud = uitofp i16 %a to double
-; GFX11-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %csd = sitofp i31 %c to double
-; GFX11-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %cud = uitofp i31 %c to double
-; GFX11-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %dsd = sitofp i12 %d to double
-; GFX11-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %dud = uitofp i12 %d to double
-; GFX11-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %fsf = sitofp i8 %f to float
+; GFX11-FAKE16:  Cost Model: Found an estimated cost of 5 for instruction: %asd = sitofp i16 %a to double
+; GFX11-FAKE16:  Cost Model: Found an estimated cost of 5 for instruction: %aud = uitofp i16 %a to double
+; GFX11-FAKE16:  Cost Model: Found an estimated cost of 5 for instruction: %csd = sitofp i31 %c to double
+; GFX11-FAKE16:  Cost Model: Found an estimated cost of 5 for instruction: %cud = uitofp i31 %c to double
+; GFX11-FAKE16:  Cost Model: Found an estimated cost of 7 for instruction: %dsd = sitofp i12 %d to double
+; GFX11-FAKE16:  Cost Model: Found an estimated cost of 5 for instruction: %dud = uitofp i12 %d to double
+; GFX11-FAKE16:  Cost Model: Found an estimated cost of 2 for instruction: %fsf = sitofp i8 %f to float
 ; GFX11-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %fuf = uitofp i8 %f to float
-; GFX11-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %fsh = sitofp i8 %f to half
-; GFX11-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %fuh = uitofp i8 %f to half
-; GFX11-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %fsd = sitofp i8 %f to double
-; GFX11-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %fud = uitofp i8 %f to double
+; GFX11-FAKE16:  Cost Model: Found an estimated cost of 2 for instruction: %fsh = sitofp i8 %f to half
+; GFX11-FAKE16:  Cost Model: Found an estimated cost of 2 for instruction: %fuh = uitofp i8 %f to half
+; GFX11-FAKE16:  Cost Model: Found an estimated cost of 5 for instruction: %fsd = sitofp i8 %f to double
+; GFX11-FAKE16:  Cost Model: Found an estimated cost of 5 for instruction: %fud = uitofp i8 %f to double
 ;
 ; GFX11-TRUE16-LABEL: 'wide_scalars_to_fp'
-; GFX11-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %asf = sitofp i16 %a to float
-; GFX11-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %auf = uitofp i16 %a to float
+; GFX11-TRUE16:  Cost Model: Found an estimated cost of 2 for instruction: %asf = sitofp i16 %a to float
+; GFX11-TRUE16:  Cost Model: Found an estimated cost of 2 for instruction: %auf = uitofp i16 %a to float
 ; GFX11-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %ash = sitofp i16 %a to half
 ; GFX11-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %auh = uitofp i16 %a to half
-; GFX11-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %bsf = sitofp i17 %b to float
-; GFX11-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %buf = uitofp i17 %b to float
-; GFX11-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %bsh = sitofp i17 %b to half
-; GFX11-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %buh = uitofp i17 %b to half
-; GFX11-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %bsd = sitofp i17 %b to double
-; GFX11-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %bud = uitofp i17 %b to double
-; GFX11-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp i31 %c to float
-; GFX11-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %cuf = uitofp i31 %c to float
-; GFX11-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %csh = sitofp i31 %c to half
-; GFX11-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %cuh = uitofp i31 %c to half
-; GFX11-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %dsf = sitofp i12 %d to float
-; GFX11-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %duf = uitofp i12 %d to float
-; GFX11-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %dsh = sitofp i12 %d to half
-; GFX11-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %duh = uitofp i12 %d to half
+; GFX11-TRUE16:  Cost Model: Found an estimated cost of 2 for instruction: %bsf = sitofp i17 %b to float
+; GFX11-TRUE16:  Cost Model: Found an estimated cost of 2 for instruction: %buf = uitofp i17 %b to float
+; GFX11-TRUE16:  Cost Model: Found an estimated cost of 3 for instruction: %bsh = sitofp i17 %b to half
+; GFX11-TRUE16:  Cost Model: Found an estimated cost of 3 for instruction: %buh = uitofp i17 %b to half
+; GFX11-TRUE16:  Cost Model: Found an estimated cost of 5 for instruction: %bsd = sitofp i17 %b to double
+; GFX11-TRUE16:  Cost Model: Found an estimated cost of 5 for instruction: %bud = uitofp i17 %b to double
+; GFX11-TRUE16:  Cost Model: Found an estimated cost of 2 for instruction: %csf = sitofp i31 %c to float
+; GFX11-TRUE16:  Cost Model: Found an estimated cost of 2 for instruction: %cuf = uitofp i31 %c to float
+; GFX11-TRUE16:  Cost Model: Found an estimated cost of 3 for instruction: %csh = sitofp i31 %c to half
+; GFX11-TRUE16:  Cost Model: Found an estimated cost of 3 for instruction: %cuh = uitofp i31 %c to half
+; GFX11-TRUE16:  Cost Model: Found an estimated cost of 4 for instruction: %dsf = sitofp i12 %d to float
+; GFX11-TRUE16:  Cost Model: Found an estimated cost of 2 for instruction: %duf = uitofp i12 %d to float
+; GFX11-TRUE16:  Cost Model: Found an estimated cost of 3 for instruction: %dsh = sitofp i12 %d to half
+; GFX11-TRUE16:  Cost Model: Found an estimated cost of 2 for instruction: %duh = uitofp i12 %d to half
 ; GFX11-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %esf = sitofp i32 %e to float
 ; GFX11-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %euf = uitofp i32 %e to float
 ; GFX11-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %esh = sitofp i32 %e to half
 ; GFX11-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %euh = uitofp i32 %e to half
-; GFX11-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %asd = sitofp i16 %a to double
-; GFX11-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %aud = uitofp i16 %a to double
-; GFX11-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %csd = sitofp i31 %c to double
-; GFX11-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %cud = uitofp i31 %c to double
-; GFX11-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %dsd = sitofp i12 %d to double
-; GFX11-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %dud = uitofp i12 %d to double
-; GFX11-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %fsf = sitofp i8 %f to float
+; GFX11-TRUE16:  Cost Model: Found an estimated cost of 5 for instruction: %asd = sitofp i16 %a to double
+; GFX11-TRUE16:  Cost Model: Found an estimated cost of 5 for instruction: %aud = uitofp i16 %a to double
+; GFX11-TRUE16:  Cost Model: Found an estimated cost of 5 for instruction: %csd = sitofp i31 %c to double
+; GFX11-TRUE16:  Cost Model: Found an estimated cost of 5 for instruction: %cud = uitofp i31 %c to double
+; GFX11-TRUE16:  Cost Model: Found an estimated cost of 7 for instruction: %dsd = sitofp i12 %d to double
+; GFX11-TRUE16:  Cost Model: Found an estimated cost of 5 for instruction: %dud = uitofp i12 %d to double
+; GFX11-TRUE16:  Cost Model: Found an estimated cost of 2 for instruction: %fsf = sitofp i8 %f to float
 ; GFX11-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %fuf = uitofp i8 %f to float
-; GFX11-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %fsh = sitofp i8 %f to half
-; GFX11-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %fuh = uitofp i8 %f to half
-; GFX11-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %fsd = sitofp i8 %f to double
-; GFX11-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %fud = uitofp i8 %f to double
+; GFX11-TRUE16:  Cost Model: Found an estimated cost of 2 for instruction: %fsh = sitofp i8 %f to half
+; GFX11-TRUE16:  Cost Model: Found an estimated cost of 2 for instruction: %fuh = uitofp i8 %f to half
+; GFX11-TRUE16:  Cost Model: Found an estimated cost of 5 for instruction: %fsd = sitofp i8 %f to double
+; GFX11-TRUE16:  Cost Model: Found an estimated cost of 5 for instruction: %fud = uitofp i8 %f to double
 ;
 ; GFX950-LABEL: 'wide_scalars_to_fp'
 ; GFX950:  Cost Model: Found an estimated cost of 1 for instruction: %asf = sitofp i16 %a to float
 ; GFX950:  Cost Model: Found an estimated cost of 1 for instruction: %auf = uitofp i16 %a to float
 ; GFX950:  Cost Model: Found an estimated cost of 1 for instruction: %ash = sitofp i16 %a to half
 ; GFX950:  Cost Model: Found an estimated cost of 1 for instruction: %auh = uitofp i16 %a to half
-; GFX950:  Cost Model: Found an estimated cost of 1 for instruction: %bsf = sitofp i17 %b to float
-; GFX950:  Cost Model: Found an estimated cost of 1 for instruction: %buf = uitofp i17 %b to float
-; GFX950:  Cost Model: Found an estimated cost of 1 for instruction: %bsh = sitofp i17 %b to half
-; GFX950:  Cost Model: Found an estimated cost of 1 for instruction: %buh = uitofp i17 %b to half
-; GFX950:  Cost Model: Found an estimated cost of 1 for instruction: %bsd = sitofp i17 %b to double
-; GFX950:  Cost Model: Found an estimated cost of 1 for instruction: %bud = uitofp i17 %b to double
-; GFX950:  Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp i31 %c to float
-; GFX950:  Cost Model: Found an estimated cost of 1 for instruction: %cuf = uitofp i31 %c to float
-; GFX950:  Cost Model: Found an estimated cost of 1 for instruction: %csh = sitofp i31 %c to half
-; GFX950:  Cost Model: Found an estimated cost of 1 for instruction: %cuh = uitofp i31 %c to half
-; GFX950:  Cost Model: Found an estimated cost of 1 for instruction: %dsf = sitofp i12 %d to float
-; GFX950:  Cost Model: Found an estimated cost of 1 for instruction: %duf = uitofp i12 %d to float
-; GFX950:  Cost Model: Found an estimated cost of 1 for instruction: %dsh = sitofp i12 %d to half
-; GFX950:  Cost Model: Found an estimated cost of 1 for instruction: %duh = uitofp i12 %d to half
+; GFX950:  Cost Model: Found an estimated cost of 2 for instruction: %bsf = sitofp i17 %b to float
+; GFX950:  Cost Model: Found an estimated cost of 2 for instruction: %buf = uitofp i17 %b to float
+; GFX950:  Cost Model: Found an estimated cost of 3 for instruction: %bsh = sitofp i17 %b to half
+; GFX950:  Cost Model: Found an estimated cost of 3 for instruction: %buh = uitofp i17 %b to half
+; GFX950:  Cost Model: Found an estimated cost of 2 for instruction: %bsd = sitofp i17 %b to double
+; GFX950:  Cost Model: Found an estimated cost of 2 for instruction: %bud = uitofp i17 %b to double
+; GFX950:  Cost Model: Found an estimated cost of 2 for instruction: %csf = sitofp i31 %c to float
+; GFX950:  Cost Model: Found an estimated cost of 2 for instruction: %cuf = uitofp i31 %c to float
+; GFX950:  Cost Model: Found an estimated cost of 3 for instruction: %csh = sitofp i31 %c to half
+; GFX950:  Cost Model: Found an estimated cost of 3 for instruction: %cuh = uitofp i31 %c to half
+; GFX950:  Cost Model: Found an estimated cost of 3 for instruction: %dsf = sitofp i12 %d to float
+; GFX950:  Cost Model: Found an estimated cost of 2 for instruction: %duf = uitofp i12 %d to float
+; GFX950:  Cost Model: Found an estimated cost of 3 for instruction: %dsh = sitofp i12 %d to half
+; GFX950:  Cost Model: Found an estimated cost of 2 for instruction: %duh = uitofp i12 %d to half
 ; GFX950:  Cost Model: Found an estimated cost of 1 for instruction: %esf = sitofp i32 %e to float
 ; GFX950:  Cost Model: Found an estimated cost of 1 for instruction: %euf = uitofp i32 %e to float
 ; GFX950:  Cost Model: Found an estimated cost of 1 for instruction: %esh = sitofp i32 %e to half
 ; GFX950:  Cost Model: Found an estimated cost of 1 for instruction: %euh = uitofp i32 %e to half
-; GFX950:  Cost Model: Found an estimated cost of 1 for instruction: %asd = sitofp i16 %a to double
-; GFX950:  Cost Model: Found an estimated cost of 1 for instruction: %aud = uitofp i16 %a to double
-; GFX950:  Cost Model: Found an estimated cost of 1 for instruction: %csd = sitofp i31 %c to double
-; GFX950:  Cost Model: Found an estimated cost of 1 for instruction: %cud = uitofp i31 %c to double
-; GFX950:  Cost Model: Found an estimated cost of 1 for instruction: %dsd = sitofp i12 %d to double
-; GFX950:  Cost Model: Found an estimated cost of 1 for instruction: %dud = uitofp i12 %d to double
+; GFX950:  Cost Model: Found an estimated cost of 2 for instruction: %asd = sitofp i16 %a to double
+; GFX950:  Cost Model: Found an estimated cost of 2 for instruction: %aud = uitofp i16 %a to double
+; GFX950:  Cost Model: Found an estimated cost of 2 for instruction: %csd = sitofp i31 %c to double
+; GFX950:  Cost Model: Found an estimated cost of 2 for instruction: %cud = uitofp i31 %c to double
+; GFX950:  Cost Model: Found an estimated cost of 4 for instruction: %dsd = sitofp i12 %d to double
+; GFX950:  Cost Model: Found an estimated cost of 2 for instruction: %dud = uitofp i12 %d to double
 ; GFX950:  Cost Model: Found an estimated cost of 1 for instruction: %fsf = sitofp i8 %f to float
 ; GFX950:  Cost Model: Found an estimated cost of 1 for instruction: %fuf = uitofp i8 %f to float
 ; GFX950:  Cost Model: Found an estimated cost of 1 for instruction: %fsh = sitofp i8 %f to half
 ; GFX950:  Cost Model: Found an estimated cost of 1 for instruction: %fuh = uitofp i8 %f to half
-; GFX950:  Cost Model: Found an estimated cost of 1 for instruction: %fsd = sitofp i8 %f to double
-; GFX950:  Cost Model: Found an estimated cost of 1 for instruction: %fud = uitofp i8 %f to double
+; GFX950:  Cost Model: Found an estimated cost of 2 for instruction: %fsd = sitofp i8 %f to double
+; GFX950:  Cost Model: Found an estimated cost of 2 for instruction: %fud = uitofp i8 %f to double
 ;
 ; GFX1250-FAKE16-LABEL: 'wide_scalars_to_fp'
-; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %asf = sitofp i16 %a to float
-; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %auf = uitofp i16 %a to float
+; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 2 for instruction: %asf = sitofp i16 %a to float
+; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 2 for instruction: %auf = uitofp i16 %a to float
 ; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %ash = sitofp i16 %a to half
 ; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %auh = uitofp i16 %a to half
-; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %bsf = sitofp i17 %b to float
-; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %buf = uitofp i17 %b to float
-; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %bsh = sitofp i17 %b to half
-; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %buh = uitofp i17 %b to half
-; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %bsd = sitofp i17 %b to double
-; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %bud = uitofp i17 %b to double
-; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp i31 %c to float
-; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %cuf = uitofp i31 %c to float
-; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %csh = sitofp i31 %c to half
-; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %cuh = uitofp i31 %c to half
-; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %dsf = sitofp i12 %d to float
-; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %duf = uitofp i12 %d to float
-; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %dsh = sitofp i12 %d to half
-; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %duh = uitofp i12 %d to half
+; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 2 for instruction: %bsf = sitofp i17 %b to float
+; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 2 for instruction: %buf = uitofp i17 %b to float
+; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 3 for instruction: %bsh = sitofp i17 %b to half
+; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 3 for instruction: %buh = uitofp i17 %b to half
+; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 5 for instruction: %bsd = sitofp i17 %b to double
+; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 5 for instruction: %bud = uitofp i17 %b to double
+; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 2 for instruction: %csf = sitofp i31 %c to float
+; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 2 for instruction: %cuf = uitofp i31 %c to float
+; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 3 for instruction: %csh = sitofp i31 %c to half
+; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 3 for instruction: %cuh = uitofp i31 %c to half
+; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 4 for instruction: %dsf = sitofp i12 %d to float
+; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 2 for instruction: %duf = uitofp i12 %d to float
+; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 3 for instruction: %dsh = sitofp i12 %d to half
+; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 2 for instruction: %duh = uitofp i12 %d to half
 ; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %esf = sitofp i32 %e to float
 ; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %euf = uitofp i32 %e to float
 ; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %esh = sitofp i32 %e to half
 ; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %euh = uitofp i32 %e to half
-; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %asd = sitofp i16 %a to double
-; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %aud = uitofp i16 %a to double
-; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %csd = sitofp i31 %c to double
-; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %cud = uitofp i31 %c to double
-; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %dsd = sitofp i12 %d to double
-; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %dud = uitofp i12 %d to double
-; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %fsf = sitofp i8 %f to float
+; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 5 for instruction: %asd = sitofp i16 %a to double
+; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 5 for instruction: %aud = uitofp i16 %a to double
+; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 5 for instruction: %csd = sitofp i31 %c to double
+; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 5 for instruction: %cud = uitofp i31 %c to double
+; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 7 for instruction: %dsd = sitofp i12 %d to double
+; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 5 for instruction: %dud = uitofp i12 %d to double
+; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 2 for instruction: %fsf = sitofp i8 %f to float
 ; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %fuf = uitofp i8 %f to float
-; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %fsh = sitofp i8 %f to half
-; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %fuh = uitofp i8 %f to half
-; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %fsd = sitofp i8 %f to double
-; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 1 for instruction: %fud = uitofp i8 %f to double
+; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 2 for instruction: %fsh = sitofp i8 %f to half
+; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 2 for instruction: %fuh = uitofp i8 %f to half
+; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 5 for instruction: %fsd = sitofp i8 %f to double
+; GFX1250-FAKE16:  Cost Model: Found an estimated cost of 5 for instruction: %fud = uitofp i8 %f to double
 ;
 ; GFX1250-TRUE16-LABEL: 'wide_scalars_to_fp'
-; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %asf = sitofp i16 %a to float
-; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %auf = uitofp i16 %a to float
+; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 2 for instruction: %asf = sitofp i16 %a to float
+; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 2 for instruction: %auf = uitofp i16 %a to float
 ; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %ash = sitofp i16 %a to half
 ; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %auh = uitofp i16 %a to half
-; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %bsf = sitofp i17 %b to float
-; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %buf = uitofp i17 %b to float
-; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %bsh = sitofp i17 %b to half
-; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %buh = uitofp i17 %b to half
-; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %bsd = sitofp i17 %b to double
-; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %bud = uitofp i17 %b to double
-; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp i31 %c to float
-; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %cuf = uitofp i31 %c to float
-; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %csh = sitofp i31 %c to half
-; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %cuh = uitofp i31 %c to half
-; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %dsf = sitofp i12 %d to float
-; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %duf = uitofp i12 %d to float
-; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %dsh = sitofp i12 %d to half
-; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %duh = uitofp i12 %d to half
+; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 2 for instruction: %bsf = sitofp i17 %b to float
+; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 2 for instruction: %buf = uitofp i17 %b to float
+; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 3 for instruction: %bsh = sitofp i17 %b to half
+; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 3 for instruction: %buh = uitofp i17 %b to half
+; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 5 for instruction: %bsd = sitofp i17 %b to double
+; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 5 for instruction: %bud = uitofp i17 %b to double
+; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 2 for instruction: %csf = sitofp i31 %c to float
+; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 2 for instruction: %cuf = uitofp i31 %c to float
+; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 3 for instruction: %csh = sitofp i31 %c to half
+; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 3 for instruction: %cuh = uitofp i31 %c to half
+; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 4 for instruction: %dsf = sitofp i12 %d to float
+; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 2 for instruction: %duf = uitofp i12 %d to float
+; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 3 for instruction: %dsh = sitofp i12 %d to half
+; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 2 for instruction: %duh = uitofp i12 %d to half
 ; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %esf = sitofp i32 %e to float
 ; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %euf = uitofp i32 %e to float
 ; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %esh = sitofp i32 %e to half
 ; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %euh = uitofp i32 %e to half
-; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %asd = sitofp i16 %a to double
-; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %aud = uitofp i16 %a to double
-; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %csd = sitofp i31 %c to double
-; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %cud = uitofp i31 %c to double
-; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %dsd = sitofp i12 %d to double
-; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %dud = uitofp i12 %d to double
-; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %fsf = sitofp i8 %f to float
+; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 5 for instruction: %asd = sitofp i16 %a to double
+; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 5 for instruction: %aud = uitofp i16 %a to double
+; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 5 for instruction: %csd = sitofp i31 %c to double
+; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 5 for instruction: %cud = uitofp i31 %c to double
+; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 7 for instruction: %dsd = sitofp i12 %d to double
+; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 5 for instruction: %dud = uitofp i12 %d to double
+; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 2 for instruction: %fsf = sitofp i8 %f to float
 ; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %fuf = uitofp i8 %f to float
-; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %fsh = sitofp i8 %f to half
-; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %fuh = uitofp i8 %f to half
-; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %fsd = sitofp i8 %f to double
-; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 1 for instruction: %fud = uitofp i8 %f to double
+; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 2 for instruction: %fsh = sitofp i8 %f to half
+; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 2 for instruction: %fuh = uitofp i8 %f to half
+; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 5 for instruction: %fsd = sitofp i8 %f to double
+; GFX1250-TRUE16:  Cost Model: Found an estimated cost of 5 for instruction: %fud = uitofp i8 %f to double
 ;
 ; GFX6-SIZE-LABEL: 'wide_scalars_to_fp'
-; GFX6-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %asf = sitofp i16 %a to float
-; GFX6-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %auf = uitofp i16 %a to float
-; GFX6-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %ash = sitofp i16 %a to half
-; GFX6-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %auh = uitofp i16 %a to half
-; GFX6-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %bsf = sitofp i17 %b to float
-; GFX6-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %buf = uitofp i17 %b to float
-; GFX6-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %bsh = sitofp i17 %b to half
-; GFX6-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %buh = uitofp i17 %b to half
-; GFX6-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %bsd = sitofp i17 %b to double
-; GFX6-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %bud = uitofp i17 %b to double
-; GFX6-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp i31 %c to float
-; GFX6-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %cuf = uitofp i31 %c to float
-; GFX6-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %csh = sitofp i31 %c to half
-; GFX6-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %cuh = uitofp i31 %c to half
-; GFX6-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %dsf = sitofp i12 %d to float
-; GFX6-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %duf = uitofp i12 %d to float
-; GFX6-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %dsh = sitofp i12 %d to half
-; GFX6-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %duh = uitofp i12 %d to half
+; GFX6-SIZE:  Cost Model: Found an estimated cost of 2 for instruction: %asf = sitofp i16 %a to float
+; GFX6-SIZE:  Cost Model: Found an estimated cost of 2 for instruction: %auf = uitofp i16 %a to float
+; GFX6-SIZE:  Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i16 %a to half
+; GFX6-SIZE:  Cost Model: Found an estimated cost of 3 for instruction: %auh = uitofp i16 %a to half
+; GFX6-SIZE:  Cost Model: Found an estimated cost of 2 for instruction: %bsf = sitofp i17 %b to float
+; GFX6-SIZE:  Cost Model: Found an estimated cost of 2 for instruction: %buf = uitofp i17 %b to float
+; GFX6-SIZE:  Cost Model: Found an estimated cost of 3 for instruction: %bsh = sitofp i17 %b to half
+; GFX6-SIZE:  Cost Model: Found an estimated cost of 3 for instruction: %buh = uitofp i17 %b to half
+; GFX6-SIZE:  Cost Model: Found an estimated cost of 3 for instruction: %bsd = sitofp i17 %b to double
+; GFX6-SIZE:  Cost Model: Found an estimated cost of 3 for instruction: %bud = uitofp i17 %b to double
+; GFX6-SIZE:  Cost Model: Found an estimated cost of 2 for instruction: %csf = sitofp i31 %c to float
+; GFX6-SIZE:  Cost Model: Found an estimated cost of 2 for instruction: %cuf = uitofp i31 %c to float
+; GFX6-SIZE:  Cost Model: Found an estimated cost of 3 for instruction: %csh = sitofp i31 %c to half
+; GFX6-SIZE:  Cost Model: Found an estimated cost of 3 for instruction: %cuh = uitofp i31 %c to half
+; GFX6-SIZE:  Cost Model: Found an estimated cost of 2 for instruction: %dsf = sitofp i12 %d to float
+; GFX6-SIZE:  Cost Model: Found an estimated cost of 2 for instruction: %duf = uitofp i12 %d to float
+; GFX6-SIZE:  Cost Model: Found an estimated cost of 3 for instruction: %dsh = sitofp i12 %d to half
+; GFX6-SIZE:  Cost Model: Found an estimated cost of 3 for instruction: %duh = uitofp i12 %d to half
 ; GFX6-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %esf = sitofp i32 %e to float
 ; GFX6-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %euf = uitofp i32 %e to float
 ; GFX6-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %esh = sitofp i32 %e to half
 ; GFX6-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %euh = uitofp i32 %e to half
-; GFX6-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %asd = sitofp i16 %a to double
-; GFX6-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %aud = uitofp i16 %a to double
-; GFX6-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %csd = sitofp i31 %c to double
-; GFX6-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %cud = uitofp i31 %c to double
-; GFX6-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %dsd = sitofp i12 %d to double
-; GFX6-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %dud = uitofp i12 %d to double
-; GFX6-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %fsf = sitofp i8 %f to float
+; GFX6-SIZE:  Cost Model: Found an estimated cost of 3 for instruction: %asd = sitofp i16 %a to double
+; GFX6-SIZE:  Cost Model: Found an estimated cost of 3 for instruction: %aud = uitofp i16 %a to double
+; GFX6-SIZE:  Cost Model: Found an estimated cost of 3 for instruction: %csd = sitofp i31 %c to double
+; GFX6-SIZE:  Cost Model: Found an estimated cost of 3 for instruction: %cud = uitofp i31 %c to double
+; GFX6-SIZE:  Cost Model: Found an estimated cost of 3 for instruction: %dsd = sitofp i12 %d to double
+; GFX6-SIZE:  Cost Model: Found an estimated cost of 3 for instruction: %dud = uitofp i12 %d to double
+; GFX6-SIZE:  Cost Model: Found an estimated cost of 2 for instruction: %fsf = sitofp i8 %f to float
 ; GFX6-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %fuf = uitofp i8 %f to float
-; GFX6-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %fsh = sitofp i8 %f to half
-; GFX6-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %fuh = uitofp i8 %f to half
-; GFX6-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %fsd = sitofp i8 %f to double
-; GFX6-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %fud = uitofp i8 %f to double
+; GFX6-SIZE:  Cost Model: Found an estimated cost of 3 for instruction: %fsh = sitofp i8 %f to half
+; GFX6-SIZE:  Cost Model: Found an estimated cost of 2 for instruction: %fuh = uitofp i8 %f to half
+; GFX6-SIZE:  Cost Model: Found an estimated cost of 3 for instruction: %fsd = sitofp i8 %f to double
+; GFX6-SIZE:  Cost Model: Found an estimated cost of 3 for instruction: %fud = uitofp i8 %f to double
 ;
 ; GFX9-SIZE-LABEL: 'wide_scalars_to_fp'
 ; GFX9-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %asf = sitofp i16 %a to float
 ; GFX9-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %auf = uitofp i16 %a to float
 ; GFX9-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %ash = sitofp i16 %a to half
 ; GFX9-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %auh = uitofp i16 %a to half
-; GFX9-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %bsf = sitofp i17 %b to float
-; GFX9-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %buf = uitofp i17 %b to float
-; GFX9-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %bsh = sitofp i17 %b to half
-; GFX9-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %buh = uitofp i17 %b to half
-; GFX9-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %bsd = sitofp i17 %b to double
-; GFX9-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %bud = uitofp i17 %b to double
-; GFX9-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp i31 %c to float
-; GFX9-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %cuf = uitofp i31 %c to float
-; GFX9-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %csh = sitofp i31 %c to half
-; GFX9-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %cuh = uitofp i31 %c to half
-; GFX9-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %dsf = sitofp i12 %d to float
-; GFX9-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %duf = uitofp i12 %d to float
-; GFX9-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %dsh = sitofp i12 %d to half
-; GFX9-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %duh = uitofp i12 %d to half
+; GFX9-SIZE:  Cost Model: Found an estimated cost of 2 for instruction: %bsf = sitofp i17 %b to float
+; GFX9-SIZE:  Cost Model: Found an estimated cost of 2 for instruction: %buf = uitofp i17 %b to float
+; GFX9-SIZE:  Cost Model: Found an estimated cost of 3 for instruction: %bsh = sitofp i17 %b to half
+; GFX9-SIZE:  Cost Model: Found an estimated cost of 3 for instruction: %buh = uitofp i17 %b to half
+; GFX9-SIZE:  Cost Model: Found an estimated cost of 3 for instruction: %bsd = sitofp i17 %b to double
+; GFX9-SIZE:  Cost Model: Found an estimated cost of 3 for instruction: %bud = uitofp i17 %b to double
+; GFX9-SIZE:  Cost Model: Found an estimated cost of 2 for instruction: %csf = sitofp i31 %c to float
+; GFX9-SIZE:  Cost Model: Found an estimated cost of 2 for instruction: %cuf = uitofp i31 %c to float
+; GFX9-SIZE:  Cost Model: Found an estimated cost of 3 for instruction: %csh = sitofp i31 %c to half
+; GFX9-SIZE:  Cost Model: Found an estimated cost of 3 for instruction: %cuh = uitofp i31 %c to half
+; GFX9-SIZE:  Cost Model: Found an estimated cost of 3 for instruction: %dsf = sitofp i12 %d to float
+; GFX9-SIZE:  Cost Model: Found an estimated cost of 2 for instruction: %duf = uitofp i12 %d to float
+; GFX9-SIZE:  Cost Model: Found an estimated cost of 3 for instruction: %dsh = sitofp i12 %d to half
+; GFX9-SIZE:  Cost Model: Found an estimated cost of 2 for instruction: %duh = uitofp i12 %d to half
 ; GFX9-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %esf = sitofp i32 %e to float
 ; GFX9-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %euf = uitofp i32 %e to float
 ; GFX9-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %esh = sitofp i32 %e to half
 ; GFX9-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %euh = uitofp i32 %e to half
-; GFX9-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %asd = sitofp i16 %a to double
-; GFX9-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %aud = uitofp i16 %a to double
-; GFX9-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %csd = sitofp i31 %c to double
-; GFX9-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %cud = uitofp i31 %c to double
-; GFX9-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %dsd = sitofp i12 %d to double
-; GFX9-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %dud = uitofp i12 %d to double
+; GFX9-SIZE:  Cost Model: Found an estimated cost of 3 for instruction: %asd = sitofp i16 %a to double
+; GFX9-SIZE:  Cost Model: Found an estimated cost of 3 for instruction: %aud = uitofp i16 %a to double
+; GFX9-SIZE:  Cost Model: Found an estimated cost of 3 for instruction: %csd = sitofp i31 %c to double
+; GFX9-SIZE:  Cost Model: Found an estimated cost of 3 for instruction: %cud = uitofp i31 %c to double
+; GFX9-SIZE:  Cost Model: Found an estimated cost of 5 for instruction: %dsd = sitofp i12 %d to double
+; GFX9-SIZE:  Cost Model: Found an estimated cost of 3 for instruction: %dud = uitofp i12 %d to double
 ; GFX9-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %fsf = sitofp i8 %f to float
 ; GFX9-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %fuf = uitofp i8 %f to float
 ; GFX9-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %fsh = sitofp i8 %f to half
 ; GFX9-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %fuh = uitofp i8 %f to half
-; GFX9-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %fsd = sitofp i8 %f to double
-; GFX9-SIZE:  Cost Model: Found an estimated cost of 1 for instruction: %fud = uitofp i8 %f to double
+; GFX9-SIZE:  Cost Model: Found an estimated cost of 3 for instruction: %fsd = sitofp i8 %f to double
+; GFX9-SIZE:  Cost Model: Found an estimated cost of 3 for instruction: %fud = uitofp i8 %f to double
 ;
   %asf = sitofp i16 %a to float
   %auf = uitofp i16 %a to float

>From 440959e19fab5c396fdf089ad24726aae82a0c78 Mon Sep 17 00:00:00 2001
From: Dmitry Sidorov <Dmitry.Sidorov at amd.com>
Date: Wed, 23 Sep 2026 00:19:00 +0200
Subject: [PATCH 2/2] format

---
 llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
index 9942b5133dbc1..b77ca617d42e7 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
@@ -1183,7 +1183,7 @@ InstructionCost GCNTTIImpl::getCastInstrCost(unsigned Opcode, Type *Dst,
       if (SrcBits > 16)
         return Scale(FPTy->isHalfTy() ? 3 : 2);
       if (FPTy->isHalfTy() && ST->has16BitInsts())
-        return Scale(Narrow ? (IsSigned ? 3 : 2)
+        return Scale(Narrow                           ? (IsSigned ? 3 : 2)
                      : SrcBits == 8 && !ST->hasSDWA() ? 2
                                                       : 1);
       const InstructionCost FloatCost =



More information about the llvm-branch-commits mailing list