[llvm-branch-commits] [llvm] [AMDGPU] Model the cost of the expanded integer to/from floating point casts (PR #223572)

Dmitry Sidorov via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Sep 15 02:33:21 PDT 2026


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

>From d42ce44dedfe47349b8f6472569c19ecd64a31cc Mon Sep 17 00:00:00 2001
From: Dmitry Sidorov <Dmitry.Sidorov at amd.com>
Date: Fri, 11 Sep 2026 03:53:56 +0200
Subject: [PATCH] [AMDGPU] Model the cost of the expanded integer to/from
 floating point casts

No instruction converts to or from a 64 bit integer, and narrow vector
lanes are converted one at a time. Price these expansions by the FP64
rate, sdwa and 16 bit instruction support, and price i33 to i63 like
i64 and bf16 like f32 plus rounding.

Assisted-by: Claude Code Opus 5
---
 .../AMDGPU/AMDGPUTargetTransformInfo.cpp      | 107 ++++
 llvm/test/Analysis/CostModel/AMDGPU/cast.ll   | 546 +++++++++++-------
 .../CostModel/AMDGPU/expanded-int-fp-casts.ll | 329 +++++++----
 llvm/test/Analysis/CostModel/AMDGPU/fptosi.ll | 104 ++--
 llvm/test/Analysis/CostModel/AMDGPU/fptoui.ll | 104 ++--
 5 files changed, 776 insertions(+), 414 deletions(-)

diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
index a7556278b7e0d..4b6261b64aea0 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
@@ -1021,6 +1021,113 @@ InstructionCost GCNTTIImpl::getCastInstrCost(unsigned Opcode, Type *Dst,
              getFullRateInstrCost();
   }
 
+  const int ISD = TLI->InstructionOpcodeToISD(Opcode);
+  switch (ISD) {
+  case ISD::SINT_TO_FP:
+  case ISD::UINT_TO_FP:
+  case ISD::FP_TO_SINT:
+  case ISD::FP_TO_UINT:
+    break;
+  default:
+    return BaseT::getCastInstrCost(Opcode, Dst, Src, CCH, CostKind, I);
+  }
+
+  const bool IsIntToFP = ISD == ISD::SINT_TO_FP || ISD == ISD::UINT_TO_FP;
+  Type *FPTy = (IsIntToFP ? Dst : Src)->getScalarType();
+  if (!FPTy->isHalfTy() && !FPTy->isBFloatTy() && !FPTy->isFloatTy() &&
+      !FPTy->isDoubleTy())
+    return BaseT::getCastInstrCost(Opcode, Dst, Src, CCH, CostKind, I);
+
+  unsigned NElts = 1;
+  if (auto *VT = dyn_cast<FixedVectorType>(Src))
+    NElts = VT->getNumElements();
+
+  const unsigned SrcBits = Src->getScalarSizeInBits();
+  const unsigned DstBits = Dst->getScalarSizeInBits();
+  const bool IsSigned = ISD == ISD::SINT_TO_FP || ISD == ISD::FP_TO_SINT;
+  const unsigned IntBits = IsIntToFP ? SrcBits : DstBits;
+  const bool UsesInt64 = IntBits > 32 && IntBits <= 64;
+
+  auto Scale = [&](unsigned FullRateOps,
+                   unsigned FP64Ops = 0) -> InstructionCost {
+    return NElts * (InstructionCost(FullRateOps) * getFullRateInstrCost() +
+                    InstructionCost(FP64Ops) * get64BitInstrCost(CostKind));
+  };
+
+  if (IsIntToFP) {
+    const unsigned ExtOps = UsesInt64 && SrcBits < 64 ? (IsSigned ? 2 : 1) : 0;
+    if (FPTy->isBFloatTy()) {
+      if (SrcBits != 8 && SrcBits != 16 && SrcBits != 32 && !UsesInt64)
+        return BaseT::getCastInstrCost(Opcode, Dst, Src, CCH, CostKind, I);
+
+      // Each integer is converted to f32 first.
+      unsigned PerElt = UsesInt64 ? ExtOps + (IsSigned ? 12 : 8) : 1;
+      if (isa<FixedVectorType>(Src) && SrcBits < 32 &&
+          (IsSigned || SrcBits == 16)) {
+        PerElt =
+            (ST->hasSDWA() ? 1 : 2) + (SrcBits == 8 && ST->has16BitInsts());
+      }
+
+      // Native rounding can convert a pair. With 16 bit instructions the
+      // expansion extracts the low significand bit, adds the rounding bias,
+      // preserves NaNs and shifts the result. Without gfx9 instructions the two
+      // additions cannot use v_add3_u32.
+      InstructionCost RoundCost =
+          ST->hasBF16ConversionInsts()
+              ? InstructionCost(divideCeil(NElts, 2)) * getFullRateInstrCost()
+              : Scale(!ST->has16BitInsts() ? 1
+                      : ST->hasGFX9Insts() ? 6
+                                           : 7);
+      return Scale(PerElt) + RoundCost;
+    }
+
+    // No instruction converts from a 64 bit integer.
+    if (UsesInt64) {
+      if (FPTy->isDoubleTy()) {
+        // Two conversions, ldexp and add, all using the FP64 rate.
+        return Scale(ExtOps, 4);
+      }
+      if (FPTy->isFloatTy())
+        return Scale(ExtOps + (IsSigned ? 12 : 8));
+      return Scale(ExtOps + (IsSigned ? 13 : 9));
+    }
+
+    // A narrow vector source is converted lane by lane.
+    if (SrcBits >= 8 && SrcBits < 32 && isa<FixedVectorType>(Src)) {
+      if (FPTy->isDoubleTy())
+        return Scale(1 + (SrcBits < 16 && IsSigned && ST->has16BitInsts()), 1);
+      // An unsigned byte is converted straight out of its register.
+      if (SrcBits == 8 && !IsSigned)
+        return BaseT::getCastInstrCost(Opcode, Dst, Src, CCH, CostKind, I);
+      if (SrcBits < 16 && !IsSigned)
+        return Scale(2);
+      unsigned PerElt = ST->hasSDWA() ? 1 : 2;
+      if (SrcBits < 16 && ST->has16BitInsts())
+        ++PerElt;
+      return Scale(PerElt);
+    }
+
+    return BaseT::getCastInstrCost(Opcode, Dst, Src, CCH, CostKind, I);
+  }
+
+  // No instruction converts to a 64 bit integer.
+  if (UsesInt64) {
+    const bool IsSigned64 = IsSigned || (DstBits < 64 && NElts == 1);
+    if (FPTy->isDoubleTy()) {
+      // With native trunc/floor there are six FP64 operations. The expanded
+      // rounding sequence has seven, plus integer operations and constants.
+      return ST->haveRoundOpsF64() ? Scale(1, 6) : Scale(22, 7);
+    }
+    if (FPTy->isFloatTy())
+      return Scale(IsSigned64 ? 13 : 6);
+    if (FPTy->isBFloatTy()) {
+      // Unlike half, bf16 does not fit in i32. Extend to f32 and use the full
+      // i64 expansion.
+      return Scale(1 + (IsSigned64 ? 13 : 6));
+    }
+    return Scale(3);
+  }
+
   return BaseT::getCastInstrCost(Opcode, Dst, Src, CCH, CostKind, I);
 }
 
diff --git a/llvm/test/Analysis/CostModel/AMDGPU/cast.ll b/llvm/test/Analysis/CostModel/AMDGPU/cast.ll
index eedca86f6bc32..9ef8bac382e71 100644
--- a/llvm/test/Analysis/CostModel/AMDGPU/cast.ll
+++ b/llvm/test/Analysis/CostModel/AMDGPU/cast.ll
@@ -1,15 +1,15 @@
 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
-; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=amdgpu11.00-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL,NOSDWA %s
-; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=amdgpu10.10-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL,FAST %s
-; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=amdgpu9.0a-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL,FAST %s
-; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=amdgpu9.00-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL,FAST %s
-; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=amdgpu6.01-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL,SLOW %s
+; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=amdgpu11.00-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL,QUARTER64,NOSDWA %s
+; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=amdgpu10.10-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL,FAST,QUARTER64,FAST-QUARTER64 %s
+; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=amdgpu9.0a-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL,FAST,FULL64 %s
+; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=amdgpu9.00-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL,FAST,QUARTER64,FAST-QUARTER64 %s
+; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=amdgpu6.01-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL,QUARTER64,SLOW %s
 
-; RUN: opt -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output -mtriple=amdgpu11.00-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL-SIZE,NOSDWA-SIZE %s
-; RUN: opt -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output -mtriple=amdgpu10.10-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL-SIZE,FAST-SIZE %s
-; RUN: opt -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output -mtriple=amdgpu9.0a-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL-SIZE,FAST-SIZE %s
-; RUN: opt -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output -mtriple=amdgpu9.00-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL-SIZE,FAST-SIZE %s
-; RUN: opt -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output -mtriple=amdgpu6.01-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL-SIZE,SLOW-SIZE %s
+; RUN: opt -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output -mtriple=amdgpu11.00-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL-SIZE,QUARTER64-SIZE,NOSDWA-SIZE %s
+; RUN: opt -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output -mtriple=amdgpu10.10-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL-SIZE,FAST-SIZE,QUARTER64-SIZE,FAST-QUARTER64-SIZE %s
+; RUN: opt -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output -mtriple=amdgpu9.0a-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL-SIZE,FAST-SIZE,FULL64-SIZE %s
+; RUN: opt -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output -mtriple=amdgpu9.00-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL-SIZE,FAST-SIZE,QUARTER64-SIZE,FAST-QUARTER64-SIZE %s
+; RUN: opt -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output -mtriple=amdgpu6.01-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL-SIZE,QUARTER64-SIZE,SLOW-SIZE %s
 ; END.
 
 define i32 @add(i32 %arg) {
@@ -308,32 +308,43 @@ define void @sitofp4(<4 x i1> %a, <4 x i8> %b, <4 x i16> %c, <4 x i32> %d) {
 ; NOSDWA-LABEL: 'sitofp4'
 ; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %A1 = sitofp <4 x i1> %a to <4 x float>
 ; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %A2 = sitofp <4 x i1> %a to <4 x double>
-; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %B1 = sitofp <4 x i8> %b to <4 x float>
-; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %B2 = sitofp <4 x i8> %b to <4 x double>
-; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %C1 = sitofp <4 x i16> %c to <4 x float>
-; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %C2 = sitofp <4 x i16> %c to <4 x double>
+; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %B1 = sitofp <4 x i8> %b to <4 x float>
+; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 24 for instruction: %B2 = sitofp <4 x i8> %b to <4 x double>
+; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %C1 = sitofp <4 x i16> %c to <4 x float>
+; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %C2 = sitofp <4 x i16> %c to <4 x double>
 ; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %D1 = sitofp <4 x i32> %d to <4 x float>
 ; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %D2 = sitofp <4 x i32> %d to <4 x double>
 ; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
-; FAST-LABEL: 'sitofp4'
-; FAST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %A1 = sitofp <4 x i1> %a to <4 x float>
-; FAST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %A2 = sitofp <4 x i1> %a to <4 x double>
-; FAST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %B1 = sitofp <4 x i8> %b to <4 x float>
-; FAST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %B2 = sitofp <4 x i8> %b to <4 x double>
-; FAST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %C1 = sitofp <4 x i16> %c to <4 x float>
-; FAST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %C2 = sitofp <4 x i16> %c to <4 x double>
-; FAST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %D1 = sitofp <4 x i32> %d to <4 x float>
-; FAST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %D2 = sitofp <4 x i32> %d to <4 x double>
-; FAST-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
+; FAST-QUARTER64-LABEL: 'sitofp4'
+; FAST-QUARTER64-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %A1 = sitofp <4 x i1> %a to <4 x float>
+; FAST-QUARTER64-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %A2 = sitofp <4 x i1> %a to <4 x double>
+; FAST-QUARTER64-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %B1 = sitofp <4 x i8> %b to <4 x float>
+; FAST-QUARTER64-NEXT:  Cost Model: Found an estimated cost of 24 for instruction: %B2 = sitofp <4 x i8> %b to <4 x double>
+; FAST-QUARTER64-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %C1 = sitofp <4 x i16> %c to <4 x float>
+; FAST-QUARTER64-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %C2 = sitofp <4 x i16> %c to <4 x double>
+; FAST-QUARTER64-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %D1 = sitofp <4 x i32> %d to <4 x float>
+; FAST-QUARTER64-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %D2 = sitofp <4 x i32> %d to <4 x double>
+; FAST-QUARTER64-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
+;
+; FULL64-LABEL: 'sitofp4'
+; FULL64-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %A1 = sitofp <4 x i1> %a to <4 x float>
+; FULL64-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %A2 = sitofp <4 x i1> %a to <4 x double>
+; FULL64-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %B1 = sitofp <4 x i8> %b to <4 x float>
+; FULL64-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %B2 = sitofp <4 x i8> %b to <4 x double>
+; FULL64-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %C1 = sitofp <4 x i16> %c to <4 x float>
+; FULL64-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %C2 = sitofp <4 x i16> %c to <4 x double>
+; FULL64-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %D1 = sitofp <4 x i32> %d to <4 x float>
+; FULL64-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %D2 = sitofp <4 x i32> %d to <4 x double>
+; FULL64-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; SLOW-LABEL: 'sitofp4'
 ; SLOW-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %A1 = sitofp <4 x i1> %a to <4 x float>
 ; SLOW-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %A2 = sitofp <4 x i1> %a to <4 x double>
-; SLOW-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %B1 = sitofp <4 x i8> %b to <4 x float>
-; SLOW-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %B2 = sitofp <4 x i8> %b to <4 x double>
-; SLOW-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %C1 = sitofp <4 x i16> %c to <4 x float>
-; SLOW-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %C2 = sitofp <4 x i16> %c to <4 x double>
+; SLOW-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %B1 = sitofp <4 x i8> %b to <4 x float>
+; SLOW-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %B2 = sitofp <4 x i8> %b to <4 x double>
+; SLOW-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %C1 = sitofp <4 x i16> %c to <4 x float>
+; SLOW-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %C2 = sitofp <4 x i16> %c to <4 x double>
 ; SLOW-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %D1 = sitofp <4 x i32> %d to <4 x float>
 ; SLOW-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %D2 = sitofp <4 x i32> %d to <4 x double>
 ; SLOW-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
@@ -341,32 +352,43 @@ define void @sitofp4(<4 x i1> %a, <4 x i8> %b, <4 x i16> %c, <4 x i32> %d) {
 ; NOSDWA-SIZE-LABEL: 'sitofp4'
 ; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %A1 = sitofp <4 x i1> %a to <4 x float>
 ; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %A2 = sitofp <4 x i1> %a to <4 x double>
-; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %B1 = sitofp <4 x i8> %b to <4 x float>
-; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %B2 = sitofp <4 x i8> %b to <4 x double>
-; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %C1 = sitofp <4 x i16> %c to <4 x float>
-; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %C2 = sitofp <4 x i16> %c to <4 x double>
+; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %B1 = sitofp <4 x i8> %b to <4 x float>
+; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %B2 = sitofp <4 x i8> %b to <4 x double>
+; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %C1 = sitofp <4 x i16> %c to <4 x float>
+; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %C2 = sitofp <4 x i16> %c to <4 x double>
 ; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %D1 = sitofp <4 x i32> %d to <4 x float>
 ; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %D2 = sitofp <4 x i32> %d to <4 x double>
 ; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
-; FAST-SIZE-LABEL: 'sitofp4'
-; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %A1 = sitofp <4 x i1> %a to <4 x float>
-; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %A2 = sitofp <4 x i1> %a to <4 x double>
-; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %B1 = sitofp <4 x i8> %b to <4 x float>
-; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %B2 = sitofp <4 x i8> %b to <4 x double>
-; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %C1 = sitofp <4 x i16> %c to <4 x float>
-; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %C2 = sitofp <4 x i16> %c to <4 x double>
-; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %D1 = sitofp <4 x i32> %d to <4 x float>
-; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %D2 = sitofp <4 x i32> %d to <4 x double>
-; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+; FAST-QUARTER64-SIZE-LABEL: 'sitofp4'
+; FAST-QUARTER64-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %A1 = sitofp <4 x i1> %a to <4 x float>
+; FAST-QUARTER64-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %A2 = sitofp <4 x i1> %a to <4 x double>
+; FAST-QUARTER64-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %B1 = sitofp <4 x i8> %b to <4 x float>
+; FAST-QUARTER64-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %B2 = sitofp <4 x i8> %b to <4 x double>
+; FAST-QUARTER64-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %C1 = sitofp <4 x i16> %c to <4 x float>
+; FAST-QUARTER64-SIZE-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %C2 = sitofp <4 x i16> %c to <4 x double>
+; FAST-QUARTER64-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %D1 = sitofp <4 x i32> %d to <4 x float>
+; FAST-QUARTER64-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %D2 = sitofp <4 x i32> %d to <4 x double>
+; FAST-QUARTER64-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+;
+; FULL64-SIZE-LABEL: 'sitofp4'
+; FULL64-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %A1 = sitofp <4 x i1> %a to <4 x float>
+; FULL64-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %A2 = sitofp <4 x i1> %a to <4 x double>
+; FULL64-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %B1 = sitofp <4 x i8> %b to <4 x float>
+; FULL64-SIZE-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %B2 = sitofp <4 x i8> %b to <4 x double>
+; FULL64-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %C1 = sitofp <4 x i16> %c to <4 x float>
+; FULL64-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %C2 = sitofp <4 x i16> %c to <4 x double>
+; FULL64-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %D1 = sitofp <4 x i32> %d to <4 x float>
+; FULL64-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %D2 = sitofp <4 x i32> %d to <4 x double>
+; FULL64-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
 ; SLOW-SIZE-LABEL: 'sitofp4'
 ; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %A1 = sitofp <4 x i1> %a to <4 x float>
 ; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %A2 = sitofp <4 x i1> %a to <4 x double>
-; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %B1 = sitofp <4 x i8> %b to <4 x float>
-; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %B2 = sitofp <4 x i8> %b to <4 x double>
-; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %C1 = sitofp <4 x i16> %c to <4 x float>
-; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %C2 = sitofp <4 x i16> %c to <4 x double>
+; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %B1 = sitofp <4 x i8> %b to <4 x float>
+; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %B2 = sitofp <4 x i8> %b to <4 x double>
+; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %C1 = sitofp <4 x i16> %c to <4 x float>
+; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %C2 = sitofp <4 x i16> %c to <4 x double>
 ; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %D1 = sitofp <4 x i32> %d to <4 x float>
 ; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %D2 = sitofp <4 x i32> %d to <4 x double>
 ; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
@@ -383,19 +405,47 @@ define void @sitofp4(<4 x i1> %a, <4 x i8> %b, <4 x i16> %c, <4 x i32> %d) {
 }
 
 define void @sitofp8(<8 x i1> %a, <8 x i8> %b, <8 x i16> %c, <8 x i32> %d) {
-; ALL-LABEL: 'sitofp8'
-; ALL-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %A1 = sitofp <8 x i1> %a to <8 x float>
-; ALL-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %B1 = sitofp <8 x i8> %b to <8 x float>
-; ALL-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %C1 = sitofp <8 x i16> %c to <8 x float>
-; ALL-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %D1 = sitofp <8 x i32> %d to <8 x float>
-; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
+; NOSDWA-LABEL: 'sitofp8'
+; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %A1 = sitofp <8 x i1> %a to <8 x float>
+; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 24 for instruction: %B1 = sitofp <8 x i8> %b to <8 x float>
+; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %C1 = sitofp <8 x i16> %c to <8 x float>
+; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %D1 = sitofp <8 x i32> %d to <8 x float>
+; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
-; ALL-SIZE-LABEL: 'sitofp8'
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %A1 = sitofp <8 x i1> %a to <8 x float>
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %B1 = sitofp <8 x i8> %b to <8 x float>
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %C1 = sitofp <8 x i16> %c to <8 x float>
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %D1 = sitofp <8 x i32> %d to <8 x float>
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+; FAST-LABEL: 'sitofp8'
+; FAST-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %A1 = sitofp <8 x i1> %a to <8 x float>
+; FAST-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %B1 = sitofp <8 x i8> %b to <8 x float>
+; FAST-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %C1 = sitofp <8 x i16> %c to <8 x float>
+; FAST-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %D1 = sitofp <8 x i32> %d to <8 x float>
+; FAST-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
+;
+; SLOW-LABEL: 'sitofp8'
+; SLOW-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %A1 = sitofp <8 x i1> %a to <8 x float>
+; SLOW-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %B1 = sitofp <8 x i8> %b to <8 x float>
+; SLOW-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %C1 = sitofp <8 x i16> %c to <8 x float>
+; SLOW-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %D1 = sitofp <8 x i32> %d to <8 x float>
+; SLOW-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
+;
+; NOSDWA-SIZE-LABEL: 'sitofp8'
+; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %A1 = sitofp <8 x i1> %a to <8 x float>
+; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 24 for instruction: %B1 = sitofp <8 x i8> %b to <8 x float>
+; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %C1 = sitofp <8 x i16> %c to <8 x float>
+; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %D1 = sitofp <8 x i32> %d to <8 x float>
+; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+;
+; FAST-SIZE-LABEL: 'sitofp8'
+; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %A1 = sitofp <8 x i1> %a to <8 x float>
+; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %B1 = sitofp <8 x i8> %b to <8 x float>
+; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %C1 = sitofp <8 x i16> %c to <8 x float>
+; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %D1 = sitofp <8 x i32> %d to <8 x float>
+; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+;
+; SLOW-SIZE-LABEL: 'sitofp8'
+; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %A1 = sitofp <8 x i1> %a to <8 x float>
+; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %B1 = sitofp <8 x i8> %b to <8 x float>
+; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %C1 = sitofp <8 x i16> %c to <8 x float>
+; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %D1 = sitofp <8 x i32> %d to <8 x float>
+; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
   %A1 = sitofp <8 x i1> %a to <8 x float>
   %B1 = sitofp <8 x i8> %b to <8 x float>
@@ -409,31 +459,42 @@ define void @uitofp4(<4 x i1> %a, <4 x i8> %b, <4 x i16> %c, <4 x i32> %d) {
 ; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %A1 = uitofp <4 x i1> %a to <4 x float>
 ; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %A2 = uitofp <4 x i1> %a to <4 x double>
 ; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %B1 = uitofp <4 x i8> %b to <4 x float>
-; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %B2 = uitofp <4 x i8> %b to <4 x double>
-; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %C1 = uitofp <4 x i16> %c to <4 x float>
-; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %C2 = uitofp <4 x i16> %c to <4 x double>
+; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %B2 = uitofp <4 x i8> %b to <4 x double>
+; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %C1 = uitofp <4 x i16> %c to <4 x float>
+; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %C2 = uitofp <4 x i16> %c to <4 x double>
 ; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %D1 = uitofp <4 x i32> %d to <4 x float>
 ; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %D2 = uitofp <4 x i32> %d to <4 x double>
 ; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
-; FAST-LABEL: 'uitofp4'
-; FAST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %A1 = uitofp <4 x i1> %a to <4 x float>
-; FAST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %A2 = uitofp <4 x i1> %a to <4 x double>
-; FAST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %B1 = uitofp <4 x i8> %b to <4 x float>
-; FAST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %B2 = uitofp <4 x i8> %b to <4 x double>
-; FAST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %C1 = uitofp <4 x i16> %c to <4 x float>
-; FAST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %C2 = uitofp <4 x i16> %c to <4 x double>
-; FAST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %D1 = uitofp <4 x i32> %d to <4 x float>
-; FAST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %D2 = uitofp <4 x i32> %d to <4 x double>
-; FAST-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
+; FAST-QUARTER64-LABEL: 'uitofp4'
+; FAST-QUARTER64-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %A1 = uitofp <4 x i1> %a to <4 x float>
+; FAST-QUARTER64-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %A2 = uitofp <4 x i1> %a to <4 x double>
+; FAST-QUARTER64-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %B1 = uitofp <4 x i8> %b to <4 x float>
+; FAST-QUARTER64-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %B2 = uitofp <4 x i8> %b to <4 x double>
+; FAST-QUARTER64-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %C1 = uitofp <4 x i16> %c to <4 x float>
+; FAST-QUARTER64-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %C2 = uitofp <4 x i16> %c to <4 x double>
+; FAST-QUARTER64-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %D1 = uitofp <4 x i32> %d to <4 x float>
+; FAST-QUARTER64-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %D2 = uitofp <4 x i32> %d to <4 x double>
+; FAST-QUARTER64-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
+;
+; FULL64-LABEL: 'uitofp4'
+; FULL64-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %A1 = uitofp <4 x i1> %a to <4 x float>
+; FULL64-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %A2 = uitofp <4 x i1> %a to <4 x double>
+; FULL64-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %B1 = uitofp <4 x i8> %b to <4 x float>
+; FULL64-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %B2 = uitofp <4 x i8> %b to <4 x double>
+; FULL64-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %C1 = uitofp <4 x i16> %c to <4 x float>
+; FULL64-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %C2 = uitofp <4 x i16> %c to <4 x double>
+; FULL64-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %D1 = uitofp <4 x i32> %d to <4 x float>
+; FULL64-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %D2 = uitofp <4 x i32> %d to <4 x double>
+; FULL64-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; SLOW-LABEL: 'uitofp4'
 ; SLOW-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %A1 = uitofp <4 x i1> %a to <4 x float>
 ; SLOW-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %A2 = uitofp <4 x i1> %a to <4 x double>
 ; SLOW-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %B1 = uitofp <4 x i8> %b to <4 x float>
-; SLOW-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %B2 = uitofp <4 x i8> %b to <4 x double>
-; SLOW-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %C1 = uitofp <4 x i16> %c to <4 x float>
-; SLOW-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %C2 = uitofp <4 x i16> %c to <4 x double>
+; SLOW-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %B2 = uitofp <4 x i8> %b to <4 x double>
+; SLOW-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %C1 = uitofp <4 x i16> %c to <4 x float>
+; SLOW-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %C2 = uitofp <4 x i16> %c to <4 x double>
 ; SLOW-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %D1 = uitofp <4 x i32> %d to <4 x float>
 ; SLOW-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %D2 = uitofp <4 x i32> %d to <4 x double>
 ; SLOW-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
@@ -442,31 +503,42 @@ define void @uitofp4(<4 x i1> %a, <4 x i8> %b, <4 x i16> %c, <4 x i32> %d) {
 ; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %A1 = uitofp <4 x i1> %a to <4 x float>
 ; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %A2 = uitofp <4 x i1> %a to <4 x double>
 ; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %B1 = uitofp <4 x i8> %b to <4 x float>
-; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %B2 = uitofp <4 x i8> %b to <4 x double>
-; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %C1 = uitofp <4 x i16> %c to <4 x float>
-; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %C2 = uitofp <4 x i16> %c to <4 x double>
+; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %B2 = uitofp <4 x i8> %b to <4 x double>
+; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %C1 = uitofp <4 x i16> %c to <4 x float>
+; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %C2 = uitofp <4 x i16> %c to <4 x double>
 ; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %D1 = uitofp <4 x i32> %d to <4 x float>
 ; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %D2 = uitofp <4 x i32> %d to <4 x double>
 ; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
-; FAST-SIZE-LABEL: 'uitofp4'
-; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %A1 = uitofp <4 x i1> %a to <4 x float>
-; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %A2 = uitofp <4 x i1> %a to <4 x double>
-; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %B1 = uitofp <4 x i8> %b to <4 x float>
-; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %B2 = uitofp <4 x i8> %b to <4 x double>
-; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %C1 = uitofp <4 x i16> %c to <4 x float>
-; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %C2 = uitofp <4 x i16> %c to <4 x double>
-; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %D1 = uitofp <4 x i32> %d to <4 x float>
-; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %D2 = uitofp <4 x i32> %d to <4 x double>
-; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+; FAST-QUARTER64-SIZE-LABEL: 'uitofp4'
+; FAST-QUARTER64-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %A1 = uitofp <4 x i1> %a to <4 x float>
+; FAST-QUARTER64-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %A2 = uitofp <4 x i1> %a to <4 x double>
+; FAST-QUARTER64-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %B1 = uitofp <4 x i8> %b to <4 x float>
+; FAST-QUARTER64-SIZE-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %B2 = uitofp <4 x i8> %b to <4 x double>
+; FAST-QUARTER64-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %C1 = uitofp <4 x i16> %c to <4 x float>
+; FAST-QUARTER64-SIZE-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %C2 = uitofp <4 x i16> %c to <4 x double>
+; FAST-QUARTER64-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %D1 = uitofp <4 x i32> %d to <4 x float>
+; FAST-QUARTER64-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %D2 = uitofp <4 x i32> %d to <4 x double>
+; FAST-QUARTER64-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+;
+; FULL64-SIZE-LABEL: 'uitofp4'
+; FULL64-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %A1 = uitofp <4 x i1> %a to <4 x float>
+; FULL64-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %A2 = uitofp <4 x i1> %a to <4 x double>
+; FULL64-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %B1 = uitofp <4 x i8> %b to <4 x float>
+; FULL64-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %B2 = uitofp <4 x i8> %b to <4 x double>
+; FULL64-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %C1 = uitofp <4 x i16> %c to <4 x float>
+; FULL64-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %C2 = uitofp <4 x i16> %c to <4 x double>
+; FULL64-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %D1 = uitofp <4 x i32> %d to <4 x float>
+; FULL64-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %D2 = uitofp <4 x i32> %d to <4 x double>
+; FULL64-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
 ; SLOW-SIZE-LABEL: 'uitofp4'
 ; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %A1 = uitofp <4 x i1> %a to <4 x float>
 ; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %A2 = uitofp <4 x i1> %a to <4 x double>
 ; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %B1 = uitofp <4 x i8> %b to <4 x float>
-; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %B2 = uitofp <4 x i8> %b to <4 x double>
-; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %C1 = uitofp <4 x i16> %c to <4 x float>
-; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %C2 = uitofp <4 x i16> %c to <4 x double>
+; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %B2 = uitofp <4 x i8> %b to <4 x double>
+; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %C1 = uitofp <4 x i16> %c to <4 x float>
+; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %C2 = uitofp <4 x i16> %c to <4 x double>
 ; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %D1 = uitofp <4 x i32> %d to <4 x float>
 ; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %D2 = uitofp <4 x i32> %d to <4 x double>
 ; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
@@ -483,19 +555,47 @@ define void @uitofp4(<4 x i1> %a, <4 x i8> %b, <4 x i16> %c, <4 x i32> %d) {
 }
 
 define void @uitofp8(<8 x i1> %a, <8 x i8> %b, <8 x i16> %c, <8 x i32> %d) {
-; ALL-LABEL: 'uitofp8'
-; ALL-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %A1 = uitofp <8 x i1> %a to <8 x float>
-; ALL-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %B1 = uitofp <8 x i8> %b to <8 x float>
-; ALL-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %C1 = uitofp <8 x i16> %c to <8 x float>
-; ALL-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %D1 = uitofp <8 x i32> %d to <8 x float>
-; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
+; NOSDWA-LABEL: 'uitofp8'
+; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %A1 = uitofp <8 x i1> %a to <8 x float>
+; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %B1 = uitofp <8 x i8> %b to <8 x float>
+; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %C1 = uitofp <8 x i16> %c to <8 x float>
+; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %D1 = uitofp <8 x i32> %d to <8 x float>
+; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
-; ALL-SIZE-LABEL: 'uitofp8'
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %A1 = uitofp <8 x i1> %a to <8 x float>
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %B1 = uitofp <8 x i8> %b to <8 x float>
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %C1 = uitofp <8 x i16> %c to <8 x float>
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %D1 = uitofp <8 x i32> %d to <8 x float>
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+; FAST-LABEL: 'uitofp8'
+; FAST-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %A1 = uitofp <8 x i1> %a to <8 x float>
+; FAST-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %B1 = uitofp <8 x i8> %b to <8 x float>
+; FAST-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %C1 = uitofp <8 x i16> %c to <8 x float>
+; FAST-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %D1 = uitofp <8 x i32> %d to <8 x float>
+; FAST-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
+;
+; SLOW-LABEL: 'uitofp8'
+; SLOW-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %A1 = uitofp <8 x i1> %a to <8 x float>
+; SLOW-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %B1 = uitofp <8 x i8> %b to <8 x float>
+; SLOW-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %C1 = uitofp <8 x i16> %c to <8 x float>
+; SLOW-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %D1 = uitofp <8 x i32> %d to <8 x float>
+; SLOW-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
+;
+; NOSDWA-SIZE-LABEL: 'uitofp8'
+; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %A1 = uitofp <8 x i1> %a to <8 x float>
+; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %B1 = uitofp <8 x i8> %b to <8 x float>
+; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %C1 = uitofp <8 x i16> %c to <8 x float>
+; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %D1 = uitofp <8 x i32> %d to <8 x float>
+; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+;
+; FAST-SIZE-LABEL: 'uitofp8'
+; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %A1 = uitofp <8 x i1> %a to <8 x float>
+; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %B1 = uitofp <8 x i8> %b to <8 x float>
+; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %C1 = uitofp <8 x i16> %c to <8 x float>
+; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %D1 = uitofp <8 x i32> %d to <8 x float>
+; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+;
+; SLOW-SIZE-LABEL: 'uitofp8'
+; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %A1 = uitofp <8 x i1> %a to <8 x float>
+; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %B1 = uitofp <8 x i8> %b to <8 x float>
+; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %C1 = uitofp <8 x i16> %c to <8 x float>
+; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %D1 = uitofp <8 x i32> %d to <8 x float>
+; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
   %A1 = uitofp <8 x i1> %a to <8 x float>
   %B1 = uitofp <8 x i8> %b to <8 x float>
@@ -505,15 +605,35 @@ define void @uitofp8(<8 x i1> %a, <8 x i8> %b, <8 x i16> %c, <8 x i32> %d) {
 }
 
 define void @sitofp16(<16 x i8> %b, <16 x i16> %c) {
-; ALL-LABEL: 'sitofp16'
-; ALL-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %B1 = sitofp <16 x i8> %b to <16 x float>
-; ALL-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %C1 = sitofp <16 x i16> %c to <16 x float>
-; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
+; NOSDWA-LABEL: 'sitofp16'
+; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 48 for instruction: %B1 = sitofp <16 x i8> %b to <16 x float>
+; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %C1 = sitofp <16 x i16> %c to <16 x float>
+; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
-; ALL-SIZE-LABEL: 'sitofp16'
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %B1 = sitofp <16 x i8> %b to <16 x float>
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %C1 = sitofp <16 x i16> %c to <16 x float>
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+; FAST-LABEL: 'sitofp16'
+; FAST-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %B1 = sitofp <16 x i8> %b to <16 x float>
+; FAST-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %C1 = sitofp <16 x i16> %c to <16 x float>
+; FAST-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
+;
+; SLOW-LABEL: 'sitofp16'
+; SLOW-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %B1 = sitofp <16 x i8> %b to <16 x float>
+; SLOW-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %C1 = sitofp <16 x i16> %c to <16 x float>
+; SLOW-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
+;
+; NOSDWA-SIZE-LABEL: 'sitofp16'
+; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 48 for instruction: %B1 = sitofp <16 x i8> %b to <16 x float>
+; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %C1 = sitofp <16 x i16> %c to <16 x float>
+; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+;
+; FAST-SIZE-LABEL: 'sitofp16'
+; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %B1 = sitofp <16 x i8> %b to <16 x float>
+; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %C1 = sitofp <16 x i16> %c to <16 x float>
+; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+;
+; SLOW-SIZE-LABEL: 'sitofp16'
+; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %B1 = sitofp <16 x i8> %b to <16 x float>
+; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %C1 = sitofp <16 x i16> %c to <16 x float>
+; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
   %B1 = sitofp <16 x i8> %b to <16 x float>
   %C1 = sitofp <16 x i16> %c to <16 x float>
@@ -521,75 +641,77 @@ define void @sitofp16(<16 x i8> %b, <16 x i16> %c) {
 }
 
 define void @uitofp16(<16 x i8> %b, <16 x i16> %c) {
-; ALL-LABEL: 'uitofp16'
-; ALL-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %B1 = uitofp <16 x i8> %b to <16 x float>
-; ALL-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %C1 = uitofp <16 x i16> %c to <16 x float>
-; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
-;
-; ALL-SIZE-LABEL: 'uitofp16'
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %B1 = uitofp <16 x i8> %b to <16 x float>
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %C1 = uitofp <16 x i16> %c to <16 x float>
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
-;
-  %B1 = uitofp <16 x i8> %b to <16 x float>
-  %C1 = uitofp <16 x i16> %c to <16 x float>
-  ret void
-}
-
-define void @sitofp_i64(i64 %a, <4 x i64> %b) {
-; NOSDWA-LABEL: 'sitofp_i64'
-; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %A1 = sitofp i64 %a to half
-; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %A2 = sitofp i64 %a to float
-; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %A3 = sitofp i64 %a to double
-; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %B1 = sitofp <4 x i64> %b to <4 x half>
-; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %B2 = sitofp <4 x i64> %b to <4 x float>
-; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %B3 = sitofp <4 x i64> %b to <4 x double>
+; NOSDWA-LABEL: 'uitofp16'
+; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %B1 = uitofp <16 x i8> %b to <16 x float>
+; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %C1 = uitofp <16 x i16> %c to <16 x float>
 ; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
-; FAST-LABEL: 'sitofp_i64'
-; FAST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %A1 = sitofp i64 %a to half
-; FAST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %A2 = sitofp i64 %a to float
-; FAST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %A3 = sitofp i64 %a to double
-; FAST-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %B1 = sitofp <4 x i64> %b to <4 x half>
-; FAST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %B2 = sitofp <4 x i64> %b to <4 x float>
-; FAST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %B3 = sitofp <4 x i64> %b to <4 x double>
+; FAST-LABEL: 'uitofp16'
+; FAST-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %B1 = uitofp <16 x i8> %b to <16 x float>
+; FAST-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %C1 = uitofp <16 x i16> %c to <16 x float>
 ; FAST-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
-; SLOW-LABEL: 'sitofp_i64'
-; SLOW-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %A1 = sitofp i64 %a to half
-; SLOW-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %A2 = sitofp i64 %a to float
-; SLOW-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %A3 = sitofp i64 %a to double
-; SLOW-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %B1 = sitofp <4 x i64> %b to <4 x half>
-; SLOW-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %B2 = sitofp <4 x i64> %b to <4 x float>
-; SLOW-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %B3 = sitofp <4 x i64> %b to <4 x double>
+; SLOW-LABEL: 'uitofp16'
+; SLOW-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %B1 = uitofp <16 x i8> %b to <16 x float>
+; SLOW-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %C1 = uitofp <16 x i16> %c to <16 x float>
 ; SLOW-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
-; NOSDWA-SIZE-LABEL: 'sitofp_i64'
-; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %A1 = sitofp i64 %a to half
-; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %A2 = sitofp i64 %a to float
-; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %A3 = sitofp i64 %a to double
-; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %B1 = sitofp <4 x i64> %b to <4 x half>
-; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %B2 = sitofp <4 x i64> %b to <4 x float>
-; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %B3 = sitofp <4 x i64> %b to <4 x double>
+; NOSDWA-SIZE-LABEL: 'uitofp16'
+; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %B1 = uitofp <16 x i8> %b to <16 x float>
+; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %C1 = uitofp <16 x i16> %c to <16 x float>
 ; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
-; FAST-SIZE-LABEL: 'sitofp_i64'
-; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %A1 = sitofp i64 %a to half
-; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %A2 = sitofp i64 %a to float
-; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %A3 = sitofp i64 %a to double
-; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %B1 = sitofp <4 x i64> %b to <4 x half>
-; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %B2 = sitofp <4 x i64> %b to <4 x float>
-; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %B3 = sitofp <4 x i64> %b to <4 x double>
+; FAST-SIZE-LABEL: 'uitofp16'
+; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %B1 = uitofp <16 x i8> %b to <16 x float>
+; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %C1 = uitofp <16 x i16> %c to <16 x float>
 ; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
-; SLOW-SIZE-LABEL: 'sitofp_i64'
-; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %A1 = sitofp i64 %a to half
-; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %A2 = sitofp i64 %a to float
-; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %A3 = sitofp i64 %a to double
-; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %B1 = sitofp <4 x i64> %b to <4 x half>
-; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %B2 = sitofp <4 x i64> %b to <4 x float>
-; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %B3 = sitofp <4 x i64> %b to <4 x double>
+; SLOW-SIZE-LABEL: 'uitofp16'
+; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %B1 = uitofp <16 x i8> %b to <16 x float>
+; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %C1 = uitofp <16 x i16> %c to <16 x float>
 ; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+;
+  %B1 = uitofp <16 x i8> %b to <16 x float>
+  %C1 = uitofp <16 x i16> %c to <16 x float>
+  ret void
+}
+
+define void @sitofp_i64(i64 %a, <4 x i64> %b) {
+; QUARTER64-LABEL: 'sitofp_i64'
+; QUARTER64-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %A1 = sitofp i64 %a to half
+; QUARTER64-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %A2 = sitofp i64 %a to float
+; QUARTER64-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %A3 = sitofp i64 %a to double
+; QUARTER64-NEXT:  Cost Model: Found an estimated cost of 52 for instruction: %B1 = sitofp <4 x i64> %b to <4 x half>
+; QUARTER64-NEXT:  Cost Model: Found an estimated cost of 48 for instruction: %B2 = sitofp <4 x i64> %b to <4 x float>
+; QUARTER64-NEXT:  Cost Model: Found an estimated cost of 64 for instruction: %B3 = sitofp <4 x i64> %b to <4 x double>
+; QUARTER64-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
+;
+; FULL64-LABEL: 'sitofp_i64'
+; FULL64-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %A1 = sitofp i64 %a to half
+; FULL64-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %A2 = sitofp i64 %a to float
+; FULL64-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %A3 = sitofp i64 %a to double
+; FULL64-NEXT:  Cost Model: Found an estimated cost of 52 for instruction: %B1 = sitofp <4 x i64> %b to <4 x half>
+; FULL64-NEXT:  Cost Model: Found an estimated cost of 48 for instruction: %B2 = sitofp <4 x i64> %b to <4 x float>
+; FULL64-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %B3 = sitofp <4 x i64> %b to <4 x double>
+; FULL64-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
+;
+; QUARTER64-SIZE-LABEL: 'sitofp_i64'
+; QUARTER64-SIZE-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %A1 = sitofp i64 %a to half
+; QUARTER64-SIZE-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %A2 = sitofp i64 %a to float
+; QUARTER64-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %A3 = sitofp i64 %a to double
+; QUARTER64-SIZE-NEXT:  Cost Model: Found an estimated cost of 52 for instruction: %B1 = sitofp <4 x i64> %b to <4 x half>
+; QUARTER64-SIZE-NEXT:  Cost Model: Found an estimated cost of 48 for instruction: %B2 = sitofp <4 x i64> %b to <4 x float>
+; QUARTER64-SIZE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %B3 = sitofp <4 x i64> %b to <4 x double>
+; QUARTER64-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+;
+; FULL64-SIZE-LABEL: 'sitofp_i64'
+; FULL64-SIZE-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %A1 = sitofp i64 %a to half
+; FULL64-SIZE-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %A2 = sitofp i64 %a to float
+; FULL64-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %A3 = sitofp i64 %a to double
+; FULL64-SIZE-NEXT:  Cost Model: Found an estimated cost of 52 for instruction: %B1 = sitofp <4 x i64> %b to <4 x half>
+; FULL64-SIZE-NEXT:  Cost Model: Found an estimated cost of 48 for instruction: %B2 = sitofp <4 x i64> %b to <4 x float>
+; FULL64-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %B3 = sitofp <4 x i64> %b to <4 x double>
+; FULL64-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
   %A1 = sitofp i64 %a to half
   %A2 = sitofp i64 %a to float
@@ -601,59 +723,41 @@ define void @sitofp_i64(i64 %a, <4 x i64> %b) {
 }
 
 define void @uitofp_i64(i64 %a, <4 x i64> %b) {
-; NOSDWA-LABEL: 'uitofp_i64'
-; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %A1 = uitofp i64 %a to half
-; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %A2 = uitofp i64 %a to float
-; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %A3 = uitofp i64 %a to double
-; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %B1 = uitofp <4 x i64> %b to <4 x half>
-; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %B2 = uitofp <4 x i64> %b to <4 x float>
-; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %B3 = uitofp <4 x i64> %b to <4 x double>
-; NOSDWA-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
-;
-; FAST-LABEL: 'uitofp_i64'
-; FAST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %A1 = uitofp i64 %a to half
-; FAST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %A2 = uitofp i64 %a to float
-; FAST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %A3 = uitofp i64 %a to double
-; FAST-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %B1 = uitofp <4 x i64> %b to <4 x half>
-; FAST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %B2 = uitofp <4 x i64> %b to <4 x float>
-; FAST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %B3 = uitofp <4 x i64> %b to <4 x double>
-; FAST-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
-;
-; SLOW-LABEL: 'uitofp_i64'
-; SLOW-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %A1 = uitofp i64 %a to half
-; SLOW-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %A2 = uitofp i64 %a to float
-; SLOW-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %A3 = uitofp i64 %a to double
-; SLOW-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %B1 = uitofp <4 x i64> %b to <4 x half>
-; SLOW-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %B2 = uitofp <4 x i64> %b to <4 x float>
-; SLOW-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %B3 = uitofp <4 x i64> %b to <4 x double>
-; SLOW-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
-;
-; NOSDWA-SIZE-LABEL: 'uitofp_i64'
-; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %A1 = uitofp i64 %a to half
-; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %A2 = uitofp i64 %a to float
-; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %A3 = uitofp i64 %a to double
-; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %B1 = uitofp <4 x i64> %b to <4 x half>
-; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %B2 = uitofp <4 x i64> %b to <4 x float>
-; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %B3 = uitofp <4 x i64> %b to <4 x double>
-; NOSDWA-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
-;
-; FAST-SIZE-LABEL: 'uitofp_i64'
-; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %A1 = uitofp i64 %a to half
-; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %A2 = uitofp i64 %a to float
-; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %A3 = uitofp i64 %a to double
-; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %B1 = uitofp <4 x i64> %b to <4 x half>
-; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %B2 = uitofp <4 x i64> %b to <4 x float>
-; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %B3 = uitofp <4 x i64> %b to <4 x double>
-; FAST-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
-;
-; SLOW-SIZE-LABEL: 'uitofp_i64'
-; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %A1 = uitofp i64 %a to half
-; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %A2 = uitofp i64 %a to float
-; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %A3 = uitofp i64 %a to double
-; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %B1 = uitofp <4 x i64> %b to <4 x half>
-; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %B2 = uitofp <4 x i64> %b to <4 x float>
-; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %B3 = uitofp <4 x i64> %b to <4 x double>
-; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+; QUARTER64-LABEL: 'uitofp_i64'
+; QUARTER64-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %A1 = uitofp i64 %a to half
+; QUARTER64-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %A2 = uitofp i64 %a to float
+; QUARTER64-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %A3 = uitofp i64 %a to double
+; QUARTER64-NEXT:  Cost Model: Found an estimated cost of 36 for instruction: %B1 = uitofp <4 x i64> %b to <4 x half>
+; QUARTER64-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %B2 = uitofp <4 x i64> %b to <4 x float>
+; QUARTER64-NEXT:  Cost Model: Found an estimated cost of 64 for instruction: %B3 = uitofp <4 x i64> %b to <4 x double>
+; QUARTER64-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
+;
+; FULL64-LABEL: 'uitofp_i64'
+; FULL64-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %A1 = uitofp i64 %a to half
+; FULL64-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %A2 = uitofp i64 %a to float
+; FULL64-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %A3 = uitofp i64 %a to double
+; FULL64-NEXT:  Cost Model: Found an estimated cost of 36 for instruction: %B1 = uitofp <4 x i64> %b to <4 x half>
+; FULL64-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %B2 = uitofp <4 x i64> %b to <4 x float>
+; FULL64-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %B3 = uitofp <4 x i64> %b to <4 x double>
+; FULL64-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
+;
+; QUARTER64-SIZE-LABEL: 'uitofp_i64'
+; QUARTER64-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %A1 = uitofp i64 %a to half
+; QUARTER64-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %A2 = uitofp i64 %a to float
+; QUARTER64-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %A3 = uitofp i64 %a to double
+; QUARTER64-SIZE-NEXT:  Cost Model: Found an estimated cost of 36 for instruction: %B1 = uitofp <4 x i64> %b to <4 x half>
+; QUARTER64-SIZE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %B2 = uitofp <4 x i64> %b to <4 x float>
+; QUARTER64-SIZE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %B3 = uitofp <4 x i64> %b to <4 x double>
+; QUARTER64-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+;
+; FULL64-SIZE-LABEL: 'uitofp_i64'
+; FULL64-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %A1 = uitofp i64 %a to half
+; FULL64-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %A2 = uitofp i64 %a to float
+; FULL64-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %A3 = uitofp i64 %a to double
+; FULL64-SIZE-NEXT:  Cost Model: Found an estimated cost of 36 for instruction: %B1 = uitofp <4 x i64> %b to <4 x half>
+; FULL64-SIZE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %B2 = uitofp <4 x i64> %b to <4 x float>
+; FULL64-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %B3 = uitofp <4 x i64> %b to <4 x double>
+; FULL64-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
   %A1 = uitofp i64 %a to half
   %A2 = uitofp i64 %a to float
diff --git a/llvm/test/Analysis/CostModel/AMDGPU/expanded-int-fp-casts.ll b/llvm/test/Analysis/CostModel/AMDGPU/expanded-int-fp-casts.ll
index 9434c87f23dbd..41c41fc3b1019 100644
--- a/llvm/test/Analysis/CostModel/AMDGPU/expanded-int-fp-casts.ll
+++ b/llvm/test/Analysis/CostModel/AMDGPU/expanded-int-fp-casts.ll
@@ -1,30 +1,30 @@
 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --filter "instruction:.*(sitofp|uitofp|fptosi|fptoui)"
-; RUN: opt -passes="print<cost-model>" -disable-output -mtriple=amdgpu6.01-amd-amdhsa < %s 2>&1 | FileCheck %s --check-prefixes=ALL,GFX6
-; RUN: opt -passes="print<cost-model>" -disable-output -mtriple=amdgpu7.00-amd-amdhsa < %s 2>&1 | FileCheck %s --check-prefixes=ALL,GFX6
-; RUN: opt -passes="print<cost-model>" -disable-output -mtriple=amdgpu8.03-amd-amdhsa < %s 2>&1 | FileCheck %s --check-prefixes=ALL,GFX9-THROUGHPUT
-; RUN: opt -passes="print<cost-model>" -disable-output -mtriple=amdgpu9.00-amd-amdhsa < %s 2>&1 | FileCheck %s --check-prefixes=ALL,GFX9-THROUGHPUT
-; RUN: opt -passes="print<cost-model>" -disable-output -mtriple=amdgpu9.00-amd-amdhsa -mattr=-gfx9-insts < %s 2>&1 | FileCheck %s --check-prefixes=ALL,GFX9-THROUGHPUT
-; RUN: opt -passes="print<cost-model>" -disable-output -mtriple=amdgpu9.06-amd-amdhsa < %s 2>&1 | FileCheck %s --check-prefixes=ALL,HALF
-; RUN: opt -passes="print<cost-model>" -disable-output -mtriple=amdgpu9.42-amd-amdhsa < %s 2>&1 | FileCheck %s --check-prefixes=ALL,FULL
-; RUN: opt -passes="print<cost-model>" -disable-output -mtriple=amdgpu9.50-amd-amdhsa < %s 2>&1 | FileCheck %s --check-prefixes=ALL,FULL
-; RUN: opt -passes="print<cost-model>" -disable-output -mtriple=amdgpu11.00-amd-amdhsa < %s 2>&1 | FileCheck %s --check-prefixes=ALL,GFX9-THROUGHPUT
-; RUN: opt -passes="print<cost-model>" -disable-output -mtriple=amdgpu11.00-amd-amdhsa -mattr=-16-bit-insts < %s 2>&1 | FileCheck %s --check-prefixes=ALL,GFX6
-; RUN: opt -passes="print<cost-model>" -disable-output -mtriple=amdgpu12.50-amd-amdhsa < %s 2>&1 | FileCheck %s --check-prefixes=ALL,GFX9-THROUGHPUT
-; RUN: opt -passes="print<cost-model>" -cost-kind=code-size -disable-output -mtriple=amdgpu6.01-amd-amdhsa < %s 2>&1 | FileCheck %s --check-prefixes=ALL,GFX6
-; RUN: opt -passes="print<cost-model>" -cost-kind=code-size -disable-output -mtriple=amdgpu9.00-amd-amdhsa < %s 2>&1 | FileCheck %s --check-prefixes=ALL,HALF
-; RUN: opt -passes="print<cost-model>" -cost-kind=code-size -disable-output -mtriple=amdgpu9.42-amd-amdhsa < %s 2>&1 | FileCheck %s --check-prefixes=ALL,FULL
-; RUN: opt -passes="print<cost-model>" -cost-kind=code-size -disable-output -mtriple=amdgpu9.50-amd-amdhsa < %s 2>&1 | FileCheck %s --check-prefixes=ALL,FULL
-; RUN: opt -passes="print<cost-model>" -cost-kind=code-size -disable-output -mtriple=amdgpu12.50-amd-amdhsa < %s 2>&1 | FileCheck %s --check-prefixes=ALL,HALF
+; RUN: opt -passes="print<cost-model>" -disable-output -mtriple=amdgpu6.01-amd-amdhsa < %s 2>&1 | FileCheck %s --check-prefixes=ALL,GFX6,GFX6-THROUGHPUT
+; RUN: opt -passes="print<cost-model>" -disable-output -mtriple=amdgpu7.00-amd-amdhsa < %s 2>&1 | FileCheck %s --check-prefixes=ALL,GFX6,GFX7
+; RUN: opt -passes="print<cost-model>" -disable-output -mtriple=amdgpu8.03-amd-amdhsa < %s 2>&1 | FileCheck %s --check-prefixes=ALL,GFX9-THROUGHPUT,GFX8
+; RUN: opt -passes="print<cost-model>" -disable-output -mtriple=amdgpu9.00-amd-amdhsa < %s 2>&1 | FileCheck %s --check-prefixes=ALL,GFX9-THROUGHPUT,GFX9
+; RUN: opt -passes="print<cost-model>" -disable-output -mtriple=amdgpu9.00-amd-amdhsa -mattr=-gfx9-insts < %s 2>&1 | FileCheck %s --check-prefixes=ALL,GFX9-THROUGHPUT,GFX8
+; RUN: opt -passes="print<cost-model>" -disable-output -mtriple=amdgpu9.06-amd-amdhsa < %s 2>&1 | FileCheck %s --check-prefixes=ALL,HALF,GFX9
+; RUN: opt -passes="print<cost-model>" -disable-output -mtriple=amdgpu9.42-amd-amdhsa < %s 2>&1 | FileCheck %s --check-prefixes=ALL,FULL,GFX9
+; RUN: opt -passes="print<cost-model>" -disable-output -mtriple=amdgpu9.50-amd-amdhsa < %s 2>&1 | FileCheck %s --check-prefixes=ALL,FULL,NATIVE-SDWA
+; RUN: opt -passes="print<cost-model>" -disable-output -mtriple=amdgpu11.00-amd-amdhsa < %s 2>&1 | FileCheck %s --check-prefixes=ALL,GFX9-THROUGHPUT,GFX11
+; RUN: opt -passes="print<cost-model>" -disable-output -mtriple=amdgpu11.00-amd-amdhsa -mattr=-16-bit-insts < %s 2>&1 | FileCheck %s --check-prefixes=ALL,GFX6,GFX7
+; RUN: opt -passes="print<cost-model>" -disable-output -mtriple=amdgpu12.50-amd-amdhsa < %s 2>&1 | FileCheck %s --check-prefixes=ALL,GFX9-THROUGHPUT,NATIVE-NOSDWA
+; RUN: opt -passes="print<cost-model>" -cost-kind=code-size -disable-output -mtriple=amdgpu6.01-amd-amdhsa < %s 2>&1 | FileCheck %s --check-prefixes=ALL,GFX6,GFX6-SIZE
+; RUN: opt -passes="print<cost-model>" -cost-kind=code-size -disable-output -mtriple=amdgpu9.00-amd-amdhsa < %s 2>&1 | FileCheck %s --check-prefixes=ALL,HALF,GFX9
+; RUN: opt -passes="print<cost-model>" -cost-kind=code-size -disable-output -mtriple=amdgpu9.42-amd-amdhsa < %s 2>&1 | FileCheck %s --check-prefixes=ALL,FULL,GFX9
+; RUN: opt -passes="print<cost-model>" -cost-kind=code-size -disable-output -mtriple=amdgpu9.50-amd-amdhsa < %s 2>&1 | FileCheck %s --check-prefixes=ALL,FULL,NATIVE-SDWA
+; RUN: opt -passes="print<cost-model>" -cost-kind=code-size -disable-output -mtriple=amdgpu12.50-amd-amdhsa < %s 2>&1 | FileCheck %s --check-prefixes=ALL,HALF,NATIVE-NOSDWA
 
 ; Half fits in i32. Bfloat must extend to f32 and use the full i64 expansion.
 define void @bf16_to_i64(bfloat %a, <2 x bfloat> %b, half %h) {
 ; ALL-LABEL: 'bf16_to_i64'
-; ALL:  Cost Model: Found an estimated cost of 1 for instruction: %s = fptosi bfloat %a to i64
-; ALL:  Cost Model: Found an estimated cost of 1 for instruction: %u = fptoui bfloat %a to i64
-; ALL:  Cost Model: Found an estimated cost of 2 for instruction: %vs = fptosi <2 x bfloat> %b to <2 x i64>
-; ALL:  Cost Model: Found an estimated cost of 2 for instruction: %vu = fptoui <2 x bfloat> %b to <2 x i64>
-; ALL:  Cost Model: Found an estimated cost of 1 for instruction: %hs = fptosi half %h to i64
-; ALL:  Cost Model: Found an estimated cost of 1 for instruction: %hu = fptoui half %h to i64
+; ALL:  Cost Model: Found an estimated cost of 14 for instruction: %s = fptosi bfloat %a to i64
+; ALL:  Cost Model: Found an estimated cost of 7 for instruction: %u = fptoui bfloat %a to i64
+; ALL:  Cost Model: Found an estimated cost of 28 for instruction: %vs = fptosi <2 x bfloat> %b to <2 x i64>
+; ALL:  Cost Model: Found an estimated cost of 14 for instruction: %vu = fptoui <2 x bfloat> %b to <2 x i64>
+; ALL:  Cost Model: Found an estimated cost of 3 for instruction: %hs = fptosi half %h to i64
+; ALL:  Cost Model: Found an estimated cost of 3 for instruction: %hu = fptoui half %h to i64
 ;
   %s = fptosi bfloat %a to i64
   %u = fptoui bfloat %a to i64
@@ -40,44 +40,64 @@ define void @bf16_to_i64(bfloat %a, <2 x bfloat> %b, half %h) {
 ; unpaired element of an odd-sized vector.
 define void @i64_to_bf16(i64 %a, <2 x i64> %b, <3 x i64> %c, i48 %d) {
 ; GFX6-LABEL: 'i64_to_bf16'
-; GFX6:  Cost Model: Found an estimated cost of 1 for instruction: %s = sitofp i64 %a to bfloat
-; GFX6:  Cost Model: Found an estimated cost of 1 for instruction: %u = uitofp i64 %a to bfloat
-; GFX6:  Cost Model: Found an estimated cost of 2 for instruction: %vs = sitofp <2 x i64> %b to <2 x bfloat>
-; GFX6:  Cost Model: Found an estimated cost of 2 for instruction: %vu = uitofp <2 x i64> %b to <2 x bfloat>
-; GFX6:  Cost Model: Found an estimated cost of 9 for instruction: %v3s = sitofp <3 x i64> %c to <3 x bfloat>
-; GFX6:  Cost Model: Found an estimated cost of 9 for instruction: %v3u = uitofp <3 x i64> %c to <3 x bfloat>
-; GFX6:  Cost Model: Found an estimated cost of 1 for instruction: %s48 = sitofp i48 %d to bfloat
-; GFX6:  Cost Model: Found an estimated cost of 1 for instruction: %u48 = uitofp i48 %d to bfloat
+; GFX6:  Cost Model: Found an estimated cost of 13 for instruction: %s = sitofp i64 %a to bfloat
+; GFX6:  Cost Model: Found an estimated cost of 9 for instruction: %u = uitofp i64 %a to bfloat
+; GFX6:  Cost Model: Found an estimated cost of 26 for instruction: %vs = sitofp <2 x i64> %b to <2 x bfloat>
+; GFX6:  Cost Model: Found an estimated cost of 18 for instruction: %vu = uitofp <2 x i64> %b to <2 x bfloat>
+; GFX6:  Cost Model: Found an estimated cost of 39 for instruction: %v3s = sitofp <3 x i64> %c to <3 x bfloat>
+; GFX6:  Cost Model: Found an estimated cost of 27 for instruction: %v3u = uitofp <3 x i64> %c to <3 x bfloat>
+; GFX6:  Cost Model: Found an estimated cost of 15 for instruction: %s48 = sitofp i48 %d to bfloat
+; GFX6:  Cost Model: Found an estimated cost of 10 for instruction: %u48 = uitofp i48 %d to bfloat
 ;
-; GFX9-THROUGHPUT-LABEL: 'i64_to_bf16'
-; GFX9-THROUGHPUT:  Cost Model: Found an estimated cost of 1 for instruction: %s = sitofp i64 %a to bfloat
-; GFX9-THROUGHPUT:  Cost Model: Found an estimated cost of 1 for instruction: %u = uitofp i64 %a to bfloat
-; GFX9-THROUGHPUT:  Cost Model: Found an estimated cost of 4 for instruction: %vs = sitofp <2 x i64> %b to <2 x bfloat>
-; GFX9-THROUGHPUT:  Cost Model: Found an estimated cost of 4 for instruction: %vu = uitofp <2 x i64> %b to <2 x bfloat>
-; GFX9-THROUGHPUT:  Cost Model: Found an estimated cost of 7 for instruction: %v3s = sitofp <3 x i64> %c to <3 x bfloat>
-; GFX9-THROUGHPUT:  Cost Model: Found an estimated cost of 7 for instruction: %v3u = uitofp <3 x i64> %c to <3 x bfloat>
-; GFX9-THROUGHPUT:  Cost Model: Found an estimated cost of 1 for instruction: %s48 = sitofp i48 %d to bfloat
-; GFX9-THROUGHPUT:  Cost Model: Found an estimated cost of 1 for instruction: %u48 = uitofp i48 %d to bfloat
+; GFX8-LABEL: 'i64_to_bf16'
+; GFX8:  Cost Model: Found an estimated cost of 19 for instruction: %s = sitofp i64 %a to bfloat
+; GFX8:  Cost Model: Found an estimated cost of 15 for instruction: %u = uitofp i64 %a to bfloat
+; GFX8:  Cost Model: Found an estimated cost of 38 for instruction: %vs = sitofp <2 x i64> %b to <2 x bfloat>
+; GFX8:  Cost Model: Found an estimated cost of 30 for instruction: %vu = uitofp <2 x i64> %b to <2 x bfloat>
+; GFX8:  Cost Model: Found an estimated cost of 57 for instruction: %v3s = sitofp <3 x i64> %c to <3 x bfloat>
+; GFX8:  Cost Model: Found an estimated cost of 45 for instruction: %v3u = uitofp <3 x i64> %c to <3 x bfloat>
+; GFX8:  Cost Model: Found an estimated cost of 21 for instruction: %s48 = sitofp i48 %d to bfloat
+; GFX8:  Cost Model: Found an estimated cost of 16 for instruction: %u48 = uitofp i48 %d to bfloat
 ;
-; HALF-LABEL: 'i64_to_bf16'
-; HALF:  Cost Model: Found an estimated cost of 1 for instruction: %s = sitofp i64 %a to bfloat
-; HALF:  Cost Model: Found an estimated cost of 1 for instruction: %u = uitofp i64 %a to bfloat
-; HALF:  Cost Model: Found an estimated cost of 4 for instruction: %vs = sitofp <2 x i64> %b to <2 x bfloat>
-; HALF:  Cost Model: Found an estimated cost of 4 for instruction: %vu = uitofp <2 x i64> %b to <2 x bfloat>
-; HALF:  Cost Model: Found an estimated cost of 7 for instruction: %v3s = sitofp <3 x i64> %c to <3 x bfloat>
-; HALF:  Cost Model: Found an estimated cost of 7 for instruction: %v3u = uitofp <3 x i64> %c to <3 x bfloat>
-; HALF:  Cost Model: Found an estimated cost of 1 for instruction: %s48 = sitofp i48 %d to bfloat
-; HALF:  Cost Model: Found an estimated cost of 1 for instruction: %u48 = uitofp i48 %d to bfloat
+; GFX9-LABEL: 'i64_to_bf16'
+; GFX9:  Cost Model: Found an estimated cost of 18 for instruction: %s = sitofp i64 %a to bfloat
+; GFX9:  Cost Model: Found an estimated cost of 14 for instruction: %u = uitofp i64 %a to bfloat
+; GFX9:  Cost Model: Found an estimated cost of 36 for instruction: %vs = sitofp <2 x i64> %b to <2 x bfloat>
+; GFX9:  Cost Model: Found an estimated cost of 28 for instruction: %vu = uitofp <2 x i64> %b to <2 x bfloat>
+; GFX9:  Cost Model: Found an estimated cost of 54 for instruction: %v3s = sitofp <3 x i64> %c to <3 x bfloat>
+; GFX9:  Cost Model: Found an estimated cost of 42 for instruction: %v3u = uitofp <3 x i64> %c to <3 x bfloat>
+; GFX9:  Cost Model: Found an estimated cost of 20 for instruction: %s48 = sitofp i48 %d to bfloat
+; GFX9:  Cost Model: Found an estimated cost of 15 for instruction: %u48 = uitofp i48 %d to bfloat
 ;
-; FULL-LABEL: 'i64_to_bf16'
-; FULL:  Cost Model: Found an estimated cost of 1 for instruction: %s = sitofp i64 %a to bfloat
-; FULL:  Cost Model: Found an estimated cost of 1 for instruction: %u = uitofp i64 %a to bfloat
-; FULL:  Cost Model: Found an estimated cost of 4 for instruction: %vs = sitofp <2 x i64> %b to <2 x bfloat>
-; FULL:  Cost Model: Found an estimated cost of 4 for instruction: %vu = uitofp <2 x i64> %b to <2 x bfloat>
-; FULL:  Cost Model: Found an estimated cost of 7 for instruction: %v3s = sitofp <3 x i64> %c to <3 x bfloat>
-; FULL:  Cost Model: Found an estimated cost of 7 for instruction: %v3u = uitofp <3 x i64> %c to <3 x bfloat>
-; FULL:  Cost Model: Found an estimated cost of 1 for instruction: %s48 = sitofp i48 %d to bfloat
-; FULL:  Cost Model: Found an estimated cost of 1 for instruction: %u48 = uitofp i48 %d to bfloat
+; NATIVE-SDWA-LABEL: 'i64_to_bf16'
+; NATIVE-SDWA:  Cost Model: Found an estimated cost of 13 for instruction: %s = sitofp i64 %a to bfloat
+; NATIVE-SDWA:  Cost Model: Found an estimated cost of 9 for instruction: %u = uitofp i64 %a to bfloat
+; NATIVE-SDWA:  Cost Model: Found an estimated cost of 25 for instruction: %vs = sitofp <2 x i64> %b to <2 x bfloat>
+; NATIVE-SDWA:  Cost Model: Found an estimated cost of 17 for instruction: %vu = uitofp <2 x i64> %b to <2 x bfloat>
+; NATIVE-SDWA:  Cost Model: Found an estimated cost of 38 for instruction: %v3s = sitofp <3 x i64> %c to <3 x bfloat>
+; NATIVE-SDWA:  Cost Model: Found an estimated cost of 26 for instruction: %v3u = uitofp <3 x i64> %c to <3 x bfloat>
+; NATIVE-SDWA:  Cost Model: Found an estimated cost of 15 for instruction: %s48 = sitofp i48 %d to bfloat
+; NATIVE-SDWA:  Cost Model: Found an estimated cost of 10 for instruction: %u48 = uitofp i48 %d to bfloat
+;
+; GFX11-LABEL: 'i64_to_bf16'
+; GFX11:  Cost Model: Found an estimated cost of 18 for instruction: %s = sitofp i64 %a to bfloat
+; GFX11:  Cost Model: Found an estimated cost of 14 for instruction: %u = uitofp i64 %a to bfloat
+; GFX11:  Cost Model: Found an estimated cost of 36 for instruction: %vs = sitofp <2 x i64> %b to <2 x bfloat>
+; GFX11:  Cost Model: Found an estimated cost of 28 for instruction: %vu = uitofp <2 x i64> %b to <2 x bfloat>
+; GFX11:  Cost Model: Found an estimated cost of 54 for instruction: %v3s = sitofp <3 x i64> %c to <3 x bfloat>
+; GFX11:  Cost Model: Found an estimated cost of 42 for instruction: %v3u = uitofp <3 x i64> %c to <3 x bfloat>
+; GFX11:  Cost Model: Found an estimated cost of 20 for instruction: %s48 = sitofp i48 %d to bfloat
+; GFX11:  Cost Model: Found an estimated cost of 15 for instruction: %u48 = uitofp i48 %d to bfloat
+;
+; NATIVE-NOSDWA-LABEL: 'i64_to_bf16'
+; NATIVE-NOSDWA:  Cost Model: Found an estimated cost of 13 for instruction: %s = sitofp i64 %a to bfloat
+; NATIVE-NOSDWA:  Cost Model: Found an estimated cost of 9 for instruction: %u = uitofp i64 %a to bfloat
+; NATIVE-NOSDWA:  Cost Model: Found an estimated cost of 25 for instruction: %vs = sitofp <2 x i64> %b to <2 x bfloat>
+; NATIVE-NOSDWA:  Cost Model: Found an estimated cost of 17 for instruction: %vu = uitofp <2 x i64> %b to <2 x bfloat>
+; NATIVE-NOSDWA:  Cost Model: Found an estimated cost of 38 for instruction: %v3s = sitofp <3 x i64> %c to <3 x bfloat>
+; NATIVE-NOSDWA:  Cost Model: Found an estimated cost of 26 for instruction: %v3u = uitofp <3 x i64> %c to <3 x bfloat>
+; NATIVE-NOSDWA:  Cost Model: Found an estimated cost of 15 for instruction: %s48 = sitofp i48 %d to bfloat
+; NATIVE-NOSDWA:  Cost Model: Found an estimated cost of 10 for instruction: %u48 = uitofp i48 %d to bfloat
 ;
   %s = sitofp i64 %a to bfloat
   %u = uitofp i64 %a to bfloat
@@ -94,36 +114,52 @@ define void @i64_to_bf16(i64 %a, <2 x i64> %b, <3 x i64> %c, i48 %d) {
 ; rounding still needs one integer-to-f32 conversion for each input lane.
 define void @narrow_to_bf16(<4 x i8> %a, <2 x i16> %b, <3 x i32> %c) {
 ; GFX6-LABEL: 'narrow_to_bf16'
-; GFX6:  Cost Model: Found an estimated cost of 4 for instruction: %bs = sitofp <4 x i8> %a to <4 x bfloat>
-; GFX6:  Cost Model: Found an estimated cost of 4 for instruction: %bu = uitofp <4 x i8> %a to <4 x bfloat>
-; GFX6:  Cost Model: Found an estimated cost of 2 for instruction: %hs = sitofp <2 x i16> %b to <2 x bfloat>
-; GFX6:  Cost Model: Found an estimated cost of 2 for instruction: %hu = uitofp <2 x i16> %b to <2 x bfloat>
-; GFX6:  Cost Model: Found an estimated cost of 9 for instruction: %ws = sitofp <3 x i32> %c to <3 x bfloat>
-; GFX6:  Cost Model: Found an estimated cost of 9 for instruction: %wu = uitofp <3 x i32> %c to <3 x bfloat>
+; GFX6:  Cost Model: Found an estimated cost of 12 for instruction: %bs = sitofp <4 x i8> %a to <4 x bfloat>
+; GFX6:  Cost Model: Found an estimated cost of 8 for instruction: %bu = uitofp <4 x i8> %a to <4 x bfloat>
+; GFX6:  Cost Model: Found an estimated cost of 6 for instruction: %hs = sitofp <2 x i16> %b to <2 x bfloat>
+; GFX6:  Cost Model: Found an estimated cost of 6 for instruction: %hu = uitofp <2 x i16> %b to <2 x bfloat>
+; GFX6:  Cost Model: Found an estimated cost of 6 for instruction: %ws = sitofp <3 x i32> %c to <3 x bfloat>
+; GFX6:  Cost Model: Found an estimated cost of 6 for instruction: %wu = uitofp <3 x i32> %c to <3 x bfloat>
+;
+; GFX8-LABEL: 'narrow_to_bf16'
+; GFX8:  Cost Model: Found an estimated cost of 36 for instruction: %bs = sitofp <4 x i8> %a to <4 x bfloat>
+; GFX8:  Cost Model: Found an estimated cost of 32 for instruction: %bu = uitofp <4 x i8> %a to <4 x bfloat>
+; GFX8:  Cost Model: Found an estimated cost of 16 for instruction: %hs = sitofp <2 x i16> %b to <2 x bfloat>
+; GFX8:  Cost Model: Found an estimated cost of 16 for instruction: %hu = uitofp <2 x i16> %b to <2 x bfloat>
+; GFX8:  Cost Model: Found an estimated cost of 24 for instruction: %ws = sitofp <3 x i32> %c to <3 x bfloat>
+; GFX8:  Cost Model: Found an estimated cost of 24 for instruction: %wu = uitofp <3 x i32> %c to <3 x bfloat>
 ;
-; GFX9-THROUGHPUT-LABEL: 'narrow_to_bf16'
-; GFX9-THROUGHPUT:  Cost Model: Found an estimated cost of 4 for instruction: %bs = sitofp <4 x i8> %a to <4 x bfloat>
-; GFX9-THROUGHPUT:  Cost Model: Found an estimated cost of 4 for instruction: %bu = uitofp <4 x i8> %a to <4 x bfloat>
-; GFX9-THROUGHPUT:  Cost Model: Found an estimated cost of 4 for instruction: %hs = sitofp <2 x i16> %b to <2 x bfloat>
-; GFX9-THROUGHPUT:  Cost Model: Found an estimated cost of 4 for instruction: %hu = uitofp <2 x i16> %b to <2 x bfloat>
-; GFX9-THROUGHPUT:  Cost Model: Found an estimated cost of 7 for instruction: %ws = sitofp <3 x i32> %c to <3 x bfloat>
-; GFX9-THROUGHPUT:  Cost Model: Found an estimated cost of 7 for instruction: %wu = uitofp <3 x i32> %c to <3 x bfloat>
+; GFX9-LABEL: 'narrow_to_bf16'
+; GFX9:  Cost Model: Found an estimated cost of 32 for instruction: %bs = sitofp <4 x i8> %a to <4 x bfloat>
+; GFX9:  Cost Model: Found an estimated cost of 28 for instruction: %bu = uitofp <4 x i8> %a to <4 x bfloat>
+; GFX9:  Cost Model: Found an estimated cost of 14 for instruction: %hs = sitofp <2 x i16> %b to <2 x bfloat>
+; GFX9:  Cost Model: Found an estimated cost of 14 for instruction: %hu = uitofp <2 x i16> %b to <2 x bfloat>
+; GFX9:  Cost Model: Found an estimated cost of 21 for instruction: %ws = sitofp <3 x i32> %c to <3 x bfloat>
+; GFX9:  Cost Model: Found an estimated cost of 21 for instruction: %wu = uitofp <3 x i32> %c to <3 x bfloat>
 ;
-; HALF-LABEL: 'narrow_to_bf16'
-; HALF:  Cost Model: Found an estimated cost of 4 for instruction: %bs = sitofp <4 x i8> %a to <4 x bfloat>
-; HALF:  Cost Model: Found an estimated cost of 4 for instruction: %bu = uitofp <4 x i8> %a to <4 x bfloat>
-; HALF:  Cost Model: Found an estimated cost of 4 for instruction: %hs = sitofp <2 x i16> %b to <2 x bfloat>
-; HALF:  Cost Model: Found an estimated cost of 4 for instruction: %hu = uitofp <2 x i16> %b to <2 x bfloat>
-; HALF:  Cost Model: Found an estimated cost of 7 for instruction: %ws = sitofp <3 x i32> %c to <3 x bfloat>
-; HALF:  Cost Model: Found an estimated cost of 7 for instruction: %wu = uitofp <3 x i32> %c to <3 x bfloat>
+; NATIVE-SDWA-LABEL: 'narrow_to_bf16'
+; NATIVE-SDWA:  Cost Model: Found an estimated cost of 10 for instruction: %bs = sitofp <4 x i8> %a to <4 x bfloat>
+; NATIVE-SDWA:  Cost Model: Found an estimated cost of 6 for instruction: %bu = uitofp <4 x i8> %a to <4 x bfloat>
+; NATIVE-SDWA:  Cost Model: Found an estimated cost of 3 for instruction: %hs = sitofp <2 x i16> %b to <2 x bfloat>
+; NATIVE-SDWA:  Cost Model: Found an estimated cost of 3 for instruction: %hu = uitofp <2 x i16> %b to <2 x bfloat>
+; NATIVE-SDWA:  Cost Model: Found an estimated cost of 5 for instruction: %ws = sitofp <3 x i32> %c to <3 x bfloat>
+; NATIVE-SDWA:  Cost Model: Found an estimated cost of 5 for instruction: %wu = uitofp <3 x i32> %c to <3 x bfloat>
 ;
-; FULL-LABEL: 'narrow_to_bf16'
-; FULL:  Cost Model: Found an estimated cost of 4 for instruction: %bs = sitofp <4 x i8> %a to <4 x bfloat>
-; FULL:  Cost Model: Found an estimated cost of 4 for instruction: %bu = uitofp <4 x i8> %a to <4 x bfloat>
-; FULL:  Cost Model: Found an estimated cost of 4 for instruction: %hs = sitofp <2 x i16> %b to <2 x bfloat>
-; FULL:  Cost Model: Found an estimated cost of 4 for instruction: %hu = uitofp <2 x i16> %b to <2 x bfloat>
-; FULL:  Cost Model: Found an estimated cost of 7 for instruction: %ws = sitofp <3 x i32> %c to <3 x bfloat>
-; FULL:  Cost Model: Found an estimated cost of 7 for instruction: %wu = uitofp <3 x i32> %c to <3 x bfloat>
+; GFX11-LABEL: 'narrow_to_bf16'
+; GFX11:  Cost Model: Found an estimated cost of 36 for instruction: %bs = sitofp <4 x i8> %a to <4 x bfloat>
+; GFX11:  Cost Model: Found an estimated cost of 28 for instruction: %bu = uitofp <4 x i8> %a to <4 x bfloat>
+; GFX11:  Cost Model: Found an estimated cost of 16 for instruction: %hs = sitofp <2 x i16> %b to <2 x bfloat>
+; GFX11:  Cost Model: Found an estimated cost of 16 for instruction: %hu = uitofp <2 x i16> %b to <2 x bfloat>
+; GFX11:  Cost Model: Found an estimated cost of 21 for instruction: %ws = sitofp <3 x i32> %c to <3 x bfloat>
+; GFX11:  Cost Model: Found an estimated cost of 21 for instruction: %wu = uitofp <3 x i32> %c to <3 x bfloat>
+;
+; NATIVE-NOSDWA-LABEL: 'narrow_to_bf16'
+; NATIVE-NOSDWA:  Cost Model: Found an estimated cost of 14 for instruction: %bs = sitofp <4 x i8> %a to <4 x bfloat>
+; NATIVE-NOSDWA:  Cost Model: Found an estimated cost of 6 for instruction: %bu = uitofp <4 x i8> %a to <4 x bfloat>
+; NATIVE-NOSDWA:  Cost Model: Found an estimated cost of 5 for instruction: %hs = sitofp <2 x i16> %b to <2 x bfloat>
+; NATIVE-NOSDWA:  Cost Model: Found an estimated cost of 5 for instruction: %hu = uitofp <2 x i16> %b to <2 x bfloat>
+; NATIVE-NOSDWA:  Cost Model: Found an estimated cost of 5 for instruction: %ws = sitofp <3 x i32> %c to <3 x bfloat>
+; NATIVE-NOSDWA:  Cost Model: Found an estimated cost of 5 for instruction: %wu = uitofp <3 x i32> %c to <3 x bfloat>
 ;
   %bs = sitofp <4 x i8> %a to <4 x bfloat>
   %bu = uitofp <4 x i8> %a to <4 x bfloat>
@@ -136,21 +172,9 @@ define void @narrow_to_bf16(<4 x i8> %a, <2 x i16> %b, <3 x i32> %c) {
 
 ; Unsigned lanes wider than a byte are zero extended before the conversion.
 define void @narrow_unsigned_lanes(<4 x i12> %a) {
-; GFX6-LABEL: 'narrow_unsigned_lanes'
-; GFX6:  Cost Model: Found an estimated cost of 1 for instruction: %u = uitofp <4 x i12> %a to <4 x float>
-; GFX6:  Cost Model: Found an estimated cost of 4 for instruction: %uh = uitofp <4 x i12> %a to <4 x half>
-;
-; GFX9-THROUGHPUT-LABEL: 'narrow_unsigned_lanes'
-; GFX9-THROUGHPUT:  Cost Model: Found an estimated cost of 1 for instruction: %u = uitofp <4 x i12> %a to <4 x float>
-; GFX9-THROUGHPUT:  Cost Model: Found an estimated cost of 10 for instruction: %uh = uitofp <4 x i12> %a to <4 x half>
-;
-; HALF-LABEL: 'narrow_unsigned_lanes'
-; HALF:  Cost Model: Found an estimated cost of 1 for instruction: %u = uitofp <4 x i12> %a to <4 x float>
-; HALF:  Cost Model: Found an estimated cost of 10 for instruction: %uh = uitofp <4 x i12> %a to <4 x half>
-;
-; FULL-LABEL: 'narrow_unsigned_lanes'
-; FULL:  Cost Model: Found an estimated cost of 1 for instruction: %u = uitofp <4 x i12> %a to <4 x float>
-; FULL:  Cost Model: Found an estimated cost of 10 for instruction: %uh = uitofp <4 x i12> %a to <4 x half>
+; ALL-LABEL: 'narrow_unsigned_lanes'
+; ALL:  Cost Model: Found an estimated cost of 8 for instruction: %u = uitofp <4 x i12> %a to <4 x float>
+; ALL:  Cost Model: Found an estimated cost of 8 for instruction: %uh = uitofp <4 x i12> %a to <4 x half>
 ;
   %u = uitofp <4 x i12> %a to <4 x float>
   %uh = uitofp <4 x i12> %a to <4 x half>
@@ -159,18 +183,83 @@ define void @narrow_unsigned_lanes(<4 x i12> %a) {
 
 ; FP64 rates vary independently of native trunc/floor support and code size.
 define void @i64_double(i64 %a, <2 x i64> %b, double %c, <2 x double> %d, i48 %e) {
-; ALL-LABEL: 'i64_double'
-; ALL:  Cost Model: Found an estimated cost of 1 for instruction: %s = sitofp i64 %a to double
-; ALL:  Cost Model: Found an estimated cost of 1 for instruction: %u = uitofp i64 %a to double
-; ALL:  Cost Model: Found an estimated cost of 2 for instruction: %vs = sitofp <2 x i64> %b to <2 x double>
-; ALL:  Cost Model: Found an estimated cost of 2 for instruction: %vu = uitofp <2 x i64> %b to <2 x double>
-; ALL:  Cost Model: Found an estimated cost of 1 for instruction: %rs = fptosi double %c to i64
-; ALL:  Cost Model: Found an estimated cost of 1 for instruction: %ru = fptoui double %c to i64
-; ALL:  Cost Model: Found an estimated cost of 2 for instruction: %rvs = fptosi <2 x double> %d to <2 x i64>
-; ALL:  Cost Model: Found an estimated cost of 2 for instruction: %rvu = fptoui <2 x double> %d to <2 x i64>
-; ALL:  Cost Model: Found an estimated cost of 1 for instruction: %s48 = sitofp i48 %e to double
-; ALL:  Cost Model: Found an estimated cost of 1 for instruction: %u48 = uitofp i48 %e to double
-; ALL:  Cost Model: Found an estimated cost of 1 for instruction: %ru48 = fptoui double %c to i48
+; GFX6-THROUGHPUT-LABEL: 'i64_double'
+; GFX6-THROUGHPUT:  Cost Model: Found an estimated cost of 16 for instruction: %s = sitofp i64 %a to double
+; GFX6-THROUGHPUT:  Cost Model: Found an estimated cost of 16 for instruction: %u = uitofp i64 %a to double
+; GFX6-THROUGHPUT:  Cost Model: Found an estimated cost of 32 for instruction: %vs = sitofp <2 x i64> %b to <2 x double>
+; GFX6-THROUGHPUT:  Cost Model: Found an estimated cost of 32 for instruction: %vu = uitofp <2 x i64> %b to <2 x double>
+; GFX6-THROUGHPUT:  Cost Model: Found an estimated cost of 50 for instruction: %rs = fptosi double %c to i64
+; GFX6-THROUGHPUT:  Cost Model: Found an estimated cost of 50 for instruction: %ru = fptoui double %c to i64
+; GFX6-THROUGHPUT:  Cost Model: Found an estimated cost of 100 for instruction: %rvs = fptosi <2 x double> %d to <2 x i64>
+; GFX6-THROUGHPUT:  Cost Model: Found an estimated cost of 100 for instruction: %rvu = fptoui <2 x double> %d to <2 x i64>
+; GFX6-THROUGHPUT:  Cost Model: Found an estimated cost of 18 for instruction: %s48 = sitofp i48 %e to double
+; GFX6-THROUGHPUT:  Cost Model: Found an estimated cost of 17 for instruction: %u48 = uitofp i48 %e to double
+; GFX6-THROUGHPUT:  Cost Model: Found an estimated cost of 50 for instruction: %ru48 = fptoui double %c to i48
+;
+; GFX7-LABEL: 'i64_double'
+; GFX7:  Cost Model: Found an estimated cost of 16 for instruction: %s = sitofp i64 %a to double
+; GFX7:  Cost Model: Found an estimated cost of 16 for instruction: %u = uitofp i64 %a to double
+; GFX7:  Cost Model: Found an estimated cost of 32 for instruction: %vs = sitofp <2 x i64> %b to <2 x double>
+; GFX7:  Cost Model: Found an estimated cost of 32 for instruction: %vu = uitofp <2 x i64> %b to <2 x double>
+; GFX7:  Cost Model: Found an estimated cost of 25 for instruction: %rs = fptosi double %c to i64
+; GFX7:  Cost Model: Found an estimated cost of 25 for instruction: %ru = fptoui double %c to i64
+; GFX7:  Cost Model: Found an estimated cost of 50 for instruction: %rvs = fptosi <2 x double> %d to <2 x i64>
+; GFX7:  Cost Model: Found an estimated cost of 50 for instruction: %rvu = fptoui <2 x double> %d to <2 x i64>
+; GFX7:  Cost Model: Found an estimated cost of 18 for instruction: %s48 = sitofp i48 %e to double
+; GFX7:  Cost Model: Found an estimated cost of 17 for instruction: %u48 = uitofp i48 %e to double
+; GFX7:  Cost Model: Found an estimated cost of 25 for instruction: %ru48 = fptoui double %c to i48
+;
+; GFX9-THROUGHPUT-LABEL: 'i64_double'
+; GFX9-THROUGHPUT:  Cost Model: Found an estimated cost of 16 for instruction: %s = sitofp i64 %a to double
+; GFX9-THROUGHPUT:  Cost Model: Found an estimated cost of 16 for instruction: %u = uitofp i64 %a to double
+; GFX9-THROUGHPUT:  Cost Model: Found an estimated cost of 32 for instruction: %vs = sitofp <2 x i64> %b to <2 x double>
+; GFX9-THROUGHPUT:  Cost Model: Found an estimated cost of 32 for instruction: %vu = uitofp <2 x i64> %b to <2 x double>
+; GFX9-THROUGHPUT:  Cost Model: Found an estimated cost of 25 for instruction: %rs = fptosi double %c to i64
+; GFX9-THROUGHPUT:  Cost Model: Found an estimated cost of 25 for instruction: %ru = fptoui double %c to i64
+; GFX9-THROUGHPUT:  Cost Model: Found an estimated cost of 50 for instruction: %rvs = fptosi <2 x double> %d to <2 x i64>
+; GFX9-THROUGHPUT:  Cost Model: Found an estimated cost of 50 for instruction: %rvu = fptoui <2 x double> %d to <2 x i64>
+; GFX9-THROUGHPUT:  Cost Model: Found an estimated cost of 18 for instruction: %s48 = sitofp i48 %e to double
+; GFX9-THROUGHPUT:  Cost Model: Found an estimated cost of 17 for instruction: %u48 = uitofp i48 %e to double
+; GFX9-THROUGHPUT:  Cost Model: Found an estimated cost of 25 for instruction: %ru48 = fptoui double %c to i48
+;
+; HALF-LABEL: 'i64_double'
+; HALF:  Cost Model: Found an estimated cost of 8 for instruction: %s = sitofp i64 %a to double
+; HALF:  Cost Model: Found an estimated cost of 8 for instruction: %u = uitofp i64 %a to double
+; HALF:  Cost Model: Found an estimated cost of 16 for instruction: %vs = sitofp <2 x i64> %b to <2 x double>
+; HALF:  Cost Model: Found an estimated cost of 16 for instruction: %vu = uitofp <2 x i64> %b to <2 x double>
+; HALF:  Cost Model: Found an estimated cost of 13 for instruction: %rs = fptosi double %c to i64
+; HALF:  Cost Model: Found an estimated cost of 13 for instruction: %ru = fptoui double %c to i64
+; HALF:  Cost Model: Found an estimated cost of 26 for instruction: %rvs = fptosi <2 x double> %d to <2 x i64>
+; HALF:  Cost Model: Found an estimated cost of 26 for instruction: %rvu = fptoui <2 x double> %d to <2 x i64>
+; HALF:  Cost Model: Found an estimated cost of 10 for instruction: %s48 = sitofp i48 %e to double
+; HALF:  Cost Model: Found an estimated cost of 9 for instruction: %u48 = uitofp i48 %e to double
+; HALF:  Cost Model: Found an estimated cost of 13 for instruction: %ru48 = fptoui double %c to i48
+;
+; FULL-LABEL: 'i64_double'
+; FULL:  Cost Model: Found an estimated cost of 4 for instruction: %s = sitofp i64 %a to double
+; FULL:  Cost Model: Found an estimated cost of 4 for instruction: %u = uitofp i64 %a to double
+; FULL:  Cost Model: Found an estimated cost of 8 for instruction: %vs = sitofp <2 x i64> %b to <2 x double>
+; FULL:  Cost Model: Found an estimated cost of 8 for instruction: %vu = uitofp <2 x i64> %b to <2 x double>
+; FULL:  Cost Model: Found an estimated cost of 7 for instruction: %rs = fptosi double %c to i64
+; FULL:  Cost Model: Found an estimated cost of 7 for instruction: %ru = fptoui double %c to i64
+; FULL:  Cost Model: Found an estimated cost of 14 for instruction: %rvs = fptosi <2 x double> %d to <2 x i64>
+; FULL:  Cost Model: Found an estimated cost of 14 for instruction: %rvu = fptoui <2 x double> %d to <2 x i64>
+; FULL:  Cost Model: Found an estimated cost of 6 for instruction: %s48 = sitofp i48 %e to double
+; FULL:  Cost Model: Found an estimated cost of 5 for instruction: %u48 = uitofp i48 %e to double
+; FULL:  Cost Model: Found an estimated cost of 7 for instruction: %ru48 = fptoui double %c to i48
+;
+; GFX6-SIZE-LABEL: 'i64_double'
+; GFX6-SIZE:  Cost Model: Found an estimated cost of 8 for instruction: %s = sitofp i64 %a to double
+; GFX6-SIZE:  Cost Model: Found an estimated cost of 8 for instruction: %u = uitofp i64 %a to double
+; GFX6-SIZE:  Cost Model: Found an estimated cost of 16 for instruction: %vs = sitofp <2 x i64> %b to <2 x double>
+; GFX6-SIZE:  Cost Model: Found an estimated cost of 16 for instruction: %vu = uitofp <2 x i64> %b to <2 x double>
+; GFX6-SIZE:  Cost Model: Found an estimated cost of 36 for instruction: %rs = fptosi double %c to i64
+; GFX6-SIZE:  Cost Model: Found an estimated cost of 36 for instruction: %ru = fptoui double %c to i64
+; GFX6-SIZE:  Cost Model: Found an estimated cost of 72 for instruction: %rvs = fptosi <2 x double> %d to <2 x i64>
+; GFX6-SIZE:  Cost Model: Found an estimated cost of 72 for instruction: %rvu = fptoui <2 x double> %d to <2 x i64>
+; GFX6-SIZE:  Cost Model: Found an estimated cost of 10 for instruction: %s48 = sitofp i48 %e to double
+; GFX6-SIZE:  Cost Model: Found an estimated cost of 9 for instruction: %u48 = uitofp i48 %e to double
+; GFX6-SIZE:  Cost Model: Found an estimated cost of 36 for instruction: %ru48 = fptoui double %c to i48
 ;
   %s = sitofp i64 %a to double
   %u = uitofp i64 %a to double
@@ -187,19 +276,25 @@ define void @i64_double(i64 %a, <2 x i64> %b, double %c, <2 x double> %d, i48 %e
 }
 
 ; Integers of 33 to 63 bits are converted through i64.
-define void @i48(i48 %a, float %b, bfloat %c) {
+define void @i48(i48 %a, float %b, bfloat %c, <2 x float> %d, <2 x bfloat> %e) {
 ; ALL-LABEL: 'i48'
-; ALL:  Cost Model: Found an estimated cost of 1 for instruction: %s = sitofp i48 %a to float
-; ALL:  Cost Model: Found an estimated cost of 1 for instruction: %u = uitofp i48 %a to float
-; ALL:  Cost Model: Found an estimated cost of 1 for instruction: %rs = fptosi float %b to i48
-; ALL:  Cost Model: Found an estimated cost of 1 for instruction: %ru = fptoui float %b to i48
-; ALL:  Cost Model: Found an estimated cost of 1 for instruction: %bu = fptoui bfloat %c to i48
+; ALL:  Cost Model: Found an estimated cost of 14 for instruction: %s = sitofp i48 %a to float
+; ALL:  Cost Model: Found an estimated cost of 9 for instruction: %u = uitofp i48 %a to float
+; ALL:  Cost Model: Found an estimated cost of 13 for instruction: %rs = fptosi float %b to i48
+; ALL:  Cost Model: Found an estimated cost of 13 for instruction: %ru = fptoui float %b to i48
+; ALL:  Cost Model: Found an estimated cost of 14 for instruction: %bu = fptoui bfloat %c to i48
+; ALL:  Cost Model: Found an estimated cost of 26 for instruction: %vrs = fptosi <2 x float> %d to <2 x i48>
+; ALL:  Cost Model: Found an estimated cost of 12 for instruction: %vru = fptoui <2 x float> %d to <2 x i48>
+; ALL:  Cost Model: Found an estimated cost of 14 for instruction: %vbu = fptoui <2 x bfloat> %e to <2 x i48>
 ;
   %s = sitofp i48 %a to float
   %u = uitofp i48 %a to float
   %rs = fptosi float %b to i48
   %ru = fptoui float %b to i48
   %bu = fptoui bfloat %c to i48
+  %vrs = fptosi <2 x float> %d to <2 x i48>
+  %vru = fptoui <2 x float> %d to <2 x i48>
+  %vbu = fptoui <2 x bfloat> %e to <2 x i48>
   ret void
 }
 
diff --git a/llvm/test/Analysis/CostModel/AMDGPU/fptosi.ll b/llvm/test/Analysis/CostModel/AMDGPU/fptosi.ll
index 545643bd43e3d..c03cce72bb1f3 100644
--- a/llvm/test/Analysis/CostModel/AMDGPU/fptosi.ll
+++ b/llvm/test/Analysis/CostModel/AMDGPU/fptosi.ll
@@ -1,29 +1,57 @@
 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
-; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=amdgpu10.10-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL,FAST %s
-; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=amdgpu9.0a-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL,FAST %s
-; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=amdgpu9.00-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL,FAST %s
+; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=amdgpu10.10-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL,FAST,QUARTER64 %s
+; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=amdgpu9.0a-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL,FAST,FULL64 %s
+; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=amdgpu9.00-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL,FAST,QUARTER64 %s
 ; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=amdgpu6.01-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL,SLOW %s
 
-; RUN: opt -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output -mtriple=amdgpu10.10-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL-SIZE,FAST-SIZE %s
-; RUN: opt -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output -mtriple=amdgpu9.0a-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL-SIZE,FAST-SIZE %s
-; RUN: opt -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output -mtriple=amdgpu9.00-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL-SIZE,FAST-SIZE %s
+; RUN: opt -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output -mtriple=amdgpu10.10-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL-SIZE,FAST-SIZE,QUARTER64-SIZE %s
+; RUN: opt -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output -mtriple=amdgpu9.0a-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL-SIZE,FAST-SIZE,FULL64-SIZE %s
+; RUN: opt -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output -mtriple=amdgpu9.00-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL-SIZE,FAST-SIZE,QUARTER64-SIZE %s
 ; RUN: opt -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output -mtriple=amdgpu6.01-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL-SIZE,SLOW-SIZE %s
 ; END.
 
 define i32 @fptosi_double_i64(i32 %arg) {
-; ALL-LABEL: 'fptosi_double_i64'
-; ALL-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %I64 = fptosi double poison to i64
-; ALL-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2I64 = fptosi <2 x double> poison to <2 x i64>
-; ALL-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V4I64 = fptosi <4 x double> poison to <4 x i64>
-; ALL-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %V8I64 = fptosi <8 x double> poison to <8 x i64>
-; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret i32 poison
+; QUARTER64-LABEL: 'fptosi_double_i64'
+; QUARTER64-NEXT:  Cost Model: Found an estimated cost of 25 for instruction: %I64 = fptosi double poison to i64
+; QUARTER64-NEXT:  Cost Model: Found an estimated cost of 50 for instruction: %V2I64 = fptosi <2 x double> poison to <2 x i64>
+; QUARTER64-NEXT:  Cost Model: Found an estimated cost of 100 for instruction: %V4I64 = fptosi <4 x double> poison to <4 x i64>
+; QUARTER64-NEXT:  Cost Model: Found an estimated cost of 200 for instruction: %V8I64 = fptosi <8 x double> poison to <8 x i64>
+; QUARTER64-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret i32 poison
 ;
-; ALL-SIZE-LABEL: 'fptosi_double_i64'
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %I64 = fptosi double poison to i64
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2I64 = fptosi <2 x double> poison to <2 x i64>
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V4I64 = fptosi <4 x double> poison to <4 x i64>
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %V8I64 = fptosi <8 x double> poison to <8 x i64>
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 poison
+; FULL64-LABEL: 'fptosi_double_i64'
+; FULL64-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %I64 = fptosi double poison to i64
+; FULL64-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %V2I64 = fptosi <2 x double> poison to <2 x i64>
+; FULL64-NEXT:  Cost Model: Found an estimated cost of 28 for instruction: %V4I64 = fptosi <4 x double> poison to <4 x i64>
+; FULL64-NEXT:  Cost Model: Found an estimated cost of 56 for instruction: %V8I64 = fptosi <8 x double> poison to <8 x i64>
+; FULL64-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret i32 poison
+;
+; SLOW-LABEL: 'fptosi_double_i64'
+; SLOW-NEXT:  Cost Model: Found an estimated cost of 50 for instruction: %I64 = fptosi double poison to i64
+; SLOW-NEXT:  Cost Model: Found an estimated cost of 100 for instruction: %V2I64 = fptosi <2 x double> poison to <2 x i64>
+; SLOW-NEXT:  Cost Model: Found an estimated cost of 200 for instruction: %V4I64 = fptosi <4 x double> poison to <4 x i64>
+; SLOW-NEXT:  Cost Model: Found an estimated cost of 400 for instruction: %V8I64 = fptosi <8 x double> poison to <8 x i64>
+; SLOW-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret i32 poison
+;
+; QUARTER64-SIZE-LABEL: 'fptosi_double_i64'
+; QUARTER64-SIZE-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %I64 = fptosi double poison to i64
+; QUARTER64-SIZE-NEXT:  Cost Model: Found an estimated cost of 26 for instruction: %V2I64 = fptosi <2 x double> poison to <2 x i64>
+; QUARTER64-SIZE-NEXT:  Cost Model: Found an estimated cost of 52 for instruction: %V4I64 = fptosi <4 x double> poison to <4 x i64>
+; QUARTER64-SIZE-NEXT:  Cost Model: Found an estimated cost of 104 for instruction: %V8I64 = fptosi <8 x double> poison to <8 x i64>
+; QUARTER64-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 poison
+;
+; FULL64-SIZE-LABEL: 'fptosi_double_i64'
+; FULL64-SIZE-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %I64 = fptosi double poison to i64
+; FULL64-SIZE-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %V2I64 = fptosi <2 x double> poison to <2 x i64>
+; FULL64-SIZE-NEXT:  Cost Model: Found an estimated cost of 28 for instruction: %V4I64 = fptosi <4 x double> poison to <4 x i64>
+; FULL64-SIZE-NEXT:  Cost Model: Found an estimated cost of 56 for instruction: %V8I64 = fptosi <8 x double> poison to <8 x i64>
+; FULL64-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 poison
+;
+; SLOW-SIZE-LABEL: 'fptosi_double_i64'
+; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 36 for instruction: %I64 = fptosi double poison to i64
+; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 72 for instruction: %V2I64 = fptosi <2 x double> poison to <2 x i64>
+; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 144 for instruction: %V4I64 = fptosi <4 x double> poison to <4 x i64>
+; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 288 for instruction: %V8I64 = fptosi <8 x double> poison to <8 x i64>
+; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 poison
 ;
   %I64 = fptosi double poison to i64
   %V2I64 = fptosi <2 x double> poison to <2 x i64>
@@ -128,19 +156,19 @@ define i32 @fptosi_double_i8(i32 %arg) {
 
 define i32 @fptosi_float_i64(i32 %arg) {
 ; ALL-LABEL: 'fptosi_float_i64'
-; ALL-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %I64 = fptosi float poison to i64
-; ALL-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2I64 = fptosi <2 x float> poison to <2 x i64>
-; ALL-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V4I64 = fptosi <4 x float> poison to <4 x i64>
-; ALL-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %V8I64 = fptosi <8 x float> poison to <8 x i64>
-; ALL-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %V16I64 = fptosi <16 x float> poison to <16 x i64>
+; ALL-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %I64 = fptosi float poison to i64
+; ALL-NEXT:  Cost Model: Found an estimated cost of 26 for instruction: %V2I64 = fptosi <2 x float> poison to <2 x i64>
+; ALL-NEXT:  Cost Model: Found an estimated cost of 52 for instruction: %V4I64 = fptosi <4 x float> poison to <4 x i64>
+; ALL-NEXT:  Cost Model: Found an estimated cost of 104 for instruction: %V8I64 = fptosi <8 x float> poison to <8 x i64>
+; ALL-NEXT:  Cost Model: Found an estimated cost of 208 for instruction: %V16I64 = fptosi <16 x float> poison to <16 x i64>
 ; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret i32 poison
 ;
 ; ALL-SIZE-LABEL: 'fptosi_float_i64'
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %I64 = fptosi float poison to i64
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2I64 = fptosi <2 x float> poison to <2 x i64>
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V4I64 = fptosi <4 x float> poison to <4 x i64>
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %V8I64 = fptosi <8 x float> poison to <8 x i64>
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %V16I64 = fptosi <16 x float> poison to <16 x i64>
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %I64 = fptosi float poison to i64
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 26 for instruction: %V2I64 = fptosi <2 x float> poison to <2 x i64>
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 52 for instruction: %V4I64 = fptosi <4 x float> poison to <4 x i64>
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 104 for instruction: %V8I64 = fptosi <8 x float> poison to <8 x i64>
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 208 for instruction: %V16I64 = fptosi <16 x float> poison to <16 x i64>
 ; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 poison
 ;
   %I64 = fptosi float poison to i64
@@ -260,19 +288,19 @@ define i32 @fptosi_float_i8(i32 %arg) {
 
 define i32 @fptosi_half_i64(i32 %arg) {
 ; ALL-LABEL: 'fptosi_half_i64'
-; ALL-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %I64 = fptosi half poison to i64
-; ALL-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2I64 = fptosi <2 x half> poison to <2 x i64>
-; ALL-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V4I64 = fptosi <4 x half> poison to <4 x i64>
-; ALL-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %V8I64 = fptosi <8 x half> poison to <8 x i64>
-; ALL-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %V16I64 = fptosi <16 x half> poison to <16 x i64>
+; ALL-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %I64 = fptosi half poison to i64
+; ALL-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %V2I64 = fptosi <2 x half> poison to <2 x i64>
+; ALL-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %V4I64 = fptosi <4 x half> poison to <4 x i64>
+; ALL-NEXT:  Cost Model: Found an estimated cost of 24 for instruction: %V8I64 = fptosi <8 x half> poison to <8 x i64>
+; ALL-NEXT:  Cost Model: Found an estimated cost of 48 for instruction: %V16I64 = fptosi <16 x half> poison to <16 x i64>
 ; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret i32 poison
 ;
 ; ALL-SIZE-LABEL: 'fptosi_half_i64'
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %I64 = fptosi half poison to i64
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2I64 = fptosi <2 x half> poison to <2 x i64>
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V4I64 = fptosi <4 x half> poison to <4 x i64>
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %V8I64 = fptosi <8 x half> poison to <8 x i64>
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %V16I64 = fptosi <16 x half> poison to <16 x i64>
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %I64 = fptosi half poison to i64
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %V2I64 = fptosi <2 x half> poison to <2 x i64>
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %V4I64 = fptosi <4 x half> poison to <4 x i64>
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 24 for instruction: %V8I64 = fptosi <8 x half> poison to <8 x i64>
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 48 for instruction: %V16I64 = fptosi <16 x half> poison to <16 x i64>
 ; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 poison
 ;
   %I64 = fptosi half poison to i64
diff --git a/llvm/test/Analysis/CostModel/AMDGPU/fptoui.ll b/llvm/test/Analysis/CostModel/AMDGPU/fptoui.ll
index 1cd41d8376e45..af945583383cd 100644
--- a/llvm/test/Analysis/CostModel/AMDGPU/fptoui.ll
+++ b/llvm/test/Analysis/CostModel/AMDGPU/fptoui.ll
@@ -1,29 +1,57 @@
 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
-; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=amdgpu10.10-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL,FAST %s
-; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=amdgpu9.0a-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL,FAST %s
-; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=amdgpu9.00-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL,FAST %s
+; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=amdgpu10.10-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL,FAST,QUARTER64 %s
+; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=amdgpu9.0a-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL,FAST,FULL64 %s
+; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=amdgpu9.00-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL,FAST,QUARTER64 %s
 ; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=amdgpu6.01-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL,SLOW %s
 
-; RUN: opt -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output -mtriple=amdgpu10.10-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL-SIZE,FAST-SIZE %s
-; RUN: opt -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output -mtriple=amdgpu9.0a-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL-SIZE,FAST-SIZE %s
-; RUN: opt -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output -mtriple=amdgpu9.00-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL-SIZE,FAST-SIZE %s
+; RUN: opt -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output -mtriple=amdgpu10.10-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL-SIZE,FAST-SIZE,QUARTER64-SIZE %s
+; RUN: opt -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output -mtriple=amdgpu9.0a-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL-SIZE,FAST-SIZE,FULL64-SIZE %s
+; RUN: opt -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output -mtriple=amdgpu9.00-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL-SIZE,FAST-SIZE,QUARTER64-SIZE %s
 ; RUN: opt -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output -mtriple=amdgpu6.01-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL-SIZE,SLOW-SIZE %s
 ; END.
 
 define i32 @fptoui_double_i64(i32 %arg) {
-; ALL-LABEL: 'fptoui_double_i64'
-; ALL-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %I64 = fptoui double poison to i64
-; ALL-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2I64 = fptoui <2 x double> poison to <2 x i64>
-; ALL-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V4I64 = fptoui <4 x double> poison to <4 x i64>
-; ALL-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %V8I64 = fptoui <8 x double> poison to <8 x i64>
-; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret i32 poison
+; QUARTER64-LABEL: 'fptoui_double_i64'
+; QUARTER64-NEXT:  Cost Model: Found an estimated cost of 25 for instruction: %I64 = fptoui double poison to i64
+; QUARTER64-NEXT:  Cost Model: Found an estimated cost of 50 for instruction: %V2I64 = fptoui <2 x double> poison to <2 x i64>
+; QUARTER64-NEXT:  Cost Model: Found an estimated cost of 100 for instruction: %V4I64 = fptoui <4 x double> poison to <4 x i64>
+; QUARTER64-NEXT:  Cost Model: Found an estimated cost of 200 for instruction: %V8I64 = fptoui <8 x double> poison to <8 x i64>
+; QUARTER64-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret i32 poison
 ;
-; ALL-SIZE-LABEL: 'fptoui_double_i64'
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %I64 = fptoui double poison to i64
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2I64 = fptoui <2 x double> poison to <2 x i64>
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V4I64 = fptoui <4 x double> poison to <4 x i64>
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %V8I64 = fptoui <8 x double> poison to <8 x i64>
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 poison
+; FULL64-LABEL: 'fptoui_double_i64'
+; FULL64-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %I64 = fptoui double poison to i64
+; FULL64-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %V2I64 = fptoui <2 x double> poison to <2 x i64>
+; FULL64-NEXT:  Cost Model: Found an estimated cost of 28 for instruction: %V4I64 = fptoui <4 x double> poison to <4 x i64>
+; FULL64-NEXT:  Cost Model: Found an estimated cost of 56 for instruction: %V8I64 = fptoui <8 x double> poison to <8 x i64>
+; FULL64-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret i32 poison
+;
+; SLOW-LABEL: 'fptoui_double_i64'
+; SLOW-NEXT:  Cost Model: Found an estimated cost of 50 for instruction: %I64 = fptoui double poison to i64
+; SLOW-NEXT:  Cost Model: Found an estimated cost of 100 for instruction: %V2I64 = fptoui <2 x double> poison to <2 x i64>
+; SLOW-NEXT:  Cost Model: Found an estimated cost of 200 for instruction: %V4I64 = fptoui <4 x double> poison to <4 x i64>
+; SLOW-NEXT:  Cost Model: Found an estimated cost of 400 for instruction: %V8I64 = fptoui <8 x double> poison to <8 x i64>
+; SLOW-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret i32 poison
+;
+; QUARTER64-SIZE-LABEL: 'fptoui_double_i64'
+; QUARTER64-SIZE-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %I64 = fptoui double poison to i64
+; QUARTER64-SIZE-NEXT:  Cost Model: Found an estimated cost of 26 for instruction: %V2I64 = fptoui <2 x double> poison to <2 x i64>
+; QUARTER64-SIZE-NEXT:  Cost Model: Found an estimated cost of 52 for instruction: %V4I64 = fptoui <4 x double> poison to <4 x i64>
+; QUARTER64-SIZE-NEXT:  Cost Model: Found an estimated cost of 104 for instruction: %V8I64 = fptoui <8 x double> poison to <8 x i64>
+; QUARTER64-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 poison
+;
+; FULL64-SIZE-LABEL: 'fptoui_double_i64'
+; FULL64-SIZE-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %I64 = fptoui double poison to i64
+; FULL64-SIZE-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %V2I64 = fptoui <2 x double> poison to <2 x i64>
+; FULL64-SIZE-NEXT:  Cost Model: Found an estimated cost of 28 for instruction: %V4I64 = fptoui <4 x double> poison to <4 x i64>
+; FULL64-SIZE-NEXT:  Cost Model: Found an estimated cost of 56 for instruction: %V8I64 = fptoui <8 x double> poison to <8 x i64>
+; FULL64-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 poison
+;
+; SLOW-SIZE-LABEL: 'fptoui_double_i64'
+; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 36 for instruction: %I64 = fptoui double poison to i64
+; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 72 for instruction: %V2I64 = fptoui <2 x double> poison to <2 x i64>
+; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 144 for instruction: %V4I64 = fptoui <4 x double> poison to <4 x i64>
+; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 288 for instruction: %V8I64 = fptoui <8 x double> poison to <8 x i64>
+; SLOW-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 poison
 ;
   %I64 = fptoui double poison to i64
   %V2I64 = fptoui <2 x double> poison to <2 x i64>
@@ -128,19 +156,19 @@ define i32 @fptoui_double_i8(i32 %arg) {
 
 define i32 @fptoui_float_i64(i32 %arg) {
 ; ALL-LABEL: 'fptoui_float_i64'
-; ALL-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %I64 = fptoui float poison to i64
-; ALL-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2I64 = fptoui <2 x float> poison to <2 x i64>
-; ALL-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V4I64 = fptoui <4 x float> poison to <4 x i64>
-; ALL-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %V8I64 = fptoui <8 x float> poison to <8 x i64>
-; ALL-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %V16I64 = fptoui <16 x float> poison to <16 x i64>
+; ALL-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %I64 = fptoui float poison to i64
+; ALL-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %V2I64 = fptoui <2 x float> poison to <2 x i64>
+; ALL-NEXT:  Cost Model: Found an estimated cost of 24 for instruction: %V4I64 = fptoui <4 x float> poison to <4 x i64>
+; ALL-NEXT:  Cost Model: Found an estimated cost of 48 for instruction: %V8I64 = fptoui <8 x float> poison to <8 x i64>
+; ALL-NEXT:  Cost Model: Found an estimated cost of 96 for instruction: %V16I64 = fptoui <16 x float> poison to <16 x i64>
 ; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret i32 poison
 ;
 ; ALL-SIZE-LABEL: 'fptoui_float_i64'
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %I64 = fptoui float poison to i64
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2I64 = fptoui <2 x float> poison to <2 x i64>
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V4I64 = fptoui <4 x float> poison to <4 x i64>
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %V8I64 = fptoui <8 x float> poison to <8 x i64>
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %V16I64 = fptoui <16 x float> poison to <16 x i64>
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %I64 = fptoui float poison to i64
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %V2I64 = fptoui <2 x float> poison to <2 x i64>
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 24 for instruction: %V4I64 = fptoui <4 x float> poison to <4 x i64>
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 48 for instruction: %V8I64 = fptoui <8 x float> poison to <8 x i64>
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 96 for instruction: %V16I64 = fptoui <16 x float> poison to <16 x i64>
 ; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 poison
 ;
   %I64 = fptoui float poison to i64
@@ -260,19 +288,19 @@ define i32 @fptoui_float_i8(i32 %arg) {
 
 define i32 @fptoui_half_i64(i32 %arg) {
 ; ALL-LABEL: 'fptoui_half_i64'
-; ALL-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %I64 = fptoui half poison to i64
-; ALL-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2I64 = fptoui <2 x half> poison to <2 x i64>
-; ALL-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V4I64 = fptoui <4 x half> poison to <4 x i64>
-; ALL-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %V8I64 = fptoui <8 x half> poison to <8 x i64>
-; ALL-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %V16I64 = fptoui <16 x half> poison to <16 x i64>
+; ALL-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %I64 = fptoui half poison to i64
+; ALL-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %V2I64 = fptoui <2 x half> poison to <2 x i64>
+; ALL-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %V4I64 = fptoui <4 x half> poison to <4 x i64>
+; ALL-NEXT:  Cost Model: Found an estimated cost of 24 for instruction: %V8I64 = fptoui <8 x half> poison to <8 x i64>
+; ALL-NEXT:  Cost Model: Found an estimated cost of 48 for instruction: %V16I64 = fptoui <16 x half> poison to <16 x i64>
 ; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret i32 poison
 ;
 ; ALL-SIZE-LABEL: 'fptoui_half_i64'
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %I64 = fptoui half poison to i64
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2I64 = fptoui <2 x half> poison to <2 x i64>
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V4I64 = fptoui <4 x half> poison to <4 x i64>
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %V8I64 = fptoui <8 x half> poison to <8 x i64>
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %V16I64 = fptoui <16 x half> poison to <16 x i64>
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %I64 = fptoui half poison to i64
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %V2I64 = fptoui <2 x half> poison to <2 x i64>
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %V4I64 = fptoui <4 x half> poison to <4 x i64>
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 24 for instruction: %V8I64 = fptoui <8 x half> poison to <8 x i64>
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 48 for instruction: %V16I64 = fptoui <16 x half> poison to <16 x i64>
 ; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 poison
 ;
   %I64 = fptoui half poison to i64



More information about the llvm-branch-commits mailing list