[llvm] [AMDGPU] Model the cost of the expanded integer to/from floating point casts (PR #223572)
Dmitry Sidorov via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 22 02:35:15 PDT 2026
https://github.com/MrSidims updated https://github.com/llvm/llvm-project/pull/223572
>From 997ea51e1c7d76b47ee47b81ea13b47afb071468 Mon Sep 17 00:00:00 2001
From: Dmitry Sidorov <Dmitry.Sidorov at amd.com>
Date: Thu, 17 Sep 2026 01:38:01 +0200
Subject: [PATCH 1/2] [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 | 533 +++++++++++-------
.../CostModel/AMDGPU/expanded-int-fp-casts.ll | 222 +++++---
llvm/test/Analysis/CostModel/AMDGPU/fptosi.ll | 97 ++--
llvm/test/Analysis/CostModel/AMDGPU/fptoui.ll | 97 ++--
.../CostModel/AMDGPU/narrow-int-to-bfloat.ll | 140 ++---
.../CostModel/AMDGPU/narrow-int-to-fp.ll | 378 ++++++-------
7 files changed, 950 insertions(+), 624 deletions(-)
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
index fdabf397fc614..c75ac82162bec 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
@@ -1023,6 +1023,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 aab8fbe6f5e4d..9ef8bac382e71 100644
--- a/llvm/test/Analysis/CostModel/AMDGPU/cast.ll
+++ b/llvm/test/Analysis/CostModel/AMDGPU/cast.ll
@@ -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
@@ -685,10 +789,3 @@ define void @fp_conv(<8 x float> %a, <16 x float>%b, <4 x float> %c) {
%A4 = fptrunc <8 x double> poison to <8 x float>
ret void
}
-;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
-; FAST-QUARTER64: {{.*}}
-; FAST-QUARTER64-SIZE: {{.*}}
-; FULL64: {{.*}}
-; FULL64-SIZE: {{.*}}
-; QUARTER64: {{.*}}
-; QUARTER64-SIZE: {{.*}}
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 5e97470eea6b2..7d6125c02d1f8 100644
--- a/llvm/test/Analysis/CostModel/AMDGPU/expanded-int-fp-casts.ll
+++ b/llvm/test/Analysis/CostModel/AMDGPU/expanded-int-fp-casts.ll
@@ -19,12 +19,12 @@
; 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
-;
-; 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
-;
-; 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
-;
-; 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
+; 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
+;
+; 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
+;
+; 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
+;
+; 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
@@ -92,18 +112,83 @@ define void @i64_to_bf16(i64 %a, <2 x i64> %b, <3 x i64> %c, i48 %d) {
; 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
@@ -122,14 +207,14 @@ 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, <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 2 for instruction: %vrs = fptosi <2 x float> %d to <2 x i48>
-; ALL: Cost Model: Found an estimated cost of 2 for instruction: %vru = fptoui <2 x float> %d to <2 x i48>
-; ALL: Cost Model: Found an estimated cost of 2 for instruction: %vbu = fptoui <2 x bfloat> %e to <2 x 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
@@ -214,12 +299,3 @@ define void @other_widths(i128 %a, double %b, <2 x i128> %c, <2 x double> %d, fp
%rqu = uitofp i64 %f to fp128
ret void
}
-;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
-; GFX11: {{.*}}
-; GFX6-SIZE: {{.*}}
-; GFX6-THROUGHPUT: {{.*}}
-; GFX7: {{.*}}
-; GFX8: {{.*}}
-; GFX9: {{.*}}
-; NATIVE-NOSDWA: {{.*}}
-; NATIVE-SDWA: {{.*}}
diff --git a/llvm/test/Analysis/CostModel/AMDGPU/fptosi.ll b/llvm/test/Analysis/CostModel/AMDGPU/fptosi.ll
index e122a9b667e7f..c03cce72bb1f3 100644
--- a/llvm/test/Analysis/CostModel/AMDGPU/fptosi.ll
+++ b/llvm/test/Analysis/CostModel/AMDGPU/fptosi.ll
@@ -11,19 +11,47 @@
; 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
@@ -282,8 +310,3 @@ define i32 @fptosi_half_i64(i32 %arg) {
%V16I64 = fptosi <16 x half> poison to <16 x i64>
ret i32 poison
}
-;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
-; FULL64: {{.*}}
-; FULL64-SIZE: {{.*}}
-; QUARTER64: {{.*}}
-; QUARTER64-SIZE: {{.*}}
diff --git a/llvm/test/Analysis/CostModel/AMDGPU/fptoui.ll b/llvm/test/Analysis/CostModel/AMDGPU/fptoui.ll
index 3ed5d1ea77325..af945583383cd 100644
--- a/llvm/test/Analysis/CostModel/AMDGPU/fptoui.ll
+++ b/llvm/test/Analysis/CostModel/AMDGPU/fptoui.ll
@@ -11,19 +11,47 @@
; 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
@@ -282,8 +310,3 @@ define i32 @fptoui_half_i64(i32 %arg) {
%V16I64 = fptoui <16 x half> poison to <16 x i64>
ret i32 poison
}
-;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
-; FULL64: {{.*}}
-; FULL64-SIZE: {{.*}}
-; QUARTER64: {{.*}}
-; QUARTER64-SIZE: {{.*}}
diff --git a/llvm/test/Analysis/CostModel/AMDGPU/narrow-int-to-bfloat.ll b/llvm/test/Analysis/CostModel/AMDGPU/narrow-int-to-bfloat.ll
index 1aa34e3b2bf3b..22d65c5fa11f1 100644
--- a/llvm/test/Analysis/CostModel/AMDGPU/narrow-int-to-bfloat.ll
+++ b/llvm/test/Analysis/CostModel/AMDGPU/narrow-int-to-bfloat.ll
@@ -14,12 +14,12 @@
; rounding still needs one integer-to-f32 conversion for each input lane.
define void @narrow_to_bfloat(<4 x i8> %a, <4 x i12> %b, <4 x i16> %c, <4 x i17> %d, <4 x i31> %e, <3 x i12> %f, <3 x i17> %g, <2 x i16> %h, <3 x i32> %i) {
; NO16BIT-LABEL: 'narrow_to_bfloat'
-; NO16BIT: Cost Model: Found an estimated cost of 4 for instruction: %as = sitofp <4 x i8> %a to <4 x bfloat>
-; NO16BIT: Cost Model: Found an estimated cost of 4 for instruction: %au = uitofp <4 x i8> %a to <4 x bfloat>
+; NO16BIT: Cost Model: Found an estimated cost of 12 for instruction: %as = sitofp <4 x i8> %a to <4 x bfloat>
+; NO16BIT: Cost Model: Found an estimated cost of 8 for instruction: %au = uitofp <4 x i8> %a to <4 x bfloat>
; NO16BIT: Cost Model: Found an estimated cost of 4 for instruction: %bs = sitofp <4 x i12> %b to <4 x bfloat>
; NO16BIT: Cost Model: Found an estimated cost of 4 for instruction: %bu = uitofp <4 x i12> %b to <4 x bfloat>
-; NO16BIT: Cost Model: Found an estimated cost of 4 for instruction: %cs = sitofp <4 x i16> %c to <4 x bfloat>
-; NO16BIT: Cost Model: Found an estimated cost of 4 for instruction: %cu = uitofp <4 x i16> %c to <4 x bfloat>
+; NO16BIT: Cost Model: Found an estimated cost of 12 for instruction: %cs = sitofp <4 x i16> %c to <4 x bfloat>
+; NO16BIT: Cost Model: Found an estimated cost of 12 for instruction: %cu = uitofp <4 x i16> %c to <4 x bfloat>
; NO16BIT: Cost Model: Found an estimated cost of 4 for instruction: %ds = sitofp <4 x i17> %d to <4 x bfloat>
; NO16BIT: Cost Model: Found an estimated cost of 4 for instruction: %du = uitofp <4 x i17> %d to <4 x bfloat>
; NO16BIT: Cost Model: Found an estimated cost of 4 for instruction: %es = sitofp <4 x i31> %e to <4 x bfloat>
@@ -28,18 +28,18 @@ define void @narrow_to_bfloat(<4 x i8> %a, <4 x i12> %b, <4 x i16> %c, <4 x i17>
; NO16BIT: Cost Model: Found an estimated cost of 9 for instruction: %fu = uitofp <3 x i12> %f to <3 x bfloat>
; NO16BIT: Cost Model: Found an estimated cost of 9 for instruction: %gs = sitofp <3 x i17> %g to <3 x bfloat>
; NO16BIT: Cost Model: Found an estimated cost of 9 for instruction: %gu = uitofp <3 x i17> %g to <3 x bfloat>
-; NO16BIT: Cost Model: Found an estimated cost of 2 for instruction: %hs = sitofp <2 x i16> %h to <2 x bfloat>
-; NO16BIT: Cost Model: Found an estimated cost of 2 for instruction: %hu = uitofp <2 x i16> %h to <2 x bfloat>
-; NO16BIT: Cost Model: Found an estimated cost of 9 for instruction: %is = sitofp <3 x i32> %i to <3 x bfloat>
-; NO16BIT: Cost Model: Found an estimated cost of 9 for instruction: %iu = uitofp <3 x i32> %i to <3 x bfloat>
+; NO16BIT: Cost Model: Found an estimated cost of 6 for instruction: %hs = sitofp <2 x i16> %h to <2 x bfloat>
+; NO16BIT: Cost Model: Found an estimated cost of 6 for instruction: %hu = uitofp <2 x i16> %h to <2 x bfloat>
+; NO16BIT: Cost Model: Found an estimated cost of 6 for instruction: %is = sitofp <3 x i32> %i to <3 x bfloat>
+; NO16BIT: Cost Model: Found an estimated cost of 6 for instruction: %iu = uitofp <3 x i32> %i to <3 x bfloat>
;
; NOGFX9-LABEL: 'narrow_to_bfloat'
-; NOGFX9: Cost Model: Found an estimated cost of 4 for instruction: %as = sitofp <4 x i8> %a to <4 x bfloat>
-; NOGFX9: Cost Model: Found an estimated cost of 4 for instruction: %au = uitofp <4 x i8> %a to <4 x bfloat>
+; NOGFX9: Cost Model: Found an estimated cost of 36 for instruction: %as = sitofp <4 x i8> %a to <4 x bfloat>
+; NOGFX9: Cost Model: Found an estimated cost of 32 for instruction: %au = uitofp <4 x i8> %a to <4 x bfloat>
; NOGFX9: Cost Model: Found an estimated cost of 10 for instruction: %bs = sitofp <4 x i12> %b to <4 x bfloat>
; NOGFX9: Cost Model: Found an estimated cost of 10 for instruction: %bu = uitofp <4 x i12> %b to <4 x bfloat>
-; NOGFX9: Cost Model: Found an estimated cost of 10 for instruction: %cs = sitofp <4 x i16> %c to <4 x bfloat>
-; NOGFX9: Cost Model: Found an estimated cost of 10 for instruction: %cu = uitofp <4 x i16> %c to <4 x bfloat>
+; NOGFX9: Cost Model: Found an estimated cost of 32 for instruction: %cs = sitofp <4 x i16> %c to <4 x bfloat>
+; NOGFX9: Cost Model: Found an estimated cost of 32 for instruction: %cu = uitofp <4 x i16> %c to <4 x bfloat>
; NOGFX9: Cost Model: Found an estimated cost of 10 for instruction: %ds = sitofp <4 x i17> %d to <4 x bfloat>
; NOGFX9: Cost Model: Found an estimated cost of 10 for instruction: %du = uitofp <4 x i17> %d to <4 x bfloat>
; NOGFX9: Cost Model: Found an estimated cost of 10 for instruction: %es = sitofp <4 x i31> %e to <4 x bfloat>
@@ -48,18 +48,18 @@ define void @narrow_to_bfloat(<4 x i8> %a, <4 x i12> %b, <4 x i16> %c, <4 x i17>
; NOGFX9: Cost Model: Found an estimated cost of 7 for instruction: %fu = uitofp <3 x i12> %f to <3 x bfloat>
; NOGFX9: Cost Model: Found an estimated cost of 7 for instruction: %gs = sitofp <3 x i17> %g to <3 x bfloat>
; NOGFX9: Cost Model: Found an estimated cost of 7 for instruction: %gu = uitofp <3 x i17> %g to <3 x bfloat>
-; NOGFX9: Cost Model: Found an estimated cost of 4 for instruction: %hs = sitofp <2 x i16> %h to <2 x bfloat>
-; NOGFX9: Cost Model: Found an estimated cost of 4 for instruction: %hu = uitofp <2 x i16> %h to <2 x bfloat>
-; NOGFX9: Cost Model: Found an estimated cost of 7 for instruction: %is = sitofp <3 x i32> %i to <3 x bfloat>
-; NOGFX9: Cost Model: Found an estimated cost of 7 for instruction: %iu = uitofp <3 x i32> %i to <3 x bfloat>
+; NOGFX9: Cost Model: Found an estimated cost of 16 for instruction: %hs = sitofp <2 x i16> %h to <2 x bfloat>
+; NOGFX9: Cost Model: Found an estimated cost of 16 for instruction: %hu = uitofp <2 x i16> %h to <2 x bfloat>
+; NOGFX9: Cost Model: Found an estimated cost of 24 for instruction: %is = sitofp <3 x i32> %i to <3 x bfloat>
+; NOGFX9: Cost Model: Found an estimated cost of 24 for instruction: %iu = uitofp <3 x i32> %i to <3 x bfloat>
;
; SDWA-LABEL: 'narrow_to_bfloat'
-; SDWA: Cost Model: Found an estimated cost of 4 for instruction: %as = sitofp <4 x i8> %a to <4 x bfloat>
-; SDWA: Cost Model: Found an estimated cost of 4 for instruction: %au = uitofp <4 x i8> %a to <4 x bfloat>
+; SDWA: Cost Model: Found an estimated cost of 32 for instruction: %as = sitofp <4 x i8> %a to <4 x bfloat>
+; SDWA: Cost Model: Found an estimated cost of 28 for instruction: %au = uitofp <4 x i8> %a to <4 x bfloat>
; SDWA: Cost Model: Found an estimated cost of 10 for instruction: %bs = sitofp <4 x i12> %b to <4 x bfloat>
; SDWA: Cost Model: Found an estimated cost of 10 for instruction: %bu = uitofp <4 x i12> %b to <4 x bfloat>
-; SDWA: Cost Model: Found an estimated cost of 10 for instruction: %cs = sitofp <4 x i16> %c to <4 x bfloat>
-; SDWA: Cost Model: Found an estimated cost of 10 for instruction: %cu = uitofp <4 x i16> %c to <4 x bfloat>
+; SDWA: Cost Model: Found an estimated cost of 28 for instruction: %cs = sitofp <4 x i16> %c to <4 x bfloat>
+; SDWA: Cost Model: Found an estimated cost of 28 for instruction: %cu = uitofp <4 x i16> %c to <4 x bfloat>
; SDWA: Cost Model: Found an estimated cost of 10 for instruction: %ds = sitofp <4 x i17> %d to <4 x bfloat>
; SDWA: Cost Model: Found an estimated cost of 10 for instruction: %du = uitofp <4 x i17> %d to <4 x bfloat>
; SDWA: Cost Model: Found an estimated cost of 10 for instruction: %es = sitofp <4 x i31> %e to <4 x bfloat>
@@ -68,18 +68,18 @@ define void @narrow_to_bfloat(<4 x i8> %a, <4 x i12> %b, <4 x i16> %c, <4 x i17>
; SDWA: Cost Model: Found an estimated cost of 7 for instruction: %fu = uitofp <3 x i12> %f to <3 x bfloat>
; SDWA: Cost Model: Found an estimated cost of 7 for instruction: %gs = sitofp <3 x i17> %g to <3 x bfloat>
; SDWA: Cost Model: Found an estimated cost of 7 for instruction: %gu = uitofp <3 x i17> %g to <3 x bfloat>
-; SDWA: Cost Model: Found an estimated cost of 4 for instruction: %hs = sitofp <2 x i16> %h to <2 x bfloat>
-; SDWA: Cost Model: Found an estimated cost of 4 for instruction: %hu = uitofp <2 x i16> %h to <2 x bfloat>
-; SDWA: Cost Model: Found an estimated cost of 7 for instruction: %is = sitofp <3 x i32> %i to <3 x bfloat>
-; SDWA: Cost Model: Found an estimated cost of 7 for instruction: %iu = uitofp <3 x i32> %i to <3 x bfloat>
+; SDWA: Cost Model: Found an estimated cost of 14 for instruction: %hs = sitofp <2 x i16> %h to <2 x bfloat>
+; SDWA: Cost Model: Found an estimated cost of 14 for instruction: %hu = uitofp <2 x i16> %h to <2 x bfloat>
+; SDWA: Cost Model: Found an estimated cost of 21 for instruction: %is = sitofp <3 x i32> %i to <3 x bfloat>
+; SDWA: Cost Model: Found an estimated cost of 21 for instruction: %iu = uitofp <3 x i32> %i to <3 x bfloat>
;
; PACKED-LABEL: 'narrow_to_bfloat'
-; PACKED: Cost Model: Found an estimated cost of 4 for instruction: %as = sitofp <4 x i8> %a to <4 x bfloat>
-; PACKED: Cost Model: Found an estimated cost of 4 for instruction: %au = uitofp <4 x i8> %a to <4 x bfloat>
+; PACKED: Cost Model: Found an estimated cost of 36 for instruction: %as = sitofp <4 x i8> %a to <4 x bfloat>
+; PACKED: Cost Model: Found an estimated cost of 28 for instruction: %au = uitofp <4 x i8> %a to <4 x bfloat>
; PACKED: Cost Model: Found an estimated cost of 10 for instruction: %bs = sitofp <4 x i12> %b to <4 x bfloat>
; PACKED: Cost Model: Found an estimated cost of 10 for instruction: %bu = uitofp <4 x i12> %b to <4 x bfloat>
-; PACKED: Cost Model: Found an estimated cost of 10 for instruction: %cs = sitofp <4 x i16> %c to <4 x bfloat>
-; PACKED: Cost Model: Found an estimated cost of 10 for instruction: %cu = uitofp <4 x i16> %c to <4 x bfloat>
+; PACKED: Cost Model: Found an estimated cost of 32 for instruction: %cs = sitofp <4 x i16> %c to <4 x bfloat>
+; PACKED: Cost Model: Found an estimated cost of 32 for instruction: %cu = uitofp <4 x i16> %c to <4 x bfloat>
; PACKED: Cost Model: Found an estimated cost of 10 for instruction: %ds = sitofp <4 x i17> %d to <4 x bfloat>
; PACKED: Cost Model: Found an estimated cost of 10 for instruction: %du = uitofp <4 x i17> %d to <4 x bfloat>
; PACKED: Cost Model: Found an estimated cost of 10 for instruction: %es = sitofp <4 x i31> %e to <4 x bfloat>
@@ -88,18 +88,18 @@ define void @narrow_to_bfloat(<4 x i8> %a, <4 x i12> %b, <4 x i16> %c, <4 x i17>
; PACKED: Cost Model: Found an estimated cost of 7 for instruction: %fu = uitofp <3 x i12> %f to <3 x bfloat>
; PACKED: Cost Model: Found an estimated cost of 7 for instruction: %gs = sitofp <3 x i17> %g to <3 x bfloat>
; PACKED: Cost Model: Found an estimated cost of 7 for instruction: %gu = uitofp <3 x i17> %g to <3 x bfloat>
-; PACKED: Cost Model: Found an estimated cost of 4 for instruction: %hs = sitofp <2 x i16> %h to <2 x bfloat>
-; PACKED: Cost Model: Found an estimated cost of 4 for instruction: %hu = uitofp <2 x i16> %h to <2 x bfloat>
-; PACKED: Cost Model: Found an estimated cost of 7 for instruction: %is = sitofp <3 x i32> %i to <3 x bfloat>
-; PACKED: Cost Model: Found an estimated cost of 7 for instruction: %iu = uitofp <3 x i32> %i to <3 x bfloat>
+; PACKED: Cost Model: Found an estimated cost of 16 for instruction: %hs = sitofp <2 x i16> %h to <2 x bfloat>
+; PACKED: Cost Model: Found an estimated cost of 16 for instruction: %hu = uitofp <2 x i16> %h to <2 x bfloat>
+; PACKED: Cost Model: Found an estimated cost of 21 for instruction: %is = sitofp <3 x i32> %i to <3 x bfloat>
+; PACKED: Cost Model: Found an estimated cost of 21 for instruction: %iu = uitofp <3 x i32> %i to <3 x bfloat>
;
; SDWA-BF16-LABEL: 'narrow_to_bfloat'
-; SDWA-BF16: Cost Model: Found an estimated cost of 4 for instruction: %as = sitofp <4 x i8> %a to <4 x bfloat>
-; SDWA-BF16: Cost Model: Found an estimated cost of 4 for instruction: %au = uitofp <4 x i8> %a to <4 x bfloat>
+; SDWA-BF16: Cost Model: Found an estimated cost of 10 for instruction: %as = sitofp <4 x i8> %a to <4 x bfloat>
+; SDWA-BF16: Cost Model: Found an estimated cost of 6 for instruction: %au = uitofp <4 x i8> %a to <4 x bfloat>
; SDWA-BF16: Cost Model: Found an estimated cost of 10 for instruction: %bs = sitofp <4 x i12> %b to <4 x bfloat>
; SDWA-BF16: Cost Model: Found an estimated cost of 10 for instruction: %bu = uitofp <4 x i12> %b to <4 x bfloat>
-; SDWA-BF16: Cost Model: Found an estimated cost of 10 for instruction: %cs = sitofp <4 x i16> %c to <4 x bfloat>
-; SDWA-BF16: Cost Model: Found an estimated cost of 10 for instruction: %cu = uitofp <4 x i16> %c to <4 x bfloat>
+; SDWA-BF16: Cost Model: Found an estimated cost of 6 for instruction: %cs = sitofp <4 x i16> %c to <4 x bfloat>
+; SDWA-BF16: Cost Model: Found an estimated cost of 6 for instruction: %cu = uitofp <4 x i16> %c to <4 x bfloat>
; SDWA-BF16: Cost Model: Found an estimated cost of 10 for instruction: %ds = sitofp <4 x i17> %d to <4 x bfloat>
; SDWA-BF16: Cost Model: Found an estimated cost of 10 for instruction: %du = uitofp <4 x i17> %d to <4 x bfloat>
; SDWA-BF16: Cost Model: Found an estimated cost of 10 for instruction: %es = sitofp <4 x i31> %e to <4 x bfloat>
@@ -108,14 +108,14 @@ define void @narrow_to_bfloat(<4 x i8> %a, <4 x i12> %b, <4 x i16> %c, <4 x i17>
; SDWA-BF16: Cost Model: Found an estimated cost of 7 for instruction: %fu = uitofp <3 x i12> %f to <3 x bfloat>
; SDWA-BF16: Cost Model: Found an estimated cost of 7 for instruction: %gs = sitofp <3 x i17> %g to <3 x bfloat>
; SDWA-BF16: Cost Model: Found an estimated cost of 7 for instruction: %gu = uitofp <3 x i17> %g to <3 x bfloat>
-; SDWA-BF16: Cost Model: Found an estimated cost of 4 for instruction: %hs = sitofp <2 x i16> %h to <2 x bfloat>
-; SDWA-BF16: Cost Model: Found an estimated cost of 4 for instruction: %hu = uitofp <2 x i16> %h to <2 x bfloat>
-; SDWA-BF16: Cost Model: Found an estimated cost of 7 for instruction: %is = sitofp <3 x i32> %i to <3 x bfloat>
-; SDWA-BF16: Cost Model: Found an estimated cost of 7 for instruction: %iu = uitofp <3 x i32> %i to <3 x bfloat>
+; SDWA-BF16: Cost Model: Found an estimated cost of 3 for instruction: %hs = sitofp <2 x i16> %h to <2 x bfloat>
+; SDWA-BF16: Cost Model: Found an estimated cost of 3 for instruction: %hu = uitofp <2 x i16> %h to <2 x bfloat>
+; SDWA-BF16: Cost Model: Found an estimated cost of 5 for instruction: %is = sitofp <3 x i32> %i to <3 x bfloat>
+; SDWA-BF16: Cost Model: Found an estimated cost of 5 for instruction: %iu = uitofp <3 x i32> %i to <3 x bfloat>
;
; PACKED-BF16-LABEL: 'narrow_to_bfloat'
-; PACKED-BF16: Cost Model: Found an estimated cost of 4 for instruction: %as = sitofp <4 x i8> %a to <4 x bfloat>
-; PACKED-BF16: Cost Model: Found an estimated cost of 4 for instruction: %au = uitofp <4 x i8> %a to <4 x bfloat>
+; PACKED-BF16: Cost Model: Found an estimated cost of 14 for instruction: %as = sitofp <4 x i8> %a to <4 x bfloat>
+; PACKED-BF16: Cost Model: Found an estimated cost of 6 for instruction: %au = uitofp <4 x i8> %a to <4 x bfloat>
; PACKED-BF16: Cost Model: Found an estimated cost of 10 for instruction: %bs = sitofp <4 x i12> %b to <4 x bfloat>
; PACKED-BF16: Cost Model: Found an estimated cost of 10 for instruction: %bu = uitofp <4 x i12> %b to <4 x bfloat>
; PACKED-BF16: Cost Model: Found an estimated cost of 10 for instruction: %cs = sitofp <4 x i16> %c to <4 x bfloat>
@@ -128,10 +128,10 @@ define void @narrow_to_bfloat(<4 x i8> %a, <4 x i12> %b, <4 x i16> %c, <4 x i17>
; PACKED-BF16: Cost Model: Found an estimated cost of 7 for instruction: %fu = uitofp <3 x i12> %f to <3 x bfloat>
; PACKED-BF16: Cost Model: Found an estimated cost of 7 for instruction: %gs = sitofp <3 x i17> %g to <3 x bfloat>
; PACKED-BF16: Cost Model: Found an estimated cost of 7 for instruction: %gu = uitofp <3 x i17> %g to <3 x bfloat>
-; PACKED-BF16: Cost Model: Found an estimated cost of 4 for instruction: %hs = sitofp <2 x i16> %h to <2 x bfloat>
-; PACKED-BF16: Cost Model: Found an estimated cost of 4 for instruction: %hu = uitofp <2 x i16> %h to <2 x bfloat>
-; PACKED-BF16: Cost Model: Found an estimated cost of 7 for instruction: %is = sitofp <3 x i32> %i to <3 x bfloat>
-; PACKED-BF16: Cost Model: Found an estimated cost of 7 for instruction: %iu = uitofp <3 x i32> %i to <3 x bfloat>
+; PACKED-BF16: Cost Model: Found an estimated cost of 5 for instruction: %hs = sitofp <2 x i16> %h to <2 x bfloat>
+; PACKED-BF16: Cost Model: Found an estimated cost of 5 for instruction: %hu = uitofp <2 x i16> %h to <2 x bfloat>
+; PACKED-BF16: Cost Model: Found an estimated cost of 5 for instruction: %is = sitofp <3 x i32> %i to <3 x bfloat>
+; PACKED-BF16: Cost Model: Found an estimated cost of 5 for instruction: %iu = uitofp <3 x i32> %i to <3 x bfloat>
;
%as = sitofp <4 x i8> %a to <4 x bfloat>
%au = uitofp <4 x i8> %a to <4 x bfloat>
@@ -156,72 +156,72 @@ define void @narrow_to_bfloat(<4 x i8> %a, <4 x i12> %b, <4 x i16> %c, <4 x i17>
define void @narrow_scalars_to_bfloat(i8 %a, i12 %b, i16 %c, i17 %d, i31 %e) {
; NO16BIT-LABEL: 'narrow_scalars_to_bfloat'
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %as = sitofp i8 %a to bfloat
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %au = uitofp i8 %a to bfloat
+; NO16BIT: Cost Model: Found an estimated cost of 2 for instruction: %as = sitofp i8 %a to bfloat
+; NO16BIT: Cost Model: Found an estimated cost of 2 for instruction: %au = uitofp i8 %a to bfloat
; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %bs = sitofp i12 %b to bfloat
; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %bu = uitofp i12 %b to bfloat
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %cs = sitofp i16 %c to bfloat
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %cu = uitofp i16 %c to bfloat
+; NO16BIT: Cost Model: Found an estimated cost of 2 for instruction: %cs = sitofp i16 %c to bfloat
+; NO16BIT: Cost Model: Found an estimated cost of 2 for instruction: %cu = uitofp i16 %c to bfloat
; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %ds = sitofp i17 %d to bfloat
; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %du = uitofp i17 %d to bfloat
; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %es = sitofp i31 %e to bfloat
; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %eu = uitofp i31 %e to bfloat
;
; NOGFX9-LABEL: 'narrow_scalars_to_bfloat'
-; NOGFX9: Cost Model: Found an estimated cost of 1 for instruction: %as = sitofp i8 %a to bfloat
-; NOGFX9: Cost Model: Found an estimated cost of 1 for instruction: %au = uitofp i8 %a to bfloat
+; NOGFX9: Cost Model: Found an estimated cost of 8 for instruction: %as = sitofp i8 %a to bfloat
+; NOGFX9: Cost Model: Found an estimated cost of 8 for instruction: %au = uitofp i8 %a to bfloat
; NOGFX9: Cost Model: Found an estimated cost of 1 for instruction: %bs = sitofp i12 %b to bfloat
; NOGFX9: Cost Model: Found an estimated cost of 1 for instruction: %bu = uitofp i12 %b to bfloat
-; NOGFX9: Cost Model: Found an estimated cost of 1 for instruction: %cs = sitofp i16 %c to bfloat
-; NOGFX9: Cost Model: Found an estimated cost of 1 for instruction: %cu = uitofp i16 %c to bfloat
+; NOGFX9: Cost Model: Found an estimated cost of 8 for instruction: %cs = sitofp i16 %c to bfloat
+; NOGFX9: Cost Model: Found an estimated cost of 8 for instruction: %cu = uitofp i16 %c to bfloat
; NOGFX9: Cost Model: Found an estimated cost of 1 for instruction: %ds = sitofp i17 %d to bfloat
; NOGFX9: Cost Model: Found an estimated cost of 1 for instruction: %du = uitofp i17 %d to bfloat
; NOGFX9: Cost Model: Found an estimated cost of 1 for instruction: %es = sitofp i31 %e to bfloat
; NOGFX9: Cost Model: Found an estimated cost of 1 for instruction: %eu = uitofp i31 %e to bfloat
;
; SDWA-LABEL: 'narrow_scalars_to_bfloat'
-; SDWA: Cost Model: Found an estimated cost of 1 for instruction: %as = sitofp i8 %a to bfloat
-; SDWA: Cost Model: Found an estimated cost of 1 for instruction: %au = uitofp i8 %a to bfloat
+; SDWA: Cost Model: Found an estimated cost of 7 for instruction: %as = sitofp i8 %a to bfloat
+; SDWA: Cost Model: Found an estimated cost of 7 for instruction: %au = uitofp i8 %a to bfloat
; SDWA: Cost Model: Found an estimated cost of 1 for instruction: %bs = sitofp i12 %b to bfloat
; SDWA: Cost Model: Found an estimated cost of 1 for instruction: %bu = uitofp i12 %b to bfloat
-; SDWA: Cost Model: Found an estimated cost of 1 for instruction: %cs = sitofp i16 %c to bfloat
-; SDWA: Cost Model: Found an estimated cost of 1 for instruction: %cu = uitofp i16 %c to bfloat
+; SDWA: Cost Model: Found an estimated cost of 7 for instruction: %cs = sitofp i16 %c to bfloat
+; SDWA: Cost Model: Found an estimated cost of 7 for instruction: %cu = uitofp i16 %c to bfloat
; SDWA: Cost Model: Found an estimated cost of 1 for instruction: %ds = sitofp i17 %d to bfloat
; SDWA: Cost Model: Found an estimated cost of 1 for instruction: %du = uitofp i17 %d to bfloat
; SDWA: Cost Model: Found an estimated cost of 1 for instruction: %es = sitofp i31 %e to bfloat
; SDWA: Cost Model: Found an estimated cost of 1 for instruction: %eu = uitofp i31 %e to bfloat
;
; PACKED-LABEL: 'narrow_scalars_to_bfloat'
-; PACKED: Cost Model: Found an estimated cost of 1 for instruction: %as = sitofp i8 %a to bfloat
-; PACKED: Cost Model: Found an estimated cost of 1 for instruction: %au = uitofp i8 %a to bfloat
+; PACKED: Cost Model: Found an estimated cost of 7 for instruction: %as = sitofp i8 %a to bfloat
+; PACKED: Cost Model: Found an estimated cost of 7 for instruction: %au = uitofp i8 %a to bfloat
; PACKED: Cost Model: Found an estimated cost of 1 for instruction: %bs = sitofp i12 %b to bfloat
; PACKED: Cost Model: Found an estimated cost of 1 for instruction: %bu = uitofp i12 %b to bfloat
-; PACKED: Cost Model: Found an estimated cost of 1 for instruction: %cs = sitofp i16 %c to bfloat
-; PACKED: Cost Model: Found an estimated cost of 1 for instruction: %cu = uitofp i16 %c to bfloat
+; PACKED: Cost Model: Found an estimated cost of 7 for instruction: %cs = sitofp i16 %c to bfloat
+; PACKED: Cost Model: Found an estimated cost of 7 for instruction: %cu = uitofp i16 %c to bfloat
; PACKED: Cost Model: Found an estimated cost of 1 for instruction: %ds = sitofp i17 %d to bfloat
; PACKED: Cost Model: Found an estimated cost of 1 for instruction: %du = uitofp i17 %d to bfloat
; PACKED: Cost Model: Found an estimated cost of 1 for instruction: %es = sitofp i31 %e to bfloat
; PACKED: Cost Model: Found an estimated cost of 1 for instruction: %eu = uitofp i31 %e to bfloat
;
; SDWA-BF16-LABEL: 'narrow_scalars_to_bfloat'
-; SDWA-BF16: Cost Model: Found an estimated cost of 1 for instruction: %as = sitofp i8 %a to bfloat
-; SDWA-BF16: Cost Model: Found an estimated cost of 1 for instruction: %au = uitofp i8 %a to bfloat
+; SDWA-BF16: Cost Model: Found an estimated cost of 2 for instruction: %as = sitofp i8 %a to bfloat
+; SDWA-BF16: Cost Model: Found an estimated cost of 2 for instruction: %au = uitofp i8 %a to bfloat
; SDWA-BF16: Cost Model: Found an estimated cost of 1 for instruction: %bs = sitofp i12 %b to bfloat
; SDWA-BF16: Cost Model: Found an estimated cost of 1 for instruction: %bu = uitofp i12 %b to bfloat
-; SDWA-BF16: Cost Model: Found an estimated cost of 1 for instruction: %cs = sitofp i16 %c to bfloat
-; SDWA-BF16: Cost Model: Found an estimated cost of 1 for instruction: %cu = uitofp i16 %c to bfloat
+; SDWA-BF16: Cost Model: Found an estimated cost of 2 for instruction: %cs = sitofp i16 %c to bfloat
+; SDWA-BF16: Cost Model: Found an estimated cost of 2 for instruction: %cu = uitofp i16 %c to bfloat
; SDWA-BF16: Cost Model: Found an estimated cost of 1 for instruction: %ds = sitofp i17 %d to bfloat
; SDWA-BF16: Cost Model: Found an estimated cost of 1 for instruction: %du = uitofp i17 %d to bfloat
; SDWA-BF16: Cost Model: Found an estimated cost of 1 for instruction: %es = sitofp i31 %e to bfloat
; SDWA-BF16: Cost Model: Found an estimated cost of 1 for instruction: %eu = uitofp i31 %e to bfloat
;
; PACKED-BF16-LABEL: 'narrow_scalars_to_bfloat'
-; PACKED-BF16: Cost Model: Found an estimated cost of 1 for instruction: %as = sitofp i8 %a to bfloat
-; PACKED-BF16: Cost Model: Found an estimated cost of 1 for instruction: %au = uitofp i8 %a to bfloat
+; PACKED-BF16: Cost Model: Found an estimated cost of 2 for instruction: %as = sitofp i8 %a to bfloat
+; PACKED-BF16: Cost Model: Found an estimated cost of 2 for instruction: %au = uitofp i8 %a to bfloat
; PACKED-BF16: Cost Model: Found an estimated cost of 1 for instruction: %bs = sitofp i12 %b to bfloat
; PACKED-BF16: Cost Model: Found an estimated cost of 1 for instruction: %bu = uitofp i12 %b to bfloat
-; PACKED-BF16: Cost Model: Found an estimated cost of 1 for instruction: %cs = sitofp i16 %c to bfloat
-; PACKED-BF16: Cost Model: Found an estimated cost of 1 for instruction: %cu = uitofp i16 %c to bfloat
+; PACKED-BF16: Cost Model: Found an estimated cost of 2 for instruction: %cs = sitofp i16 %c to bfloat
+; PACKED-BF16: Cost Model: Found an estimated cost of 2 for instruction: %cu = uitofp i16 %c to bfloat
; PACKED-BF16: Cost Model: Found an estimated cost of 1 for instruction: %ds = sitofp i17 %d to bfloat
; PACKED-BF16: Cost Model: Found an estimated cost of 1 for instruction: %du = uitofp i17 %d to bfloat
; PACKED-BF16: Cost Model: Found an estimated cost of 1 for instruction: %es = sitofp i31 %e to bfloat
diff --git a/llvm/test/Analysis/CostModel/AMDGPU/narrow-int-to-fp.ll b/llvm/test/Analysis/CostModel/AMDGPU/narrow-int-to-fp.ll
index 37ae475c9b9c8..d0f34e06abf74 100644
--- a/llvm/test/Analysis/CostModel/AMDGPU/narrow-int-to-fp.ll
+++ b/llvm/test/Analysis/CostModel/AMDGPU/narrow-int-to-fp.ll
@@ -17,94 +17,94 @@
; wider than a byte are zero extended.
define void @narrow_lanes_to_fp(<4 x i8> %a, <4 x i12> %b, <3 x i16> %c, <8 x i16> %d, <8 x i8> %e) {
; NO16BIT-LABEL: 'narrow_lanes_to_fp'
-; NO16BIT: Cost Model: Found an estimated cost of 4 for instruction: %as = sitofp <4 x i8> %a to <4 x half>
+; NO16BIT: Cost Model: Found an estimated cost of 8 for instruction: %as = sitofp <4 x i8> %a to <4 x half>
; NO16BIT: Cost Model: Found an estimated cost of 4 for instruction: %au = uitofp <4 x i8> %a to <4 x half>
-; NO16BIT: Cost Model: Found an estimated cost of 4 for instruction: %bs = sitofp <4 x i12> %b to <4 x half>
-; NO16BIT: Cost Model: Found an estimated cost of 4 for instruction: %bu = uitofp <4 x i12> %b to <4 x half>
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %buf = uitofp <4 x i12> %b to <4 x float>
-; NO16BIT: Cost Model: Found an estimated cost of 4 for instruction: %cu = uitofp <3 x i16> %c to <3 x half>
-; NO16BIT: Cost Model: Found an estimated cost of 8 for instruction: %ds = sitofp <8 x i16> %d to <8 x half>
-; NO16BIT: Cost Model: Found an estimated cost of 8 for instruction: %es = sitofp <8 x i8> %e to <8 x half>
+; NO16BIT: Cost Model: Found an estimated cost of 8 for instruction: %bs = sitofp <4 x i12> %b to <4 x half>
+; NO16BIT: Cost Model: Found an estimated cost of 8 for instruction: %bu = uitofp <4 x i12> %b to <4 x half>
+; NO16BIT: Cost Model: Found an estimated cost of 8 for instruction: %buf = uitofp <4 x i12> %b to <4 x float>
+; NO16BIT: Cost Model: Found an estimated cost of 6 for instruction: %cu = uitofp <3 x i16> %c to <3 x half>
+; NO16BIT: Cost Model: Found an estimated cost of 16 for instruction: %ds = sitofp <8 x i16> %d to <8 x half>
+; NO16BIT: Cost Model: Found an estimated cost of 16 for instruction: %es = sitofp <8 x i8> %e to <8 x half>
;
; SDWA-LABEL: 'narrow_lanes_to_fp'
-; SDWA: Cost Model: Found an estimated cost of 4 for instruction: %as = sitofp <4 x i8> %a to <4 x half>
+; SDWA: Cost Model: Found an estimated cost of 8 for instruction: %as = sitofp <4 x i8> %a to <4 x half>
; SDWA: Cost Model: Found an estimated cost of 4 for instruction: %au = uitofp <4 x i8> %a to <4 x half>
-; SDWA: Cost Model: Found an estimated cost of 10 for instruction: %bs = sitofp <4 x i12> %b to <4 x half>
-; SDWA: Cost Model: Found an estimated cost of 10 for instruction: %bu = uitofp <4 x i12> %b to <4 x half>
-; SDWA: Cost Model: Found an estimated cost of 1 for instruction: %buf = uitofp <4 x i12> %b to <4 x float>
-; SDWA: Cost Model: Found an estimated cost of 7 for instruction: %cu = uitofp <3 x i16> %c to <3 x half>
-; SDWA: Cost Model: Found an estimated cost of 22 for instruction: %ds = sitofp <8 x i16> %d to <8 x half>
-; SDWA: Cost Model: Found an estimated cost of 8 for instruction: %es = sitofp <8 x i8> %e to <8 x half>
+; SDWA: Cost Model: Found an estimated cost of 8 for instruction: %bs = sitofp <4 x i12> %b to <4 x half>
+; SDWA: Cost Model: Found an estimated cost of 8 for instruction: %bu = uitofp <4 x i12> %b to <4 x half>
+; SDWA: Cost Model: Found an estimated cost of 8 for instruction: %buf = uitofp <4 x i12> %b to <4 x float>
+; SDWA: Cost Model: Found an estimated cost of 3 for instruction: %cu = uitofp <3 x i16> %c to <3 x half>
+; SDWA: Cost Model: Found an estimated cost of 8 for instruction: %ds = sitofp <8 x i16> %d to <8 x half>
+; SDWA: Cost Model: Found an estimated cost of 16 for instruction: %es = sitofp <8 x i8> %e to <8 x half>
;
; PACKED-LABEL: 'narrow_lanes_to_fp'
-; PACKED: Cost Model: Found an estimated cost of 4 for instruction: %as = sitofp <4 x i8> %a to <4 x half>
+; PACKED: Cost Model: Found an estimated cost of 12 for instruction: %as = sitofp <4 x i8> %a to <4 x half>
; PACKED: Cost Model: Found an estimated cost of 4 for instruction: %au = uitofp <4 x i8> %a to <4 x half>
-; PACKED: Cost Model: Found an estimated cost of 10 for instruction: %bs = sitofp <4 x i12> %b to <4 x half>
-; PACKED: Cost Model: Found an estimated cost of 10 for instruction: %bu = uitofp <4 x i12> %b to <4 x half>
-; PACKED: Cost Model: Found an estimated cost of 1 for instruction: %buf = uitofp <4 x i12> %b to <4 x float>
-; PACKED: Cost Model: Found an estimated cost of 7 for instruction: %cu = uitofp <3 x i16> %c to <3 x half>
-; PACKED: Cost Model: Found an estimated cost of 22 for instruction: %ds = sitofp <8 x i16> %d to <8 x half>
-; PACKED: Cost Model: Found an estimated cost of 8 for instruction: %es = sitofp <8 x i8> %e to <8 x half>
+; PACKED: Cost Model: Found an estimated cost of 12 for instruction: %bs = sitofp <4 x i12> %b to <4 x half>
+; PACKED: Cost Model: Found an estimated cost of 8 for instruction: %bu = uitofp <4 x i12> %b to <4 x half>
+; PACKED: Cost Model: Found an estimated cost of 8 for instruction: %buf = uitofp <4 x i12> %b to <4 x float>
+; PACKED: Cost Model: Found an estimated cost of 6 for instruction: %cu = uitofp <3 x i16> %c to <3 x half>
+; PACKED: Cost Model: Found an estimated cost of 16 for instruction: %ds = sitofp <8 x i16> %d to <8 x half>
+; PACKED: Cost Model: Found an estimated cost of 24 for instruction: %es = sitofp <8 x i8> %e to <8 x half>
;
; TRUE16-LABEL: 'narrow_lanes_to_fp'
-; TRUE16: Cost Model: Found an estimated cost of 4 for instruction: %as = sitofp <4 x i8> %a to <4 x half>
+; TRUE16: Cost Model: Found an estimated cost of 12 for instruction: %as = sitofp <4 x i8> %a to <4 x half>
; TRUE16: Cost Model: Found an estimated cost of 4 for instruction: %au = uitofp <4 x i8> %a to <4 x half>
-; TRUE16: Cost Model: Found an estimated cost of 10 for instruction: %bs = sitofp <4 x i12> %b to <4 x half>
-; TRUE16: Cost Model: Found an estimated cost of 10 for instruction: %bu = uitofp <4 x i12> %b to <4 x half>
-; TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %buf = uitofp <4 x i12> %b to <4 x float>
-; TRUE16: Cost Model: Found an estimated cost of 7 for instruction: %cu = uitofp <3 x i16> %c to <3 x half>
-; TRUE16: Cost Model: Found an estimated cost of 22 for instruction: %ds = sitofp <8 x i16> %d to <8 x half>
-; TRUE16: Cost Model: Found an estimated cost of 8 for instruction: %es = sitofp <8 x i8> %e to <8 x half>
+; TRUE16: Cost Model: Found an estimated cost of 12 for instruction: %bs = sitofp <4 x i12> %b to <4 x half>
+; TRUE16: Cost Model: Found an estimated cost of 8 for instruction: %bu = uitofp <4 x i12> %b to <4 x half>
+; TRUE16: Cost Model: Found an estimated cost of 8 for instruction: %buf = uitofp <4 x i12> %b to <4 x float>
+; TRUE16: Cost Model: Found an estimated cost of 6 for instruction: %cu = uitofp <3 x i16> %c to <3 x half>
+; TRUE16: Cost Model: Found an estimated cost of 16 for instruction: %ds = sitofp <8 x i16> %d to <8 x half>
+; TRUE16: Cost Model: Found an estimated cost of 24 for instruction: %es = sitofp <8 x i8> %e to <8 x half>
;
; SDWA-CVTPK-LABEL: 'narrow_lanes_to_fp'
-; SDWA-CVTPK: Cost Model: Found an estimated cost of 4 for instruction: %as = sitofp <4 x i8> %a to <4 x half>
+; SDWA-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %as = sitofp <4 x i8> %a to <4 x half>
; SDWA-CVTPK: Cost Model: Found an estimated cost of 4 for instruction: %au = uitofp <4 x i8> %a to <4 x half>
-; SDWA-CVTPK: Cost Model: Found an estimated cost of 10 for instruction: %bs = sitofp <4 x i12> %b to <4 x half>
-; SDWA-CVTPK: Cost Model: Found an estimated cost of 10 for instruction: %bu = uitofp <4 x i12> %b to <4 x half>
-; SDWA-CVTPK: Cost Model: Found an estimated cost of 1 for instruction: %buf = uitofp <4 x i12> %b to <4 x float>
-; SDWA-CVTPK: Cost Model: Found an estimated cost of 7 for instruction: %cu = uitofp <3 x i16> %c to <3 x half>
-; SDWA-CVTPK: Cost Model: Found an estimated cost of 22 for instruction: %ds = sitofp <8 x i16> %d to <8 x half>
-; SDWA-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %es = sitofp <8 x i8> %e to <8 x half>
+; SDWA-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %bs = sitofp <4 x i12> %b to <4 x half>
+; SDWA-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %bu = uitofp <4 x i12> %b to <4 x half>
+; SDWA-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %buf = uitofp <4 x i12> %b to <4 x float>
+; SDWA-CVTPK: Cost Model: Found an estimated cost of 3 for instruction: %cu = uitofp <3 x i16> %c to <3 x half>
+; SDWA-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %ds = sitofp <8 x i16> %d to <8 x half>
+; SDWA-CVTPK: Cost Model: Found an estimated cost of 16 for instruction: %es = sitofp <8 x i8> %e to <8 x half>
;
; PACKED-CVTPK-LABEL: 'narrow_lanes_to_fp'
-; PACKED-CVTPK: Cost Model: Found an estimated cost of 4 for instruction: %as = sitofp <4 x i8> %a to <4 x half>
+; PACKED-CVTPK: Cost Model: Found an estimated cost of 12 for instruction: %as = sitofp <4 x i8> %a to <4 x half>
; PACKED-CVTPK: Cost Model: Found an estimated cost of 4 for instruction: %au = uitofp <4 x i8> %a to <4 x half>
-; PACKED-CVTPK: Cost Model: Found an estimated cost of 10 for instruction: %bs = sitofp <4 x i12> %b to <4 x half>
-; PACKED-CVTPK: Cost Model: Found an estimated cost of 10 for instruction: %bu = uitofp <4 x i12> %b to <4 x half>
-; PACKED-CVTPK: Cost Model: Found an estimated cost of 1 for instruction: %buf = uitofp <4 x i12> %b to <4 x float>
-; PACKED-CVTPK: Cost Model: Found an estimated cost of 7 for instruction: %cu = uitofp <3 x i16> %c to <3 x half>
-; PACKED-CVTPK: Cost Model: Found an estimated cost of 22 for instruction: %ds = sitofp <8 x i16> %d to <8 x half>
-; PACKED-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %es = sitofp <8 x i8> %e to <8 x half>
+; PACKED-CVTPK: Cost Model: Found an estimated cost of 12 for instruction: %bs = sitofp <4 x i12> %b to <4 x half>
+; PACKED-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %bu = uitofp <4 x i12> %b to <4 x half>
+; PACKED-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %buf = uitofp <4 x i12> %b to <4 x float>
+; PACKED-CVTPK: Cost Model: Found an estimated cost of 6 for instruction: %cu = uitofp <3 x i16> %c to <3 x half>
+; PACKED-CVTPK: Cost Model: Found an estimated cost of 16 for instruction: %ds = sitofp <8 x i16> %d to <8 x half>
+; PACKED-CVTPK: Cost Model: Found an estimated cost of 24 for instruction: %es = sitofp <8 x i8> %e to <8 x half>
;
; TRUE16-CVTPK-LABEL: 'narrow_lanes_to_fp'
-; TRUE16-CVTPK: Cost Model: Found an estimated cost of 4 for instruction: %as = sitofp <4 x i8> %a to <4 x half>
+; TRUE16-CVTPK: Cost Model: Found an estimated cost of 12 for instruction: %as = sitofp <4 x i8> %a to <4 x half>
; TRUE16-CVTPK: Cost Model: Found an estimated cost of 4 for instruction: %au = uitofp <4 x i8> %a to <4 x half>
-; TRUE16-CVTPK: Cost Model: Found an estimated cost of 10 for instruction: %bs = sitofp <4 x i12> %b to <4 x half>
-; TRUE16-CVTPK: Cost Model: Found an estimated cost of 10 for instruction: %bu = uitofp <4 x i12> %b to <4 x half>
-; TRUE16-CVTPK: Cost Model: Found an estimated cost of 1 for instruction: %buf = uitofp <4 x i12> %b to <4 x float>
-; TRUE16-CVTPK: Cost Model: Found an estimated cost of 7 for instruction: %cu = uitofp <3 x i16> %c to <3 x half>
-; TRUE16-CVTPK: Cost Model: Found an estimated cost of 22 for instruction: %ds = sitofp <8 x i16> %d to <8 x half>
-; TRUE16-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %es = sitofp <8 x i8> %e to <8 x half>
+; TRUE16-CVTPK: Cost Model: Found an estimated cost of 12 for instruction: %bs = sitofp <4 x i12> %b to <4 x half>
+; TRUE16-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %bu = uitofp <4 x i12> %b to <4 x half>
+; TRUE16-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %buf = uitofp <4 x i12> %b to <4 x float>
+; TRUE16-CVTPK: Cost Model: Found an estimated cost of 6 for instruction: %cu = uitofp <3 x i16> %c to <3 x half>
+; TRUE16-CVTPK: Cost Model: Found an estimated cost of 16 for instruction: %ds = sitofp <8 x i16> %d to <8 x half>
+; TRUE16-CVTPK: Cost Model: Found an estimated cost of 24 for instruction: %es = sitofp <8 x i8> %e to <8 x half>
;
; NO16BIT-SIZE-LABEL: 'narrow_lanes_to_fp'
-; NO16BIT-SIZE: Cost Model: Found an estimated cost of 4 for instruction: %as = sitofp <4 x i8> %a to <4 x half>
+; NO16BIT-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %as = sitofp <4 x i8> %a to <4 x half>
; NO16BIT-SIZE: Cost Model: Found an estimated cost of 4 for instruction: %au = uitofp <4 x i8> %a to <4 x half>
-; NO16BIT-SIZE: Cost Model: Found an estimated cost of 4 for instruction: %bs = sitofp <4 x i12> %b to <4 x half>
-; NO16BIT-SIZE: Cost Model: Found an estimated cost of 4 for instruction: %bu = uitofp <4 x i12> %b to <4 x half>
-; NO16BIT-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %buf = uitofp <4 x i12> %b to <4 x float>
-; NO16BIT-SIZE: Cost Model: Found an estimated cost of 4 for instruction: %cu = uitofp <3 x i16> %c to <3 x half>
-; NO16BIT-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %ds = sitofp <8 x i16> %d to <8 x half>
-; NO16BIT-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %es = sitofp <8 x i8> %e to <8 x half>
+; NO16BIT-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %bs = sitofp <4 x i12> %b to <4 x half>
+; NO16BIT-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %bu = uitofp <4 x i12> %b to <4 x half>
+; NO16BIT-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %buf = uitofp <4 x i12> %b to <4 x float>
+; NO16BIT-SIZE: Cost Model: Found an estimated cost of 6 for instruction: %cu = uitofp <3 x i16> %c to <3 x half>
+; NO16BIT-SIZE: Cost Model: Found an estimated cost of 16 for instruction: %ds = sitofp <8 x i16> %d to <8 x half>
+; NO16BIT-SIZE: Cost Model: Found an estimated cost of 16 for instruction: %es = sitofp <8 x i8> %e to <8 x half>
;
; SDWA-SIZE-LABEL: 'narrow_lanes_to_fp'
-; SDWA-SIZE: Cost Model: Found an estimated cost of 4 for instruction: %as = sitofp <4 x i8> %a to <4 x half>
+; SDWA-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %as = sitofp <4 x i8> %a to <4 x half>
; SDWA-SIZE: Cost Model: Found an estimated cost of 4 for instruction: %au = uitofp <4 x i8> %a to <4 x half>
-; SDWA-SIZE: Cost Model: Found an estimated cost of 10 for instruction: %bs = sitofp <4 x i12> %b to <4 x half>
-; SDWA-SIZE: Cost Model: Found an estimated cost of 10 for instruction: %bu = uitofp <4 x i12> %b to <4 x half>
-; SDWA-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %buf = uitofp <4 x i12> %b to <4 x float>
-; SDWA-SIZE: Cost Model: Found an estimated cost of 7 for instruction: %cu = uitofp <3 x i16> %c to <3 x half>
-; SDWA-SIZE: Cost Model: Found an estimated cost of 22 for instruction: %ds = sitofp <8 x i16> %d to <8 x half>
-; SDWA-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %es = sitofp <8 x i8> %e to <8 x half>
+; SDWA-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %bs = sitofp <4 x i12> %b to <4 x half>
+; SDWA-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %bu = uitofp <4 x i12> %b to <4 x half>
+; SDWA-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %buf = uitofp <4 x i12> %b to <4 x float>
+; SDWA-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %cu = uitofp <3 x i16> %c to <3 x half>
+; SDWA-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %ds = sitofp <8 x i16> %d to <8 x half>
+; SDWA-SIZE: Cost Model: Found an estimated cost of 16 for instruction: %es = sitofp <8 x i8> %e to <8 x half>
;
%as = sitofp <4 x i8> %a to <4 x half>
%au = uitofp <4 x i8> %a to <4 x half>
@@ -119,148 +119,148 @@ define void @narrow_lanes_to_fp(<4 x i8> %a, <4 x i12> %b, <3 x i16> %c, <8 x i1
define void @wide_lanes_to_fp(<4 x i16> %a, <4 x i17> %b, <4 x i31> %c, <3 x i17> %d) {
; NO16BIT-LABEL: 'wide_lanes_to_fp'
-; NO16BIT: Cost Model: Found an estimated cost of 4 for instruction: %asf = sitofp <4 x i16> %a to <4 x float>
-; NO16BIT: Cost Model: Found an estimated cost of 4 for instruction: %auf = uitofp <4 x i16> %a to <4 x float>
-; NO16BIT: Cost Model: Found an estimated cost of 4 for instruction: %ash = sitofp <4 x i16> %a to <4 x half>
-; NO16BIT: Cost Model: Found an estimated cost of 4 for instruction: %auh = uitofp <4 x i16> %a to <4 x half>
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %bsf = sitofp <4 x i17> %b to <4 x float>
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %buf = uitofp <4 x i17> %b to <4 x float>
-; NO16BIT: Cost Model: Found an estimated cost of 4 for instruction: %bsh = sitofp <4 x i17> %b to <4 x half>
-; NO16BIT: Cost Model: Found an estimated cost of 4 for instruction: %buh = uitofp <4 x i17> %b to <4 x half>
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp <4 x i31> %c to <4 x float>
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %cuf = uitofp <4 x i31> %c to <4 x float>
-; NO16BIT: Cost Model: Found an estimated cost of 4 for instruction: %csh = sitofp <4 x i31> %c to <4 x half>
-; NO16BIT: Cost Model: Found an estimated cost of 4 for instruction: %cuh = uitofp <4 x i31> %c to <4 x half>
-; NO16BIT: Cost Model: Found an estimated cost of 9 for instruction: %dsh = sitofp <3 x i17> %d to <3 x half>
-; NO16BIT: Cost Model: Found an estimated cost of 9 for instruction: %duh = uitofp <3 x i17> %d to <3 x half>
+; NO16BIT: Cost Model: Found an estimated cost of 8 for instruction: %asf = sitofp <4 x i16> %a to <4 x float>
+; NO16BIT: Cost Model: Found an estimated cost of 8 for instruction: %auf = uitofp <4 x i16> %a to <4 x float>
+; NO16BIT: Cost Model: Found an estimated cost of 8 for instruction: %ash = sitofp <4 x i16> %a to <4 x half>
+; NO16BIT: Cost Model: Found an estimated cost of 8 for instruction: %auh = uitofp <4 x i16> %a to <4 x half>
+; NO16BIT: Cost Model: Found an estimated cost of 8 for instruction: %bsf = sitofp <4 x i17> %b to <4 x float>
+; NO16BIT: Cost Model: Found an estimated cost of 8 for instruction: %buf = uitofp <4 x i17> %b to <4 x float>
+; NO16BIT: Cost Model: Found an estimated cost of 8 for instruction: %bsh = sitofp <4 x i17> %b to <4 x half>
+; NO16BIT: Cost Model: Found an estimated cost of 8 for instruction: %buh = uitofp <4 x i17> %b to <4 x half>
+; NO16BIT: Cost Model: Found an estimated cost of 8 for instruction: %csf = sitofp <4 x i31> %c to <4 x float>
+; NO16BIT: Cost Model: Found an estimated cost of 8 for instruction: %cuf = uitofp <4 x i31> %c to <4 x float>
+; NO16BIT: Cost Model: Found an estimated cost of 8 for instruction: %csh = sitofp <4 x i31> %c to <4 x half>
+; NO16BIT: Cost Model: Found an estimated cost of 8 for instruction: %cuh = uitofp <4 x i31> %c to <4 x half>
+; NO16BIT: Cost Model: Found an estimated cost of 6 for instruction: %dsh = sitofp <3 x i17> %d to <3 x half>
+; NO16BIT: Cost Model: Found an estimated cost of 6 for instruction: %duh = uitofp <3 x i17> %d to <3 x half>
;
; SDWA-LABEL: 'wide_lanes_to_fp'
-; SDWA: Cost Model: Found an estimated cost of 1 for instruction: %asf = sitofp <4 x i16> %a to <4 x float>
-; SDWA: Cost Model: Found an estimated cost of 1 for instruction: %auf = uitofp <4 x i16> %a to <4 x float>
-; SDWA: Cost Model: Found an estimated cost of 10 for instruction: %ash = sitofp <4 x i16> %a to <4 x half>
-; SDWA: Cost Model: Found an estimated cost of 10 for instruction: %auh = uitofp <4 x i16> %a to <4 x half>
-; SDWA: Cost Model: Found an estimated cost of 1 for instruction: %bsf = sitofp <4 x i17> %b to <4 x float>
-; SDWA: Cost Model: Found an estimated cost of 1 for instruction: %buf = uitofp <4 x i17> %b to <4 x float>
-; SDWA: Cost Model: Found an estimated cost of 10 for instruction: %bsh = sitofp <4 x i17> %b to <4 x half>
-; SDWA: Cost Model: Found an estimated cost of 10 for instruction: %buh = uitofp <4 x i17> %b to <4 x half>
-; SDWA: Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp <4 x i31> %c to <4 x float>
-; SDWA: Cost Model: Found an estimated cost of 1 for instruction: %cuf = uitofp <4 x i31> %c to <4 x float>
-; SDWA: Cost Model: Found an estimated cost of 10 for instruction: %csh = sitofp <4 x i31> %c to <4 x half>
-; SDWA: Cost Model: Found an estimated cost of 10 for instruction: %cuh = uitofp <4 x i31> %c to <4 x half>
-; SDWA: Cost Model: Found an estimated cost of 7 for instruction: %dsh = sitofp <3 x i17> %d to <3 x half>
-; SDWA: Cost Model: Found an estimated cost of 7 for instruction: %duh = uitofp <3 x i17> %d to <3 x half>
+; SDWA: Cost Model: Found an estimated cost of 4 for instruction: %asf = sitofp <4 x i16> %a to <4 x float>
+; SDWA: Cost Model: Found an estimated cost of 4 for instruction: %auf = uitofp <4 x i16> %a to <4 x float>
+; SDWA: Cost Model: Found an estimated cost of 4 for instruction: %ash = sitofp <4 x i16> %a to <4 x half>
+; SDWA: Cost Model: Found an estimated cost of 4 for instruction: %auh = uitofp <4 x i16> %a to <4 x half>
+; SDWA: Cost Model: Found an estimated cost of 4 for instruction: %bsf = sitofp <4 x i17> %b to <4 x float>
+; SDWA: Cost Model: Found an estimated cost of 4 for instruction: %buf = uitofp <4 x i17> %b to <4 x float>
+; SDWA: Cost Model: Found an estimated cost of 4 for instruction: %bsh = sitofp <4 x i17> %b to <4 x half>
+; SDWA: Cost Model: Found an estimated cost of 4 for instruction: %buh = uitofp <4 x i17> %b to <4 x half>
+; SDWA: Cost Model: Found an estimated cost of 4 for instruction: %csf = sitofp <4 x i31> %c to <4 x float>
+; SDWA: Cost Model: Found an estimated cost of 4 for instruction: %cuf = uitofp <4 x i31> %c to <4 x float>
+; SDWA: Cost Model: Found an estimated cost of 4 for instruction: %csh = sitofp <4 x i31> %c to <4 x half>
+; SDWA: Cost Model: Found an estimated cost of 4 for instruction: %cuh = uitofp <4 x i31> %c to <4 x half>
+; SDWA: Cost Model: Found an estimated cost of 3 for instruction: %dsh = sitofp <3 x i17> %d to <3 x half>
+; SDWA: Cost Model: Found an estimated cost of 3 for instruction: %duh = uitofp <3 x i17> %d to <3 x half>
;
; PACKED-LABEL: 'wide_lanes_to_fp'
-; PACKED: Cost Model: Found an estimated cost of 1 for instruction: %asf = sitofp <4 x i16> %a to <4 x float>
-; PACKED: Cost Model: Found an estimated cost of 1 for instruction: %auf = uitofp <4 x i16> %a to <4 x float>
-; PACKED: Cost Model: Found an estimated cost of 10 for instruction: %ash = sitofp <4 x i16> %a to <4 x half>
-; PACKED: Cost Model: Found an estimated cost of 10 for instruction: %auh = uitofp <4 x i16> %a to <4 x half>
-; PACKED: Cost Model: Found an estimated cost of 1 for instruction: %bsf = sitofp <4 x i17> %b to <4 x float>
-; PACKED: Cost Model: Found an estimated cost of 1 for instruction: %buf = uitofp <4 x i17> %b to <4 x float>
-; PACKED: Cost Model: Found an estimated cost of 10 for instruction: %bsh = sitofp <4 x i17> %b to <4 x half>
-; PACKED: Cost Model: Found an estimated cost of 10 for instruction: %buh = uitofp <4 x i17> %b to <4 x half>
-; PACKED: Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp <4 x i31> %c to <4 x float>
-; PACKED: Cost Model: Found an estimated cost of 1 for instruction: %cuf = uitofp <4 x i31> %c to <4 x float>
-; PACKED: Cost Model: Found an estimated cost of 10 for instruction: %csh = sitofp <4 x i31> %c to <4 x half>
-; PACKED: Cost Model: Found an estimated cost of 10 for instruction: %cuh = uitofp <4 x i31> %c to <4 x half>
-; PACKED: Cost Model: Found an estimated cost of 7 for instruction: %dsh = sitofp <3 x i17> %d to <3 x half>
-; PACKED: Cost Model: Found an estimated cost of 7 for instruction: %duh = uitofp <3 x i17> %d to <3 x half>
+; PACKED: Cost Model: Found an estimated cost of 8 for instruction: %asf = sitofp <4 x i16> %a to <4 x float>
+; PACKED: Cost Model: Found an estimated cost of 8 for instruction: %auf = uitofp <4 x i16> %a to <4 x float>
+; PACKED: Cost Model: Found an estimated cost of 8 for instruction: %ash = sitofp <4 x i16> %a to <4 x half>
+; PACKED: Cost Model: Found an estimated cost of 8 for instruction: %auh = uitofp <4 x i16> %a to <4 x half>
+; PACKED: Cost Model: Found an estimated cost of 8 for instruction: %bsf = sitofp <4 x i17> %b to <4 x float>
+; PACKED: Cost Model: Found an estimated cost of 8 for instruction: %buf = uitofp <4 x i17> %b to <4 x float>
+; PACKED: Cost Model: Found an estimated cost of 8 for instruction: %bsh = sitofp <4 x i17> %b to <4 x half>
+; PACKED: Cost Model: Found an estimated cost of 8 for instruction: %buh = uitofp <4 x i17> %b to <4 x half>
+; PACKED: Cost Model: Found an estimated cost of 8 for instruction: %csf = sitofp <4 x i31> %c to <4 x float>
+; PACKED: Cost Model: Found an estimated cost of 8 for instruction: %cuf = uitofp <4 x i31> %c to <4 x float>
+; PACKED: Cost Model: Found an estimated cost of 8 for instruction: %csh = sitofp <4 x i31> %c to <4 x half>
+; PACKED: Cost Model: Found an estimated cost of 8 for instruction: %cuh = uitofp <4 x i31> %c to <4 x half>
+; PACKED: Cost Model: Found an estimated cost of 6 for instruction: %dsh = sitofp <3 x i17> %d to <3 x half>
+; PACKED: Cost Model: Found an estimated cost of 6 for instruction: %duh = uitofp <3 x i17> %d to <3 x half>
;
; TRUE16-LABEL: 'wide_lanes_to_fp'
-; TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %asf = sitofp <4 x i16> %a to <4 x float>
-; TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %auf = uitofp <4 x i16> %a to <4 x float>
-; TRUE16: Cost Model: Found an estimated cost of 10 for instruction: %ash = sitofp <4 x i16> %a to <4 x half>
-; TRUE16: Cost Model: Found an estimated cost of 10 for instruction: %auh = uitofp <4 x i16> %a to <4 x half>
-; TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %bsf = sitofp <4 x i17> %b to <4 x float>
-; TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %buf = uitofp <4 x i17> %b to <4 x float>
-; TRUE16: Cost Model: Found an estimated cost of 10 for instruction: %bsh = sitofp <4 x i17> %b to <4 x half>
-; TRUE16: Cost Model: Found an estimated cost of 10 for instruction: %buh = uitofp <4 x i17> %b to <4 x half>
-; TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp <4 x i31> %c to <4 x float>
-; TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %cuf = uitofp <4 x i31> %c to <4 x float>
-; TRUE16: Cost Model: Found an estimated cost of 10 for instruction: %csh = sitofp <4 x i31> %c to <4 x half>
-; TRUE16: Cost Model: Found an estimated cost of 10 for instruction: %cuh = uitofp <4 x i31> %c to <4 x half>
-; TRUE16: Cost Model: Found an estimated cost of 7 for instruction: %dsh = sitofp <3 x i17> %d to <3 x half>
-; TRUE16: Cost Model: Found an estimated cost of 7 for instruction: %duh = uitofp <3 x i17> %d to <3 x half>
+; TRUE16: Cost Model: Found an estimated cost of 8 for instruction: %asf = sitofp <4 x i16> %a to <4 x float>
+; TRUE16: Cost Model: Found an estimated cost of 8 for instruction: %auf = uitofp <4 x i16> %a to <4 x float>
+; TRUE16: Cost Model: Found an estimated cost of 8 for instruction: %ash = sitofp <4 x i16> %a to <4 x half>
+; TRUE16: Cost Model: Found an estimated cost of 8 for instruction: %auh = uitofp <4 x i16> %a to <4 x half>
+; TRUE16: Cost Model: Found an estimated cost of 8 for instruction: %bsf = sitofp <4 x i17> %b to <4 x float>
+; TRUE16: Cost Model: Found an estimated cost of 8 for instruction: %buf = uitofp <4 x i17> %b to <4 x float>
+; TRUE16: Cost Model: Found an estimated cost of 8 for instruction: %bsh = sitofp <4 x i17> %b to <4 x half>
+; TRUE16: Cost Model: Found an estimated cost of 8 for instruction: %buh = uitofp <4 x i17> %b to <4 x half>
+; TRUE16: Cost Model: Found an estimated cost of 8 for instruction: %csf = sitofp <4 x i31> %c to <4 x float>
+; TRUE16: Cost Model: Found an estimated cost of 8 for instruction: %cuf = uitofp <4 x i31> %c to <4 x float>
+; TRUE16: Cost Model: Found an estimated cost of 8 for instruction: %csh = sitofp <4 x i31> %c to <4 x half>
+; TRUE16: Cost Model: Found an estimated cost of 8 for instruction: %cuh = uitofp <4 x i31> %c to <4 x half>
+; TRUE16: Cost Model: Found an estimated cost of 6 for instruction: %dsh = sitofp <3 x i17> %d to <3 x half>
+; TRUE16: Cost Model: Found an estimated cost of 6 for instruction: %duh = uitofp <3 x i17> %d to <3 x half>
;
; SDWA-CVTPK-LABEL: 'wide_lanes_to_fp'
-; SDWA-CVTPK: Cost Model: Found an estimated cost of 1 for instruction: %asf = sitofp <4 x i16> %a to <4 x float>
-; SDWA-CVTPK: Cost Model: Found an estimated cost of 1 for instruction: %auf = uitofp <4 x i16> %a to <4 x float>
-; SDWA-CVTPK: Cost Model: Found an estimated cost of 10 for instruction: %ash = sitofp <4 x i16> %a to <4 x half>
-; SDWA-CVTPK: Cost Model: Found an estimated cost of 10 for instruction: %auh = uitofp <4 x i16> %a to <4 x half>
-; SDWA-CVTPK: Cost Model: Found an estimated cost of 1 for instruction: %bsf = sitofp <4 x i17> %b to <4 x float>
-; SDWA-CVTPK: Cost Model: Found an estimated cost of 1 for instruction: %buf = uitofp <4 x i17> %b to <4 x float>
-; SDWA-CVTPK: Cost Model: Found an estimated cost of 10 for instruction: %bsh = sitofp <4 x i17> %b to <4 x half>
-; SDWA-CVTPK: Cost Model: Found an estimated cost of 10 for instruction: %buh = uitofp <4 x i17> %b to <4 x half>
-; SDWA-CVTPK: Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp <4 x i31> %c to <4 x float>
-; SDWA-CVTPK: Cost Model: Found an estimated cost of 1 for instruction: %cuf = uitofp <4 x i31> %c to <4 x float>
-; SDWA-CVTPK: Cost Model: Found an estimated cost of 10 for instruction: %csh = sitofp <4 x i31> %c to <4 x half>
-; SDWA-CVTPK: Cost Model: Found an estimated cost of 10 for instruction: %cuh = uitofp <4 x i31> %c to <4 x half>
-; SDWA-CVTPK: Cost Model: Found an estimated cost of 7 for instruction: %dsh = sitofp <3 x i17> %d to <3 x half>
-; SDWA-CVTPK: Cost Model: Found an estimated cost of 7 for instruction: %duh = uitofp <3 x i17> %d to <3 x half>
+; SDWA-CVTPK: Cost Model: Found an estimated cost of 4 for instruction: %asf = sitofp <4 x i16> %a to <4 x float>
+; SDWA-CVTPK: Cost Model: Found an estimated cost of 4 for instruction: %auf = uitofp <4 x i16> %a to <4 x float>
+; SDWA-CVTPK: Cost Model: Found an estimated cost of 4 for instruction: %ash = sitofp <4 x i16> %a to <4 x half>
+; SDWA-CVTPK: Cost Model: Found an estimated cost of 4 for instruction: %auh = uitofp <4 x i16> %a to <4 x half>
+; SDWA-CVTPK: Cost Model: Found an estimated cost of 4 for instruction: %bsf = sitofp <4 x i17> %b to <4 x float>
+; SDWA-CVTPK: Cost Model: Found an estimated cost of 4 for instruction: %buf = uitofp <4 x i17> %b to <4 x float>
+; SDWA-CVTPK: Cost Model: Found an estimated cost of 4 for instruction: %bsh = sitofp <4 x i17> %b to <4 x half>
+; SDWA-CVTPK: Cost Model: Found an estimated cost of 4 for instruction: %buh = uitofp <4 x i17> %b to <4 x half>
+; SDWA-CVTPK: Cost Model: Found an estimated cost of 4 for instruction: %csf = sitofp <4 x i31> %c to <4 x float>
+; SDWA-CVTPK: Cost Model: Found an estimated cost of 4 for instruction: %cuf = uitofp <4 x i31> %c to <4 x float>
+; SDWA-CVTPK: Cost Model: Found an estimated cost of 4 for instruction: %csh = sitofp <4 x i31> %c to <4 x half>
+; SDWA-CVTPK: Cost Model: Found an estimated cost of 4 for instruction: %cuh = uitofp <4 x i31> %c to <4 x half>
+; SDWA-CVTPK: Cost Model: Found an estimated cost of 3 for instruction: %dsh = sitofp <3 x i17> %d to <3 x half>
+; SDWA-CVTPK: Cost Model: Found an estimated cost of 3 for instruction: %duh = uitofp <3 x i17> %d to <3 x half>
;
; PACKED-CVTPK-LABEL: 'wide_lanes_to_fp'
-; PACKED-CVTPK: Cost Model: Found an estimated cost of 1 for instruction: %asf = sitofp <4 x i16> %a to <4 x float>
-; PACKED-CVTPK: Cost Model: Found an estimated cost of 1 for instruction: %auf = uitofp <4 x i16> %a to <4 x float>
-; PACKED-CVTPK: Cost Model: Found an estimated cost of 10 for instruction: %ash = sitofp <4 x i16> %a to <4 x half>
-; PACKED-CVTPK: Cost Model: Found an estimated cost of 10 for instruction: %auh = uitofp <4 x i16> %a to <4 x half>
-; PACKED-CVTPK: Cost Model: Found an estimated cost of 1 for instruction: %bsf = sitofp <4 x i17> %b to <4 x float>
-; PACKED-CVTPK: Cost Model: Found an estimated cost of 1 for instruction: %buf = uitofp <4 x i17> %b to <4 x float>
-; PACKED-CVTPK: Cost Model: Found an estimated cost of 10 for instruction: %bsh = sitofp <4 x i17> %b to <4 x half>
-; PACKED-CVTPK: Cost Model: Found an estimated cost of 10 for instruction: %buh = uitofp <4 x i17> %b to <4 x half>
-; PACKED-CVTPK: Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp <4 x i31> %c to <4 x float>
-; PACKED-CVTPK: Cost Model: Found an estimated cost of 1 for instruction: %cuf = uitofp <4 x i31> %c to <4 x float>
-; PACKED-CVTPK: Cost Model: Found an estimated cost of 10 for instruction: %csh = sitofp <4 x i31> %c to <4 x half>
-; PACKED-CVTPK: Cost Model: Found an estimated cost of 10 for instruction: %cuh = uitofp <4 x i31> %c to <4 x half>
-; PACKED-CVTPK: Cost Model: Found an estimated cost of 7 for instruction: %dsh = sitofp <3 x i17> %d to <3 x half>
-; PACKED-CVTPK: Cost Model: Found an estimated cost of 7 for instruction: %duh = uitofp <3 x i17> %d to <3 x half>
+; PACKED-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %asf = sitofp <4 x i16> %a to <4 x float>
+; PACKED-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %auf = uitofp <4 x i16> %a to <4 x float>
+; PACKED-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %ash = sitofp <4 x i16> %a to <4 x half>
+; PACKED-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %auh = uitofp <4 x i16> %a to <4 x half>
+; PACKED-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %bsf = sitofp <4 x i17> %b to <4 x float>
+; PACKED-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %buf = uitofp <4 x i17> %b to <4 x float>
+; PACKED-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %bsh = sitofp <4 x i17> %b to <4 x half>
+; PACKED-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %buh = uitofp <4 x i17> %b to <4 x half>
+; PACKED-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %csf = sitofp <4 x i31> %c to <4 x float>
+; PACKED-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %cuf = uitofp <4 x i31> %c to <4 x float>
+; PACKED-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %csh = sitofp <4 x i31> %c to <4 x half>
+; PACKED-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %cuh = uitofp <4 x i31> %c to <4 x half>
+; PACKED-CVTPK: Cost Model: Found an estimated cost of 6 for instruction: %dsh = sitofp <3 x i17> %d to <3 x half>
+; PACKED-CVTPK: Cost Model: Found an estimated cost of 6 for instruction: %duh = uitofp <3 x i17> %d to <3 x half>
;
; TRUE16-CVTPK-LABEL: 'wide_lanes_to_fp'
-; TRUE16-CVTPK: Cost Model: Found an estimated cost of 1 for instruction: %asf = sitofp <4 x i16> %a to <4 x float>
-; TRUE16-CVTPK: Cost Model: Found an estimated cost of 1 for instruction: %auf = uitofp <4 x i16> %a to <4 x float>
-; TRUE16-CVTPK: Cost Model: Found an estimated cost of 10 for instruction: %ash = sitofp <4 x i16> %a to <4 x half>
-; TRUE16-CVTPK: Cost Model: Found an estimated cost of 10 for instruction: %auh = uitofp <4 x i16> %a to <4 x half>
-; TRUE16-CVTPK: Cost Model: Found an estimated cost of 1 for instruction: %bsf = sitofp <4 x i17> %b to <4 x float>
-; TRUE16-CVTPK: Cost Model: Found an estimated cost of 1 for instruction: %buf = uitofp <4 x i17> %b to <4 x float>
-; TRUE16-CVTPK: Cost Model: Found an estimated cost of 10 for instruction: %bsh = sitofp <4 x i17> %b to <4 x half>
-; TRUE16-CVTPK: Cost Model: Found an estimated cost of 10 for instruction: %buh = uitofp <4 x i17> %b to <4 x half>
-; TRUE16-CVTPK: Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp <4 x i31> %c to <4 x float>
-; TRUE16-CVTPK: Cost Model: Found an estimated cost of 1 for instruction: %cuf = uitofp <4 x i31> %c to <4 x float>
-; TRUE16-CVTPK: Cost Model: Found an estimated cost of 10 for instruction: %csh = sitofp <4 x i31> %c to <4 x half>
-; TRUE16-CVTPK: Cost Model: Found an estimated cost of 10 for instruction: %cuh = uitofp <4 x i31> %c to <4 x half>
-; TRUE16-CVTPK: Cost Model: Found an estimated cost of 7 for instruction: %dsh = sitofp <3 x i17> %d to <3 x half>
-; TRUE16-CVTPK: Cost Model: Found an estimated cost of 7 for instruction: %duh = uitofp <3 x i17> %d to <3 x half>
+; TRUE16-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %asf = sitofp <4 x i16> %a to <4 x float>
+; TRUE16-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %auf = uitofp <4 x i16> %a to <4 x float>
+; TRUE16-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %ash = sitofp <4 x i16> %a to <4 x half>
+; TRUE16-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %auh = uitofp <4 x i16> %a to <4 x half>
+; TRUE16-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %bsf = sitofp <4 x i17> %b to <4 x float>
+; TRUE16-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %buf = uitofp <4 x i17> %b to <4 x float>
+; TRUE16-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %bsh = sitofp <4 x i17> %b to <4 x half>
+; TRUE16-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %buh = uitofp <4 x i17> %b to <4 x half>
+; TRUE16-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %csf = sitofp <4 x i31> %c to <4 x float>
+; TRUE16-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %cuf = uitofp <4 x i31> %c to <4 x float>
+; TRUE16-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %csh = sitofp <4 x i31> %c to <4 x half>
+; TRUE16-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %cuh = uitofp <4 x i31> %c to <4 x half>
+; TRUE16-CVTPK: Cost Model: Found an estimated cost of 6 for instruction: %dsh = sitofp <3 x i17> %d to <3 x half>
+; TRUE16-CVTPK: Cost Model: Found an estimated cost of 6 for instruction: %duh = uitofp <3 x i17> %d to <3 x half>
;
; NO16BIT-SIZE-LABEL: 'wide_lanes_to_fp'
-; NO16BIT-SIZE: Cost Model: Found an estimated cost of 4 for instruction: %asf = sitofp <4 x i16> %a to <4 x float>
-; NO16BIT-SIZE: Cost Model: Found an estimated cost of 4 for instruction: %auf = uitofp <4 x i16> %a to <4 x float>
-; NO16BIT-SIZE: Cost Model: Found an estimated cost of 4 for instruction: %ash = sitofp <4 x i16> %a to <4 x half>
-; NO16BIT-SIZE: Cost Model: Found an estimated cost of 4 for instruction: %auh = uitofp <4 x i16> %a to <4 x half>
-; NO16BIT-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %bsf = sitofp <4 x i17> %b to <4 x float>
-; NO16BIT-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %buf = uitofp <4 x i17> %b to <4 x float>
-; NO16BIT-SIZE: Cost Model: Found an estimated cost of 4 for instruction: %bsh = sitofp <4 x i17> %b to <4 x half>
-; NO16BIT-SIZE: Cost Model: Found an estimated cost of 4 for instruction: %buh = uitofp <4 x i17> %b to <4 x half>
-; NO16BIT-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp <4 x i31> %c to <4 x float>
-; NO16BIT-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %cuf = uitofp <4 x i31> %c to <4 x float>
-; NO16BIT-SIZE: Cost Model: Found an estimated cost of 4 for instruction: %csh = sitofp <4 x i31> %c to <4 x half>
-; NO16BIT-SIZE: Cost Model: Found an estimated cost of 4 for instruction: %cuh = uitofp <4 x i31> %c to <4 x half>
-; NO16BIT-SIZE: Cost Model: Found an estimated cost of 9 for instruction: %dsh = sitofp <3 x i17> %d to <3 x half>
-; NO16BIT-SIZE: Cost Model: Found an estimated cost of 9 for instruction: %duh = uitofp <3 x i17> %d to <3 x half>
+; NO16BIT-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %asf = sitofp <4 x i16> %a to <4 x float>
+; NO16BIT-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %auf = uitofp <4 x i16> %a to <4 x float>
+; NO16BIT-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %ash = sitofp <4 x i16> %a to <4 x half>
+; NO16BIT-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %auh = uitofp <4 x i16> %a to <4 x half>
+; NO16BIT-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %bsf = sitofp <4 x i17> %b to <4 x float>
+; NO16BIT-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %buf = uitofp <4 x i17> %b to <4 x float>
+; NO16BIT-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %bsh = sitofp <4 x i17> %b to <4 x half>
+; NO16BIT-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %buh = uitofp <4 x i17> %b to <4 x half>
+; NO16BIT-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %csf = sitofp <4 x i31> %c to <4 x float>
+; NO16BIT-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %cuf = uitofp <4 x i31> %c to <4 x float>
+; NO16BIT-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %csh = sitofp <4 x i31> %c to <4 x half>
+; NO16BIT-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %cuh = uitofp <4 x i31> %c to <4 x half>
+; NO16BIT-SIZE: Cost Model: Found an estimated cost of 6 for instruction: %dsh = sitofp <3 x i17> %d to <3 x half>
+; NO16BIT-SIZE: Cost Model: Found an estimated cost of 6 for instruction: %duh = uitofp <3 x i17> %d to <3 x half>
;
; SDWA-SIZE-LABEL: 'wide_lanes_to_fp'
-; SDWA-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %asf = sitofp <4 x i16> %a to <4 x float>
-; SDWA-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %auf = uitofp <4 x i16> %a to <4 x float>
-; SDWA-SIZE: Cost Model: Found an estimated cost of 10 for instruction: %ash = sitofp <4 x i16> %a to <4 x half>
-; SDWA-SIZE: Cost Model: Found an estimated cost of 10 for instruction: %auh = uitofp <4 x i16> %a to <4 x half>
-; SDWA-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %bsf = sitofp <4 x i17> %b to <4 x float>
-; SDWA-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %buf = uitofp <4 x i17> %b to <4 x float>
-; SDWA-SIZE: Cost Model: Found an estimated cost of 10 for instruction: %bsh = sitofp <4 x i17> %b to <4 x half>
-; SDWA-SIZE: Cost Model: Found an estimated cost of 10 for instruction: %buh = uitofp <4 x i17> %b to <4 x half>
-; SDWA-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp <4 x i31> %c to <4 x float>
-; SDWA-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %cuf = uitofp <4 x i31> %c to <4 x float>
-; SDWA-SIZE: Cost Model: Found an estimated cost of 10 for instruction: %csh = sitofp <4 x i31> %c to <4 x half>
-; SDWA-SIZE: Cost Model: Found an estimated cost of 10 for instruction: %cuh = uitofp <4 x i31> %c to <4 x half>
-; SDWA-SIZE: Cost Model: Found an estimated cost of 7 for instruction: %dsh = sitofp <3 x i17> %d to <3 x half>
-; SDWA-SIZE: Cost Model: Found an estimated cost of 7 for instruction: %duh = uitofp <3 x i17> %d to <3 x half>
+; SDWA-SIZE: Cost Model: Found an estimated cost of 4 for instruction: %asf = sitofp <4 x i16> %a to <4 x float>
+; SDWA-SIZE: Cost Model: Found an estimated cost of 4 for instruction: %auf = uitofp <4 x i16> %a to <4 x float>
+; SDWA-SIZE: Cost Model: Found an estimated cost of 4 for instruction: %ash = sitofp <4 x i16> %a to <4 x half>
+; SDWA-SIZE: Cost Model: Found an estimated cost of 4 for instruction: %auh = uitofp <4 x i16> %a to <4 x half>
+; SDWA-SIZE: Cost Model: Found an estimated cost of 4 for instruction: %bsf = sitofp <4 x i17> %b to <4 x float>
+; SDWA-SIZE: Cost Model: Found an estimated cost of 4 for instruction: %buf = uitofp <4 x i17> %b to <4 x float>
+; SDWA-SIZE: Cost Model: Found an estimated cost of 4 for instruction: %bsh = sitofp <4 x i17> %b to <4 x half>
+; SDWA-SIZE: Cost Model: Found an estimated cost of 4 for instruction: %buh = uitofp <4 x i17> %b to <4 x half>
+; SDWA-SIZE: Cost Model: Found an estimated cost of 4 for instruction: %csf = sitofp <4 x i31> %c to <4 x float>
+; SDWA-SIZE: Cost Model: Found an estimated cost of 4 for instruction: %cuf = uitofp <4 x i31> %c to <4 x float>
+; SDWA-SIZE: Cost Model: Found an estimated cost of 4 for instruction: %csh = sitofp <4 x i31> %c to <4 x half>
+; SDWA-SIZE: Cost Model: Found an estimated cost of 4 for instruction: %cuh = uitofp <4 x i31> %c to <4 x half>
+; SDWA-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %dsh = sitofp <3 x i17> %d to <3 x half>
+; SDWA-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %duh = uitofp <3 x i17> %d to <3 x half>
;
%asf = sitofp <4 x i16> %a to <4 x float>
%auf = uitofp <4 x i16> %a to <4 x float>
>From 3f9108f2c2f9ac629130e5f9f445deeb1f3a2562 Mon Sep 17 00:00:00 2001
From: Dmitry Sidorov <Dmitry.Sidorov at amd.com>
Date: Mon, 21 Sep 2026 00:35:46 +0200
Subject: [PATCH 2/2] fix 16-bit conv
---
.../AMDGPU/AMDGPUTargetTransformInfo.cpp | 44 ++-
.../CostModel/AMDGPU/expanded-int-fp-casts.ll | 100 ++++---
llvm/test/Analysis/CostModel/AMDGPU/fptosi.ll | 44 ++-
llvm/test/Analysis/CostModel/AMDGPU/fptoui.ll | 44 ++-
.../CostModel/AMDGPU/narrow-int-to-fp.ll | 254 +++++++++---------
5 files changed, 297 insertions(+), 189 deletions(-)
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
index c75ac82162bec..911124e60864c 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
@@ -1098,12 +1098,45 @@ InstructionCost GCNTTIImpl::getCastInstrCost(unsigned Opcode, Type *Dst,
if (SrcBits >= 8 && SrcBits < 32 && isa<FixedVectorType>(Src)) {
if (FPTy->isDoubleTy())
return Scale(1 + (SrcBits < 16 && IsSigned && ST->has16BitInsts()), 1);
+ if (FPTy->isHalfTy()) {
+ const InstructionCost PairCost =
+ InstructionCost(NElts / 2) * getFullRateInstrCost();
+ // Lanes wider than 16 bits, and every lane without 16 bit instructions,
+ // are converted to f32 first. With the packed conversion each pair is
+ // then converted at once. Otherwise each lane is converted, and without
+ // real true16 each pair of halves is packed.
+ if (!ST->has16BitInsts() || SrcBits > 16) {
+ auto *FloatTy =
+ FixedVectorType::get(Type::getFloatTy(Dst->getContext()), NElts);
+ const InstructionCost FloatCost =
+ getCastInstrCost(Opcode, FloatTy, Src, CCH, CostKind);
+ if (ST->has16BitInsts() && ST->hasCvtPkF16F32Inst())
+ return FloatCost + InstructionCost(divideCeil(NElts, 2)) *
+ getFullRateInstrCost();
+ const unsigned PackOps =
+ !ST->has16BitInsts() ? 2 : !ST->useRealTrue16Insts();
+ return FloatCost + Scale(1) + PackOps * PairCost;
+ }
+ // Each lane is converted from a 16 bit subword. Lanes narrower than 16
+ // bits are extended lane by lane, except bytes with SDWA. Signed bytes
+ // are sign extended a pair at a time. Real true16 reads the high
+ // subword in place, so only signed lanes narrower than 16 bits pay per
+ // pair. Otherwise wider lanes shift the high subword of each pair down
+ // without SDWA, and each pair of halves is packed.
+ const unsigned PerElt =
+ 1 + (SrcBits == 8 ? !ST->hasSDWA() : SrcBits < 16);
+ const bool RealTrue16 = ST->useRealTrue16Insts();
+ const unsigned PerPair =
+ !RealTrue16 + (SrcBits == 8 || RealTrue16 ? SrcBits < 16 && IsSigned
+ : !ST->hasSDWA());
+ return Scale(PerElt) + PerPair * PairCost;
+ }
// 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;
+ unsigned PerElt = ST->hasSDWA() && SrcBits <= 16 ? 1 : 2;
if (SrcBits < 16 && ST->has16BitInsts())
++PerElt;
return Scale(PerElt);
@@ -1120,12 +1153,17 @@ InstructionCost GCNTTIImpl::getCastInstrCost(unsigned Opcode, Type *Dst,
// rounding sequence has seven, plus integer operations and constants.
return ST->haveRoundOpsF64() ? Scale(1, 6) : Scale(22, 7);
}
+ // The f32 expansion has one fma, which is quarter rate without fast FMA.
+ const InstructionCost SlowFMACost =
+ ST->hasFastFMAF32() ? 0
+ : NElts * (getQuarterRateInstrCost(CostKind) -
+ getFullRateInstrCost());
if (FPTy->isFloatTy())
- return Scale(IsSigned64 ? 13 : 6);
+ return Scale(IsSigned64 ? 13 : 6) + SlowFMACost;
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(1 + (IsSigned64 ? 13 : 6)) + SlowFMACost;
}
return Scale(3);
}
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 7d6125c02d1f8..96a35687eb13e 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,46 @@
; 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,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>" -disable-output -mtriple=amdgpu6.01-amd-amdhsa < %s 2>&1 | FileCheck %s --check-prefixes=ALL,SLOW-FMA,GFX6,GFX6-THROUGHPUT
+; RUN: opt -passes="print<cost-model>" -disable-output -mtriple=amdgpu7.00-amd-amdhsa < %s 2>&1 | FileCheck %s --check-prefixes=ALL,SLOW-FMA,GFX6,GFX7
+; RUN: opt -passes="print<cost-model>" -disable-output -mtriple=amdgpu8.03-amd-amdhsa < %s 2>&1 | FileCheck %s --check-prefixes=ALL,SLOW-FMA,GFX9-THROUGHPUT,GFX8
+; RUN: opt -passes="print<cost-model>" -disable-output -mtriple=amdgpu9.00-amd-amdhsa < %s 2>&1 | FileCheck %s --check-prefixes=ALL,FAST-FMA,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,FAST-FMA,GFX9-THROUGHPUT,GFX8
+; RUN: opt -passes="print<cost-model>" -disable-output -mtriple=amdgpu9.06-amd-amdhsa < %s 2>&1 | FileCheck %s --check-prefixes=ALL,FAST-FMA,HALF,GFX9
+; RUN: opt -passes="print<cost-model>" -disable-output -mtriple=amdgpu9.42-amd-amdhsa < %s 2>&1 | FileCheck %s --check-prefixes=ALL,FAST-FMA,FULL,GFX9
+; RUN: opt -passes="print<cost-model>" -disable-output -mtriple=amdgpu9.50-amd-amdhsa < %s 2>&1 | FileCheck %s --check-prefixes=ALL,FAST-FMA,FULL,NATIVE-SDWA
+; RUN: opt -passes="print<cost-model>" -disable-output -mtriple=amdgpu11.00-amd-amdhsa < %s 2>&1 | FileCheck %s --check-prefixes=ALL,FAST-FMA,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,FAST-FMA,GFX6,GFX7
+; RUN: opt -passes="print<cost-model>" -disable-output -mtriple=amdgpu12.50-amd-amdhsa < %s 2>&1 | FileCheck %s --check-prefixes=ALL,FAST-FMA,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
+; 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,FAST-FMA,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,FAST-FMA,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,FAST-FMA,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,FAST-FMA,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 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
+; SLOW-FMA-LABEL: 'bf16_to_i64'
+; SLOW-FMA: Cost Model: Found an estimated cost of 17 for instruction: %s = fptosi bfloat %a to i64
+; SLOW-FMA: Cost Model: Found an estimated cost of 10 for instruction: %u = fptoui bfloat %a to i64
+; SLOW-FMA: Cost Model: Found an estimated cost of 34 for instruction: %vs = fptosi <2 x bfloat> %b to <2 x i64>
+; SLOW-FMA: Cost Model: Found an estimated cost of 20 for instruction: %vu = fptoui <2 x bfloat> %b to <2 x i64>
+; SLOW-FMA: Cost Model: Found an estimated cost of 3 for instruction: %hs = fptosi half %h to i64
+; SLOW-FMA: Cost Model: Found an estimated cost of 3 for instruction: %hu = fptoui half %h to i64
+;
+; FAST-FMA-LABEL: 'bf16_to_i64'
+; FAST-FMA: Cost Model: Found an estimated cost of 14 for instruction: %s = fptosi bfloat %a to i64
+; FAST-FMA: Cost Model: Found an estimated cost of 7 for instruction: %u = fptoui bfloat %a to i64
+; FAST-FMA: Cost Model: Found an estimated cost of 28 for instruction: %vs = fptosi <2 x bfloat> %b to <2 x i64>
+; FAST-FMA: Cost Model: Found an estimated cost of 14 for instruction: %vu = fptoui <2 x bfloat> %b to <2 x i64>
+; FAST-FMA: Cost Model: Found an estimated cost of 3 for instruction: %hs = fptosi half %h to i64
+; FAST-FMA: Cost Model: Found an estimated cost of 3 for instruction: %hu = fptoui half %h to i64
+;
+; GFX6-SIZE-LABEL: 'bf16_to_i64'
+; GFX6-SIZE: Cost Model: Found an estimated cost of 15 for instruction: %s = fptosi bfloat %a to i64
+; GFX6-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %u = fptoui bfloat %a to i64
+; GFX6-SIZE: Cost Model: Found an estimated cost of 30 for instruction: %vs = fptosi <2 x bfloat> %b to <2 x i64>
+; GFX6-SIZE: Cost Model: Found an estimated cost of 16 for instruction: %vu = fptoui <2 x bfloat> %b to <2 x i64>
+; GFX6-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %hs = fptosi half %h to i64
+; GFX6-SIZE: 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
@@ -206,15 +222,35 @@ 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, <2 x float> %d, <2 x bfloat> %e) {
-; ALL-LABEL: '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>
+; SLOW-FMA-LABEL: 'i48'
+; SLOW-FMA: Cost Model: Found an estimated cost of 14 for instruction: %s = sitofp i48 %a to float
+; SLOW-FMA: Cost Model: Found an estimated cost of 9 for instruction: %u = uitofp i48 %a to float
+; SLOW-FMA: Cost Model: Found an estimated cost of 16 for instruction: %rs = fptosi float %b to i48
+; SLOW-FMA: Cost Model: Found an estimated cost of 16 for instruction: %ru = fptoui float %b to i48
+; SLOW-FMA: Cost Model: Found an estimated cost of 17 for instruction: %bu = fptoui bfloat %c to i48
+; SLOW-FMA: Cost Model: Found an estimated cost of 32 for instruction: %vrs = fptosi <2 x float> %d to <2 x i48>
+; SLOW-FMA: Cost Model: Found an estimated cost of 18 for instruction: %vru = fptoui <2 x float> %d to <2 x i48>
+; SLOW-FMA: Cost Model: Found an estimated cost of 20 for instruction: %vbu = fptoui <2 x bfloat> %e to <2 x i48>
+;
+; FAST-FMA-LABEL: 'i48'
+; FAST-FMA: Cost Model: Found an estimated cost of 14 for instruction: %s = sitofp i48 %a to float
+; FAST-FMA: Cost Model: Found an estimated cost of 9 for instruction: %u = uitofp i48 %a to float
+; FAST-FMA: Cost Model: Found an estimated cost of 13 for instruction: %rs = fptosi float %b to i48
+; FAST-FMA: Cost Model: Found an estimated cost of 13 for instruction: %ru = fptoui float %b to i48
+; FAST-FMA: Cost Model: Found an estimated cost of 14 for instruction: %bu = fptoui bfloat %c to i48
+; FAST-FMA: Cost Model: Found an estimated cost of 26 for instruction: %vrs = fptosi <2 x float> %d to <2 x i48>
+; FAST-FMA: Cost Model: Found an estimated cost of 12 for instruction: %vru = fptoui <2 x float> %d to <2 x i48>
+; FAST-FMA: Cost Model: Found an estimated cost of 14 for instruction: %vbu = fptoui <2 x bfloat> %e to <2 x i48>
+;
+; GFX6-SIZE-LABEL: 'i48'
+; GFX6-SIZE: Cost Model: Found an estimated cost of 14 for instruction: %s = sitofp i48 %a to float
+; GFX6-SIZE: Cost Model: Found an estimated cost of 9 for instruction: %u = uitofp i48 %a to float
+; GFX6-SIZE: Cost Model: Found an estimated cost of 14 for instruction: %rs = fptosi float %b to i48
+; GFX6-SIZE: Cost Model: Found an estimated cost of 14 for instruction: %ru = fptoui float %b to i48
+; GFX6-SIZE: Cost Model: Found an estimated cost of 15 for instruction: %bu = fptoui bfloat %c to i48
+; GFX6-SIZE: Cost Model: Found an estimated cost of 28 for instruction: %vrs = fptosi <2 x float> %d to <2 x i48>
+; GFX6-SIZE: Cost Model: Found an estimated cost of 14 for instruction: %vru = fptoui <2 x float> %d to <2 x i48>
+; GFX6-SIZE: Cost Model: Found an estimated cost of 16 for instruction: %vbu = fptoui <2 x bfloat> %e to <2 x i48>
;
%s = sitofp i48 %a to float
%u = uitofp i48 %a to float
@@ -299,3 +335,5 @@ define void @other_widths(i128 %a, double %b, <2 x i128> %c, <2 x double> %d, fp
%rqu = uitofp i64 %f to fp128
ret void
}
+;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
+; ALL: {{.*}}
diff --git a/llvm/test/Analysis/CostModel/AMDGPU/fptosi.ll b/llvm/test/Analysis/CostModel/AMDGPU/fptosi.ll
index c03cce72bb1f3..f766457e94072 100644
--- a/llvm/test/Analysis/CostModel/AMDGPU/fptosi.ll
+++ b/llvm/test/Analysis/CostModel/AMDGPU/fptosi.ll
@@ -155,21 +155,37 @@ 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 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
+; FAST-LABEL: 'fptosi_float_i64'
+; FAST-NEXT: Cost Model: Found an estimated cost of 13 for instruction: %I64 = fptosi float poison to i64
+; FAST-NEXT: Cost Model: Found an estimated cost of 26 for instruction: %V2I64 = fptosi <2 x float> poison to <2 x i64>
+; FAST-NEXT: Cost Model: Found an estimated cost of 52 for instruction: %V4I64 = fptosi <4 x float> poison to <4 x i64>
+; FAST-NEXT: Cost Model: Found an estimated cost of 104 for instruction: %V8I64 = fptosi <8 x float> poison to <8 x i64>
+; FAST-NEXT: Cost Model: Found an estimated cost of 208 for instruction: %V16I64 = fptosi <16 x float> poison to <16 x i64>
+; FAST-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 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
+; SLOW-LABEL: 'fptosi_float_i64'
+; SLOW-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %I64 = fptosi float poison to i64
+; SLOW-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %V2I64 = fptosi <2 x float> poison to <2 x i64>
+; SLOW-NEXT: Cost Model: Found an estimated cost of 64 for instruction: %V4I64 = fptosi <4 x float> poison to <4 x i64>
+; SLOW-NEXT: Cost Model: Found an estimated cost of 128 for instruction: %V8I64 = fptosi <8 x float> poison to <8 x i64>
+; SLOW-NEXT: Cost Model: Found an estimated cost of 256 for instruction: %V16I64 = fptosi <16 x float> poison to <16 x i64>
+; SLOW-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret i32 poison
+;
+; FAST-SIZE-LABEL: 'fptosi_float_i64'
+; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 13 for instruction: %I64 = fptosi float poison to i64
+; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 26 for instruction: %V2I64 = fptosi <2 x float> poison to <2 x i64>
+; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 52 for instruction: %V4I64 = fptosi <4 x float> poison to <4 x i64>
+; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 104 for instruction: %V8I64 = fptosi <8 x float> poison to <8 x i64>
+; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 208 for instruction: %V16I64 = fptosi <16 x float> poison to <16 x i64>
+; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 poison
+;
+; SLOW-SIZE-LABEL: 'fptosi_float_i64'
+; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %I64 = fptosi float poison to i64
+; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 28 for instruction: %V2I64 = fptosi <2 x float> poison to <2 x i64>
+; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 56 for instruction: %V4I64 = fptosi <4 x float> poison to <4 x i64>
+; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 112 for instruction: %V8I64 = fptosi <8 x float> poison to <8 x i64>
+; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 224 for instruction: %V16I64 = fptosi <16 x float> poison to <16 x i64>
+; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 poison
;
%I64 = fptosi float poison to i64
%V2I64 = fptosi <2 x float> poison to <2 x i64>
diff --git a/llvm/test/Analysis/CostModel/AMDGPU/fptoui.ll b/llvm/test/Analysis/CostModel/AMDGPU/fptoui.ll
index af945583383cd..8cc1f216efe11 100644
--- a/llvm/test/Analysis/CostModel/AMDGPU/fptoui.ll
+++ b/llvm/test/Analysis/CostModel/AMDGPU/fptoui.ll
@@ -155,21 +155,37 @@ 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 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
+; FAST-LABEL: 'fptoui_float_i64'
+; FAST-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %I64 = fptoui float poison to i64
+; FAST-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %V2I64 = fptoui <2 x float> poison to <2 x i64>
+; FAST-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %V4I64 = fptoui <4 x float> poison to <4 x i64>
+; FAST-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %V8I64 = fptoui <8 x float> poison to <8 x i64>
+; FAST-NEXT: Cost Model: Found an estimated cost of 96 for instruction: %V16I64 = fptoui <16 x float> poison to <16 x i64>
+; FAST-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 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
+; SLOW-LABEL: 'fptoui_float_i64'
+; SLOW-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %I64 = fptoui float poison to i64
+; SLOW-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %V2I64 = fptoui <2 x float> poison to <2 x i64>
+; SLOW-NEXT: Cost Model: Found an estimated cost of 36 for instruction: %V4I64 = fptoui <4 x float> poison to <4 x i64>
+; SLOW-NEXT: Cost Model: Found an estimated cost of 72 for instruction: %V8I64 = fptoui <8 x float> poison to <8 x i64>
+; SLOW-NEXT: Cost Model: Found an estimated cost of 144 for instruction: %V16I64 = fptoui <16 x float> poison to <16 x i64>
+; SLOW-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret i32 poison
+;
+; FAST-SIZE-LABEL: 'fptoui_float_i64'
+; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %I64 = fptoui float poison to i64
+; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %V2I64 = fptoui <2 x float> poison to <2 x i64>
+; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %V4I64 = fptoui <4 x float> poison to <4 x i64>
+; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %V8I64 = fptoui <8 x float> poison to <8 x i64>
+; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 96 for instruction: %V16I64 = fptoui <16 x float> poison to <16 x i64>
+; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 poison
+;
+; SLOW-SIZE-LABEL: 'fptoui_float_i64'
+; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %I64 = fptoui float poison to i64
+; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %V2I64 = fptoui <2 x float> poison to <2 x i64>
+; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 28 for instruction: %V4I64 = fptoui <4 x float> poison to <4 x i64>
+; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 56 for instruction: %V8I64 = fptoui <8 x float> poison to <8 x i64>
+; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 112 for instruction: %V16I64 = fptoui <16 x float> poison to <16 x i64>
+; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 poison
;
%I64 = fptoui float poison to i64
%V2I64 = fptoui <2 x float> poison to <2 x i64>
diff --git a/llvm/test/Analysis/CostModel/AMDGPU/narrow-int-to-fp.ll b/llvm/test/Analysis/CostModel/AMDGPU/narrow-int-to-fp.ll
index d0f34e06abf74..728775d97cc2d 100644
--- a/llvm/test/Analysis/CostModel/AMDGPU/narrow-int-to-fp.ll
+++ b/llvm/test/Analysis/CostModel/AMDGPU/narrow-int-to-fp.ll
@@ -17,93 +17,93 @@
; wider than a byte are zero extended.
define void @narrow_lanes_to_fp(<4 x i8> %a, <4 x i12> %b, <3 x i16> %c, <8 x i16> %d, <8 x i8> %e) {
; NO16BIT-LABEL: 'narrow_lanes_to_fp'
-; NO16BIT: Cost Model: Found an estimated cost of 8 for instruction: %as = sitofp <4 x i8> %a to <4 x half>
-; NO16BIT: Cost Model: Found an estimated cost of 4 for instruction: %au = uitofp <4 x i8> %a to <4 x half>
-; NO16BIT: Cost Model: Found an estimated cost of 8 for instruction: %bs = sitofp <4 x i12> %b to <4 x half>
-; NO16BIT: Cost Model: Found an estimated cost of 8 for instruction: %bu = uitofp <4 x i12> %b to <4 x half>
+; NO16BIT: Cost Model: Found an estimated cost of 16 for instruction: %as = sitofp <4 x i8> %a to <4 x half>
+; NO16BIT: Cost Model: Found an estimated cost of 12 for instruction: %au = uitofp <4 x i8> %a to <4 x half>
+; NO16BIT: Cost Model: Found an estimated cost of 16 for instruction: %bs = sitofp <4 x i12> %b to <4 x half>
+; NO16BIT: Cost Model: Found an estimated cost of 16 for instruction: %bu = uitofp <4 x i12> %b to <4 x half>
; NO16BIT: Cost Model: Found an estimated cost of 8 for instruction: %buf = uitofp <4 x i12> %b to <4 x float>
-; NO16BIT: Cost Model: Found an estimated cost of 6 for instruction: %cu = uitofp <3 x i16> %c to <3 x half>
-; NO16BIT: Cost Model: Found an estimated cost of 16 for instruction: %ds = sitofp <8 x i16> %d to <8 x half>
-; NO16BIT: Cost Model: Found an estimated cost of 16 for instruction: %es = sitofp <8 x i8> %e to <8 x half>
+; NO16BIT: Cost Model: Found an estimated cost of 11 for instruction: %cu = uitofp <3 x i16> %c to <3 x half>
+; NO16BIT: Cost Model: Found an estimated cost of 32 for instruction: %ds = sitofp <8 x i16> %d to <8 x half>
+; NO16BIT: Cost Model: Found an estimated cost of 32 for instruction: %es = sitofp <8 x i8> %e to <8 x half>
;
; SDWA-LABEL: 'narrow_lanes_to_fp'
; SDWA: Cost Model: Found an estimated cost of 8 for instruction: %as = sitofp <4 x i8> %a to <4 x half>
-; SDWA: Cost Model: Found an estimated cost of 4 for instruction: %au = uitofp <4 x i8> %a to <4 x half>
-; SDWA: Cost Model: Found an estimated cost of 8 for instruction: %bs = sitofp <4 x i12> %b to <4 x half>
-; SDWA: Cost Model: Found an estimated cost of 8 for instruction: %bu = uitofp <4 x i12> %b to <4 x half>
+; SDWA: Cost Model: Found an estimated cost of 6 for instruction: %au = uitofp <4 x i8> %a to <4 x half>
+; SDWA: Cost Model: Found an estimated cost of 10 for instruction: %bs = sitofp <4 x i12> %b to <4 x half>
+; SDWA: Cost Model: Found an estimated cost of 10 for instruction: %bu = uitofp <4 x i12> %b to <4 x half>
; SDWA: Cost Model: Found an estimated cost of 8 for instruction: %buf = uitofp <4 x i12> %b to <4 x float>
-; SDWA: Cost Model: Found an estimated cost of 3 for instruction: %cu = uitofp <3 x i16> %c to <3 x half>
-; SDWA: Cost Model: Found an estimated cost of 8 for instruction: %ds = sitofp <8 x i16> %d to <8 x half>
+; SDWA: Cost Model: Found an estimated cost of 4 for instruction: %cu = uitofp <3 x i16> %c to <3 x half>
+; SDWA: Cost Model: Found an estimated cost of 12 for instruction: %ds = sitofp <8 x i16> %d to <8 x half>
; SDWA: Cost Model: Found an estimated cost of 16 for instruction: %es = sitofp <8 x i8> %e to <8 x half>
;
; PACKED-LABEL: 'narrow_lanes_to_fp'
; PACKED: Cost Model: Found an estimated cost of 12 for instruction: %as = sitofp <4 x i8> %a to <4 x half>
-; PACKED: Cost Model: Found an estimated cost of 4 for instruction: %au = uitofp <4 x i8> %a to <4 x half>
+; PACKED: Cost Model: Found an estimated cost of 10 for instruction: %au = uitofp <4 x i8> %a to <4 x half>
; PACKED: Cost Model: Found an estimated cost of 12 for instruction: %bs = sitofp <4 x i12> %b to <4 x half>
-; PACKED: Cost Model: Found an estimated cost of 8 for instruction: %bu = uitofp <4 x i12> %b to <4 x half>
+; PACKED: Cost Model: Found an estimated cost of 12 for instruction: %bu = uitofp <4 x i12> %b to <4 x half>
; PACKED: Cost Model: Found an estimated cost of 8 for instruction: %buf = uitofp <4 x i12> %b to <4 x float>
-; PACKED: Cost Model: Found an estimated cost of 6 for instruction: %cu = uitofp <3 x i16> %c to <3 x half>
+; PACKED: Cost Model: Found an estimated cost of 5 for instruction: %cu = uitofp <3 x i16> %c to <3 x half>
; PACKED: Cost Model: Found an estimated cost of 16 for instruction: %ds = sitofp <8 x i16> %d to <8 x half>
; PACKED: Cost Model: Found an estimated cost of 24 for instruction: %es = sitofp <8 x i8> %e to <8 x half>
;
; TRUE16-LABEL: 'narrow_lanes_to_fp'
-; TRUE16: Cost Model: Found an estimated cost of 12 for instruction: %as = sitofp <4 x i8> %a to <4 x half>
-; TRUE16: Cost Model: Found an estimated cost of 4 for instruction: %au = uitofp <4 x i8> %a to <4 x half>
-; TRUE16: Cost Model: Found an estimated cost of 12 for instruction: %bs = sitofp <4 x i12> %b to <4 x half>
+; TRUE16: Cost Model: Found an estimated cost of 10 for instruction: %as = sitofp <4 x i8> %a to <4 x half>
+; TRUE16: Cost Model: Found an estimated cost of 8 for instruction: %au = uitofp <4 x i8> %a to <4 x half>
+; TRUE16: Cost Model: Found an estimated cost of 10 for instruction: %bs = sitofp <4 x i12> %b to <4 x half>
; TRUE16: Cost Model: Found an estimated cost of 8 for instruction: %bu = uitofp <4 x i12> %b to <4 x half>
; TRUE16: Cost Model: Found an estimated cost of 8 for instruction: %buf = uitofp <4 x i12> %b to <4 x float>
-; TRUE16: Cost Model: Found an estimated cost of 6 for instruction: %cu = uitofp <3 x i16> %c to <3 x half>
-; TRUE16: Cost Model: Found an estimated cost of 16 for instruction: %ds = sitofp <8 x i16> %d to <8 x half>
-; TRUE16: Cost Model: Found an estimated cost of 24 for instruction: %es = sitofp <8 x i8> %e to <8 x half>
+; TRUE16: Cost Model: Found an estimated cost of 3 for instruction: %cu = uitofp <3 x i16> %c to <3 x half>
+; TRUE16: Cost Model: Found an estimated cost of 8 for instruction: %ds = sitofp <8 x i16> %d to <8 x half>
+; TRUE16: Cost Model: Found an estimated cost of 20 for instruction: %es = sitofp <8 x i8> %e to <8 x half>
;
; SDWA-CVTPK-LABEL: 'narrow_lanes_to_fp'
; SDWA-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %as = sitofp <4 x i8> %a to <4 x half>
-; SDWA-CVTPK: Cost Model: Found an estimated cost of 4 for instruction: %au = uitofp <4 x i8> %a to <4 x half>
-; SDWA-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %bs = sitofp <4 x i12> %b to <4 x half>
-; SDWA-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %bu = uitofp <4 x i12> %b to <4 x half>
+; SDWA-CVTPK: Cost Model: Found an estimated cost of 6 for instruction: %au = uitofp <4 x i8> %a to <4 x half>
+; SDWA-CVTPK: Cost Model: Found an estimated cost of 10 for instruction: %bs = sitofp <4 x i12> %b to <4 x half>
+; SDWA-CVTPK: Cost Model: Found an estimated cost of 10 for instruction: %bu = uitofp <4 x i12> %b to <4 x half>
; SDWA-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %buf = uitofp <4 x i12> %b to <4 x float>
-; SDWA-CVTPK: Cost Model: Found an estimated cost of 3 for instruction: %cu = uitofp <3 x i16> %c to <3 x half>
-; SDWA-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %ds = sitofp <8 x i16> %d to <8 x half>
+; SDWA-CVTPK: Cost Model: Found an estimated cost of 4 for instruction: %cu = uitofp <3 x i16> %c to <3 x half>
+; SDWA-CVTPK: Cost Model: Found an estimated cost of 12 for instruction: %ds = sitofp <8 x i16> %d to <8 x half>
; SDWA-CVTPK: Cost Model: Found an estimated cost of 16 for instruction: %es = sitofp <8 x i8> %e to <8 x half>
;
; PACKED-CVTPK-LABEL: 'narrow_lanes_to_fp'
; PACKED-CVTPK: Cost Model: Found an estimated cost of 12 for instruction: %as = sitofp <4 x i8> %a to <4 x half>
-; PACKED-CVTPK: Cost Model: Found an estimated cost of 4 for instruction: %au = uitofp <4 x i8> %a to <4 x half>
+; PACKED-CVTPK: Cost Model: Found an estimated cost of 10 for instruction: %au = uitofp <4 x i8> %a to <4 x half>
; PACKED-CVTPK: Cost Model: Found an estimated cost of 12 for instruction: %bs = sitofp <4 x i12> %b to <4 x half>
-; PACKED-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %bu = uitofp <4 x i12> %b to <4 x half>
+; PACKED-CVTPK: Cost Model: Found an estimated cost of 12 for instruction: %bu = uitofp <4 x i12> %b to <4 x half>
; PACKED-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %buf = uitofp <4 x i12> %b to <4 x float>
-; PACKED-CVTPK: Cost Model: Found an estimated cost of 6 for instruction: %cu = uitofp <3 x i16> %c to <3 x half>
+; PACKED-CVTPK: Cost Model: Found an estimated cost of 5 for instruction: %cu = uitofp <3 x i16> %c to <3 x half>
; PACKED-CVTPK: Cost Model: Found an estimated cost of 16 for instruction: %ds = sitofp <8 x i16> %d to <8 x half>
; PACKED-CVTPK: Cost Model: Found an estimated cost of 24 for instruction: %es = sitofp <8 x i8> %e to <8 x half>
;
; TRUE16-CVTPK-LABEL: 'narrow_lanes_to_fp'
-; TRUE16-CVTPK: Cost Model: Found an estimated cost of 12 for instruction: %as = sitofp <4 x i8> %a to <4 x half>
-; TRUE16-CVTPK: Cost Model: Found an estimated cost of 4 for instruction: %au = uitofp <4 x i8> %a to <4 x half>
-; TRUE16-CVTPK: Cost Model: Found an estimated cost of 12 for instruction: %bs = sitofp <4 x i12> %b to <4 x half>
+; TRUE16-CVTPK: Cost Model: Found an estimated cost of 10 for instruction: %as = sitofp <4 x i8> %a to <4 x half>
+; TRUE16-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %au = uitofp <4 x i8> %a to <4 x half>
+; TRUE16-CVTPK: Cost Model: Found an estimated cost of 10 for instruction: %bs = sitofp <4 x i12> %b to <4 x half>
; TRUE16-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %bu = uitofp <4 x i12> %b to <4 x half>
; TRUE16-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %buf = uitofp <4 x i12> %b to <4 x float>
-; TRUE16-CVTPK: Cost Model: Found an estimated cost of 6 for instruction: %cu = uitofp <3 x i16> %c to <3 x half>
-; TRUE16-CVTPK: Cost Model: Found an estimated cost of 16 for instruction: %ds = sitofp <8 x i16> %d to <8 x half>
-; TRUE16-CVTPK: Cost Model: Found an estimated cost of 24 for instruction: %es = sitofp <8 x i8> %e to <8 x half>
+; TRUE16-CVTPK: Cost Model: Found an estimated cost of 3 for instruction: %cu = uitofp <3 x i16> %c to <3 x half>
+; TRUE16-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %ds = sitofp <8 x i16> %d to <8 x half>
+; TRUE16-CVTPK: Cost Model: Found an estimated cost of 20 for instruction: %es = sitofp <8 x i8> %e to <8 x half>
;
; NO16BIT-SIZE-LABEL: 'narrow_lanes_to_fp'
-; NO16BIT-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %as = sitofp <4 x i8> %a to <4 x half>
-; NO16BIT-SIZE: Cost Model: Found an estimated cost of 4 for instruction: %au = uitofp <4 x i8> %a to <4 x half>
-; NO16BIT-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %bs = sitofp <4 x i12> %b to <4 x half>
-; NO16BIT-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %bu = uitofp <4 x i12> %b to <4 x half>
+; NO16BIT-SIZE: Cost Model: Found an estimated cost of 16 for instruction: %as = sitofp <4 x i8> %a to <4 x half>
+; NO16BIT-SIZE: Cost Model: Found an estimated cost of 12 for instruction: %au = uitofp <4 x i8> %a to <4 x half>
+; NO16BIT-SIZE: Cost Model: Found an estimated cost of 16 for instruction: %bs = sitofp <4 x i12> %b to <4 x half>
+; NO16BIT-SIZE: Cost Model: Found an estimated cost of 16 for instruction: %bu = uitofp <4 x i12> %b to <4 x half>
; NO16BIT-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %buf = uitofp <4 x i12> %b to <4 x float>
-; NO16BIT-SIZE: Cost Model: Found an estimated cost of 6 for instruction: %cu = uitofp <3 x i16> %c to <3 x half>
-; NO16BIT-SIZE: Cost Model: Found an estimated cost of 16 for instruction: %ds = sitofp <8 x i16> %d to <8 x half>
-; NO16BIT-SIZE: Cost Model: Found an estimated cost of 16 for instruction: %es = sitofp <8 x i8> %e to <8 x half>
+; NO16BIT-SIZE: Cost Model: Found an estimated cost of 11 for instruction: %cu = uitofp <3 x i16> %c to <3 x half>
+; NO16BIT-SIZE: Cost Model: Found an estimated cost of 32 for instruction: %ds = sitofp <8 x i16> %d to <8 x half>
+; NO16BIT-SIZE: Cost Model: Found an estimated cost of 32 for instruction: %es = sitofp <8 x i8> %e to <8 x half>
;
; SDWA-SIZE-LABEL: 'narrow_lanes_to_fp'
; SDWA-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %as = sitofp <4 x i8> %a to <4 x half>
-; SDWA-SIZE: Cost Model: Found an estimated cost of 4 for instruction: %au = uitofp <4 x i8> %a to <4 x half>
-; SDWA-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %bs = sitofp <4 x i12> %b to <4 x half>
-; SDWA-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %bu = uitofp <4 x i12> %b to <4 x half>
+; SDWA-SIZE: Cost Model: Found an estimated cost of 6 for instruction: %au = uitofp <4 x i8> %a to <4 x half>
+; SDWA-SIZE: Cost Model: Found an estimated cost of 10 for instruction: %bs = sitofp <4 x i12> %b to <4 x half>
+; SDWA-SIZE: Cost Model: Found an estimated cost of 10 for instruction: %bu = uitofp <4 x i12> %b to <4 x half>
; SDWA-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %buf = uitofp <4 x i12> %b to <4 x float>
-; SDWA-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %cu = uitofp <3 x i16> %c to <3 x half>
-; SDWA-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %ds = sitofp <8 x i16> %d to <8 x half>
+; SDWA-SIZE: Cost Model: Found an estimated cost of 4 for instruction: %cu = uitofp <3 x i16> %c to <3 x half>
+; SDWA-SIZE: Cost Model: Found an estimated cost of 12 for instruction: %ds = sitofp <8 x i16> %d to <8 x half>
; SDWA-SIZE: Cost Model: Found an estimated cost of 16 for instruction: %es = sitofp <8 x i8> %e to <8 x half>
;
%as = sitofp <4 x i8> %a to <4 x half>
@@ -121,34 +121,34 @@ define void @wide_lanes_to_fp(<4 x i16> %a, <4 x i17> %b, <4 x i31> %c, <3 x i17
; NO16BIT-LABEL: 'wide_lanes_to_fp'
; NO16BIT: Cost Model: Found an estimated cost of 8 for instruction: %asf = sitofp <4 x i16> %a to <4 x float>
; NO16BIT: Cost Model: Found an estimated cost of 8 for instruction: %auf = uitofp <4 x i16> %a to <4 x float>
-; NO16BIT: Cost Model: Found an estimated cost of 8 for instruction: %ash = sitofp <4 x i16> %a to <4 x half>
-; NO16BIT: Cost Model: Found an estimated cost of 8 for instruction: %auh = uitofp <4 x i16> %a to <4 x half>
+; NO16BIT: Cost Model: Found an estimated cost of 16 for instruction: %ash = sitofp <4 x i16> %a to <4 x half>
+; NO16BIT: Cost Model: Found an estimated cost of 16 for instruction: %auh = uitofp <4 x i16> %a to <4 x half>
; NO16BIT: Cost Model: Found an estimated cost of 8 for instruction: %bsf = sitofp <4 x i17> %b to <4 x float>
; NO16BIT: Cost Model: Found an estimated cost of 8 for instruction: %buf = uitofp <4 x i17> %b to <4 x float>
-; NO16BIT: Cost Model: Found an estimated cost of 8 for instruction: %bsh = sitofp <4 x i17> %b to <4 x half>
-; NO16BIT: Cost Model: Found an estimated cost of 8 for instruction: %buh = uitofp <4 x i17> %b to <4 x half>
+; NO16BIT: Cost Model: Found an estimated cost of 16 for instruction: %bsh = sitofp <4 x i17> %b to <4 x half>
+; NO16BIT: Cost Model: Found an estimated cost of 16 for instruction: %buh = uitofp <4 x i17> %b to <4 x half>
; NO16BIT: Cost Model: Found an estimated cost of 8 for instruction: %csf = sitofp <4 x i31> %c to <4 x float>
; NO16BIT: Cost Model: Found an estimated cost of 8 for instruction: %cuf = uitofp <4 x i31> %c to <4 x float>
-; NO16BIT: Cost Model: Found an estimated cost of 8 for instruction: %csh = sitofp <4 x i31> %c to <4 x half>
-; NO16BIT: Cost Model: Found an estimated cost of 8 for instruction: %cuh = uitofp <4 x i31> %c to <4 x half>
-; NO16BIT: Cost Model: Found an estimated cost of 6 for instruction: %dsh = sitofp <3 x i17> %d to <3 x half>
-; NO16BIT: Cost Model: Found an estimated cost of 6 for instruction: %duh = uitofp <3 x i17> %d to <3 x half>
+; NO16BIT: Cost Model: Found an estimated cost of 16 for instruction: %csh = sitofp <4 x i31> %c to <4 x half>
+; NO16BIT: Cost Model: Found an estimated cost of 16 for instruction: %cuh = uitofp <4 x i31> %c to <4 x half>
+; NO16BIT: Cost Model: Found an estimated cost of 11 for instruction: %dsh = sitofp <3 x i17> %d to <3 x half>
+; NO16BIT: Cost Model: Found an estimated cost of 11 for instruction: %duh = uitofp <3 x i17> %d to <3 x half>
;
; SDWA-LABEL: 'wide_lanes_to_fp'
; SDWA: Cost Model: Found an estimated cost of 4 for instruction: %asf = sitofp <4 x i16> %a to <4 x float>
; SDWA: Cost Model: Found an estimated cost of 4 for instruction: %auf = uitofp <4 x i16> %a to <4 x float>
-; SDWA: Cost Model: Found an estimated cost of 4 for instruction: %ash = sitofp <4 x i16> %a to <4 x half>
-; SDWA: Cost Model: Found an estimated cost of 4 for instruction: %auh = uitofp <4 x i16> %a to <4 x half>
-; SDWA: Cost Model: Found an estimated cost of 4 for instruction: %bsf = sitofp <4 x i17> %b to <4 x float>
-; SDWA: Cost Model: Found an estimated cost of 4 for instruction: %buf = uitofp <4 x i17> %b to <4 x float>
-; SDWA: Cost Model: Found an estimated cost of 4 for instruction: %bsh = sitofp <4 x i17> %b to <4 x half>
-; SDWA: Cost Model: Found an estimated cost of 4 for instruction: %buh = uitofp <4 x i17> %b to <4 x half>
-; SDWA: Cost Model: Found an estimated cost of 4 for instruction: %csf = sitofp <4 x i31> %c to <4 x float>
-; SDWA: Cost Model: Found an estimated cost of 4 for instruction: %cuf = uitofp <4 x i31> %c to <4 x float>
-; SDWA: Cost Model: Found an estimated cost of 4 for instruction: %csh = sitofp <4 x i31> %c to <4 x half>
-; SDWA: Cost Model: Found an estimated cost of 4 for instruction: %cuh = uitofp <4 x i31> %c to <4 x half>
-; SDWA: Cost Model: Found an estimated cost of 3 for instruction: %dsh = sitofp <3 x i17> %d to <3 x half>
-; SDWA: Cost Model: Found an estimated cost of 3 for instruction: %duh = uitofp <3 x i17> %d to <3 x half>
+; SDWA: Cost Model: Found an estimated cost of 6 for instruction: %ash = sitofp <4 x i16> %a to <4 x half>
+; SDWA: Cost Model: Found an estimated cost of 6 for instruction: %auh = uitofp <4 x i16> %a to <4 x half>
+; SDWA: Cost Model: Found an estimated cost of 8 for instruction: %bsf = sitofp <4 x i17> %b to <4 x float>
+; SDWA: Cost Model: Found an estimated cost of 8 for instruction: %buf = uitofp <4 x i17> %b to <4 x float>
+; SDWA: Cost Model: Found an estimated cost of 14 for instruction: %bsh = sitofp <4 x i17> %b to <4 x half>
+; SDWA: Cost Model: Found an estimated cost of 14 for instruction: %buh = uitofp <4 x i17> %b to <4 x half>
+; SDWA: Cost Model: Found an estimated cost of 8 for instruction: %csf = sitofp <4 x i31> %c to <4 x float>
+; SDWA: Cost Model: Found an estimated cost of 8 for instruction: %cuf = uitofp <4 x i31> %c to <4 x float>
+; SDWA: Cost Model: Found an estimated cost of 14 for instruction: %csh = sitofp <4 x i31> %c to <4 x half>
+; SDWA: Cost Model: Found an estimated cost of 14 for instruction: %cuh = uitofp <4 x i31> %c to <4 x half>
+; SDWA: Cost Model: Found an estimated cost of 10 for instruction: %dsh = sitofp <3 x i17> %d to <3 x half>
+; SDWA: Cost Model: Found an estimated cost of 10 for instruction: %duh = uitofp <3 x i17> %d to <3 x half>
;
; PACKED-LABEL: 'wide_lanes_to_fp'
; PACKED: Cost Model: Found an estimated cost of 8 for instruction: %asf = sitofp <4 x i16> %a to <4 x float>
@@ -157,46 +157,46 @@ define void @wide_lanes_to_fp(<4 x i16> %a, <4 x i17> %b, <4 x i31> %c, <3 x i17
; PACKED: Cost Model: Found an estimated cost of 8 for instruction: %auh = uitofp <4 x i16> %a to <4 x half>
; PACKED: Cost Model: Found an estimated cost of 8 for instruction: %bsf = sitofp <4 x i17> %b to <4 x float>
; PACKED: Cost Model: Found an estimated cost of 8 for instruction: %buf = uitofp <4 x i17> %b to <4 x float>
-; PACKED: Cost Model: Found an estimated cost of 8 for instruction: %bsh = sitofp <4 x i17> %b to <4 x half>
-; PACKED: Cost Model: Found an estimated cost of 8 for instruction: %buh = uitofp <4 x i17> %b to <4 x half>
+; PACKED: Cost Model: Found an estimated cost of 14 for instruction: %bsh = sitofp <4 x i17> %b to <4 x half>
+; PACKED: Cost Model: Found an estimated cost of 14 for instruction: %buh = uitofp <4 x i17> %b to <4 x half>
; PACKED: Cost Model: Found an estimated cost of 8 for instruction: %csf = sitofp <4 x i31> %c to <4 x float>
; PACKED: Cost Model: Found an estimated cost of 8 for instruction: %cuf = uitofp <4 x i31> %c to <4 x float>
-; PACKED: Cost Model: Found an estimated cost of 8 for instruction: %csh = sitofp <4 x i31> %c to <4 x half>
-; PACKED: Cost Model: Found an estimated cost of 8 for instruction: %cuh = uitofp <4 x i31> %c to <4 x half>
-; PACKED: Cost Model: Found an estimated cost of 6 for instruction: %dsh = sitofp <3 x i17> %d to <3 x half>
-; PACKED: Cost Model: Found an estimated cost of 6 for instruction: %duh = uitofp <3 x i17> %d to <3 x half>
+; PACKED: Cost Model: Found an estimated cost of 14 for instruction: %csh = sitofp <4 x i31> %c to <4 x half>
+; PACKED: Cost Model: Found an estimated cost of 14 for instruction: %cuh = uitofp <4 x i31> %c to <4 x half>
+; PACKED: Cost Model: Found an estimated cost of 10 for instruction: %dsh = sitofp <3 x i17> %d to <3 x half>
+; PACKED: Cost Model: Found an estimated cost of 10 for instruction: %duh = uitofp <3 x i17> %d to <3 x half>
;
; TRUE16-LABEL: 'wide_lanes_to_fp'
; TRUE16: Cost Model: Found an estimated cost of 8 for instruction: %asf = sitofp <4 x i16> %a to <4 x float>
; TRUE16: Cost Model: Found an estimated cost of 8 for instruction: %auf = uitofp <4 x i16> %a to <4 x float>
-; TRUE16: Cost Model: Found an estimated cost of 8 for instruction: %ash = sitofp <4 x i16> %a to <4 x half>
-; TRUE16: Cost Model: Found an estimated cost of 8 for instruction: %auh = uitofp <4 x i16> %a to <4 x half>
+; TRUE16: Cost Model: Found an estimated cost of 4 for instruction: %ash = sitofp <4 x i16> %a to <4 x half>
+; TRUE16: Cost Model: Found an estimated cost of 4 for instruction: %auh = uitofp <4 x i16> %a to <4 x half>
; TRUE16: Cost Model: Found an estimated cost of 8 for instruction: %bsf = sitofp <4 x i17> %b to <4 x float>
; TRUE16: Cost Model: Found an estimated cost of 8 for instruction: %buf = uitofp <4 x i17> %b to <4 x float>
-; TRUE16: Cost Model: Found an estimated cost of 8 for instruction: %bsh = sitofp <4 x i17> %b to <4 x half>
-; TRUE16: Cost Model: Found an estimated cost of 8 for instruction: %buh = uitofp <4 x i17> %b to <4 x half>
+; TRUE16: Cost Model: Found an estimated cost of 12 for instruction: %bsh = sitofp <4 x i17> %b to <4 x half>
+; TRUE16: Cost Model: Found an estimated cost of 12 for instruction: %buh = uitofp <4 x i17> %b to <4 x half>
; TRUE16: Cost Model: Found an estimated cost of 8 for instruction: %csf = sitofp <4 x i31> %c to <4 x float>
; TRUE16: Cost Model: Found an estimated cost of 8 for instruction: %cuf = uitofp <4 x i31> %c to <4 x float>
-; TRUE16: Cost Model: Found an estimated cost of 8 for instruction: %csh = sitofp <4 x i31> %c to <4 x half>
-; TRUE16: Cost Model: Found an estimated cost of 8 for instruction: %cuh = uitofp <4 x i31> %c to <4 x half>
-; TRUE16: Cost Model: Found an estimated cost of 6 for instruction: %dsh = sitofp <3 x i17> %d to <3 x half>
-; TRUE16: Cost Model: Found an estimated cost of 6 for instruction: %duh = uitofp <3 x i17> %d to <3 x half>
+; TRUE16: Cost Model: Found an estimated cost of 12 for instruction: %csh = sitofp <4 x i31> %c to <4 x half>
+; TRUE16: Cost Model: Found an estimated cost of 12 for instruction: %cuh = uitofp <4 x i31> %c to <4 x half>
+; TRUE16: Cost Model: Found an estimated cost of 9 for instruction: %dsh = sitofp <3 x i17> %d to <3 x half>
+; TRUE16: Cost Model: Found an estimated cost of 9 for instruction: %duh = uitofp <3 x i17> %d to <3 x half>
;
; SDWA-CVTPK-LABEL: 'wide_lanes_to_fp'
; SDWA-CVTPK: Cost Model: Found an estimated cost of 4 for instruction: %asf = sitofp <4 x i16> %a to <4 x float>
; SDWA-CVTPK: Cost Model: Found an estimated cost of 4 for instruction: %auf = uitofp <4 x i16> %a to <4 x float>
-; SDWA-CVTPK: Cost Model: Found an estimated cost of 4 for instruction: %ash = sitofp <4 x i16> %a to <4 x half>
-; SDWA-CVTPK: Cost Model: Found an estimated cost of 4 for instruction: %auh = uitofp <4 x i16> %a to <4 x half>
-; SDWA-CVTPK: Cost Model: Found an estimated cost of 4 for instruction: %bsf = sitofp <4 x i17> %b to <4 x float>
-; SDWA-CVTPK: Cost Model: Found an estimated cost of 4 for instruction: %buf = uitofp <4 x i17> %b to <4 x float>
-; SDWA-CVTPK: Cost Model: Found an estimated cost of 4 for instruction: %bsh = sitofp <4 x i17> %b to <4 x half>
-; SDWA-CVTPK: Cost Model: Found an estimated cost of 4 for instruction: %buh = uitofp <4 x i17> %b to <4 x half>
-; SDWA-CVTPK: Cost Model: Found an estimated cost of 4 for instruction: %csf = sitofp <4 x i31> %c to <4 x float>
-; SDWA-CVTPK: Cost Model: Found an estimated cost of 4 for instruction: %cuf = uitofp <4 x i31> %c to <4 x float>
-; SDWA-CVTPK: Cost Model: Found an estimated cost of 4 for instruction: %csh = sitofp <4 x i31> %c to <4 x half>
-; SDWA-CVTPK: Cost Model: Found an estimated cost of 4 for instruction: %cuh = uitofp <4 x i31> %c to <4 x half>
-; SDWA-CVTPK: Cost Model: Found an estimated cost of 3 for instruction: %dsh = sitofp <3 x i17> %d to <3 x half>
-; SDWA-CVTPK: Cost Model: Found an estimated cost of 3 for instruction: %duh = uitofp <3 x i17> %d to <3 x half>
+; SDWA-CVTPK: Cost Model: Found an estimated cost of 6 for instruction: %ash = sitofp <4 x i16> %a to <4 x half>
+; SDWA-CVTPK: Cost Model: Found an estimated cost of 6 for instruction: %auh = uitofp <4 x i16> %a to <4 x half>
+; SDWA-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %bsf = sitofp <4 x i17> %b to <4 x float>
+; SDWA-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %buf = uitofp <4 x i17> %b to <4 x float>
+; SDWA-CVTPK: Cost Model: Found an estimated cost of 10 for instruction: %bsh = sitofp <4 x i17> %b to <4 x half>
+; SDWA-CVTPK: Cost Model: Found an estimated cost of 10 for instruction: %buh = uitofp <4 x i17> %b to <4 x half>
+; SDWA-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %csf = sitofp <4 x i31> %c to <4 x float>
+; SDWA-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %cuf = uitofp <4 x i31> %c to <4 x float>
+; SDWA-CVTPK: Cost Model: Found an estimated cost of 10 for instruction: %csh = sitofp <4 x i31> %c to <4 x half>
+; SDWA-CVTPK: Cost Model: Found an estimated cost of 10 for instruction: %cuh = uitofp <4 x i31> %c to <4 x half>
+; SDWA-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %dsh = sitofp <3 x i17> %d to <3 x half>
+; SDWA-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %duh = uitofp <3 x i17> %d to <3 x half>
;
; PACKED-CVTPK-LABEL: 'wide_lanes_to_fp'
; PACKED-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %asf = sitofp <4 x i16> %a to <4 x float>
@@ -205,62 +205,62 @@ define void @wide_lanes_to_fp(<4 x i16> %a, <4 x i17> %b, <4 x i31> %c, <3 x i17
; PACKED-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %auh = uitofp <4 x i16> %a to <4 x half>
; PACKED-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %bsf = sitofp <4 x i17> %b to <4 x float>
; PACKED-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %buf = uitofp <4 x i17> %b to <4 x float>
-; PACKED-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %bsh = sitofp <4 x i17> %b to <4 x half>
-; PACKED-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %buh = uitofp <4 x i17> %b to <4 x half>
+; PACKED-CVTPK: Cost Model: Found an estimated cost of 10 for instruction: %bsh = sitofp <4 x i17> %b to <4 x half>
+; PACKED-CVTPK: Cost Model: Found an estimated cost of 10 for instruction: %buh = uitofp <4 x i17> %b to <4 x half>
; PACKED-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %csf = sitofp <4 x i31> %c to <4 x float>
; PACKED-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %cuf = uitofp <4 x i31> %c to <4 x float>
-; PACKED-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %csh = sitofp <4 x i31> %c to <4 x half>
-; PACKED-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %cuh = uitofp <4 x i31> %c to <4 x half>
-; PACKED-CVTPK: Cost Model: Found an estimated cost of 6 for instruction: %dsh = sitofp <3 x i17> %d to <3 x half>
-; PACKED-CVTPK: Cost Model: Found an estimated cost of 6 for instruction: %duh = uitofp <3 x i17> %d to <3 x half>
+; PACKED-CVTPK: Cost Model: Found an estimated cost of 10 for instruction: %csh = sitofp <4 x i31> %c to <4 x half>
+; PACKED-CVTPK: Cost Model: Found an estimated cost of 10 for instruction: %cuh = uitofp <4 x i31> %c to <4 x half>
+; PACKED-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %dsh = sitofp <3 x i17> %d to <3 x half>
+; PACKED-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %duh = uitofp <3 x i17> %d to <3 x half>
;
; TRUE16-CVTPK-LABEL: 'wide_lanes_to_fp'
; TRUE16-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %asf = sitofp <4 x i16> %a to <4 x float>
; TRUE16-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %auf = uitofp <4 x i16> %a to <4 x float>
-; TRUE16-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %ash = sitofp <4 x i16> %a to <4 x half>
-; TRUE16-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %auh = uitofp <4 x i16> %a to <4 x half>
+; TRUE16-CVTPK: Cost Model: Found an estimated cost of 4 for instruction: %ash = sitofp <4 x i16> %a to <4 x half>
+; TRUE16-CVTPK: Cost Model: Found an estimated cost of 4 for instruction: %auh = uitofp <4 x i16> %a to <4 x half>
; TRUE16-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %bsf = sitofp <4 x i17> %b to <4 x float>
; TRUE16-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %buf = uitofp <4 x i17> %b to <4 x float>
-; TRUE16-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %bsh = sitofp <4 x i17> %b to <4 x half>
-; TRUE16-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %buh = uitofp <4 x i17> %b to <4 x half>
+; TRUE16-CVTPK: Cost Model: Found an estimated cost of 10 for instruction: %bsh = sitofp <4 x i17> %b to <4 x half>
+; TRUE16-CVTPK: Cost Model: Found an estimated cost of 10 for instruction: %buh = uitofp <4 x i17> %b to <4 x half>
; TRUE16-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %csf = sitofp <4 x i31> %c to <4 x float>
; TRUE16-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %cuf = uitofp <4 x i31> %c to <4 x float>
-; TRUE16-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %csh = sitofp <4 x i31> %c to <4 x half>
-; TRUE16-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %cuh = uitofp <4 x i31> %c to <4 x half>
-; TRUE16-CVTPK: Cost Model: Found an estimated cost of 6 for instruction: %dsh = sitofp <3 x i17> %d to <3 x half>
-; TRUE16-CVTPK: Cost Model: Found an estimated cost of 6 for instruction: %duh = uitofp <3 x i17> %d to <3 x half>
+; TRUE16-CVTPK: Cost Model: Found an estimated cost of 10 for instruction: %csh = sitofp <4 x i31> %c to <4 x half>
+; TRUE16-CVTPK: Cost Model: Found an estimated cost of 10 for instruction: %cuh = uitofp <4 x i31> %c to <4 x half>
+; TRUE16-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %dsh = sitofp <3 x i17> %d to <3 x half>
+; TRUE16-CVTPK: Cost Model: Found an estimated cost of 8 for instruction: %duh = uitofp <3 x i17> %d to <3 x half>
;
; NO16BIT-SIZE-LABEL: 'wide_lanes_to_fp'
; NO16BIT-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %asf = sitofp <4 x i16> %a to <4 x float>
; NO16BIT-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %auf = uitofp <4 x i16> %a to <4 x float>
-; NO16BIT-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %ash = sitofp <4 x i16> %a to <4 x half>
-; NO16BIT-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %auh = uitofp <4 x i16> %a to <4 x half>
+; NO16BIT-SIZE: Cost Model: Found an estimated cost of 16 for instruction: %ash = sitofp <4 x i16> %a to <4 x half>
+; NO16BIT-SIZE: Cost Model: Found an estimated cost of 16 for instruction: %auh = uitofp <4 x i16> %a to <4 x half>
; NO16BIT-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %bsf = sitofp <4 x i17> %b to <4 x float>
; NO16BIT-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %buf = uitofp <4 x i17> %b to <4 x float>
-; NO16BIT-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %bsh = sitofp <4 x i17> %b to <4 x half>
-; NO16BIT-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %buh = uitofp <4 x i17> %b to <4 x half>
+; NO16BIT-SIZE: Cost Model: Found an estimated cost of 16 for instruction: %bsh = sitofp <4 x i17> %b to <4 x half>
+; NO16BIT-SIZE: Cost Model: Found an estimated cost of 16 for instruction: %buh = uitofp <4 x i17> %b to <4 x half>
; NO16BIT-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %csf = sitofp <4 x i31> %c to <4 x float>
; NO16BIT-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %cuf = uitofp <4 x i31> %c to <4 x float>
-; NO16BIT-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %csh = sitofp <4 x i31> %c to <4 x half>
-; NO16BIT-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %cuh = uitofp <4 x i31> %c to <4 x half>
-; NO16BIT-SIZE: Cost Model: Found an estimated cost of 6 for instruction: %dsh = sitofp <3 x i17> %d to <3 x half>
-; NO16BIT-SIZE: Cost Model: Found an estimated cost of 6 for instruction: %duh = uitofp <3 x i17> %d to <3 x half>
+; NO16BIT-SIZE: Cost Model: Found an estimated cost of 16 for instruction: %csh = sitofp <4 x i31> %c to <4 x half>
+; NO16BIT-SIZE: Cost Model: Found an estimated cost of 16 for instruction: %cuh = uitofp <4 x i31> %c to <4 x half>
+; NO16BIT-SIZE: Cost Model: Found an estimated cost of 11 for instruction: %dsh = sitofp <3 x i17> %d to <3 x half>
+; NO16BIT-SIZE: Cost Model: Found an estimated cost of 11 for instruction: %duh = uitofp <3 x i17> %d to <3 x half>
;
; SDWA-SIZE-LABEL: 'wide_lanes_to_fp'
; SDWA-SIZE: Cost Model: Found an estimated cost of 4 for instruction: %asf = sitofp <4 x i16> %a to <4 x float>
; SDWA-SIZE: Cost Model: Found an estimated cost of 4 for instruction: %auf = uitofp <4 x i16> %a to <4 x float>
-; SDWA-SIZE: Cost Model: Found an estimated cost of 4 for instruction: %ash = sitofp <4 x i16> %a to <4 x half>
-; SDWA-SIZE: Cost Model: Found an estimated cost of 4 for instruction: %auh = uitofp <4 x i16> %a to <4 x half>
-; SDWA-SIZE: Cost Model: Found an estimated cost of 4 for instruction: %bsf = sitofp <4 x i17> %b to <4 x float>
-; SDWA-SIZE: Cost Model: Found an estimated cost of 4 for instruction: %buf = uitofp <4 x i17> %b to <4 x float>
-; SDWA-SIZE: Cost Model: Found an estimated cost of 4 for instruction: %bsh = sitofp <4 x i17> %b to <4 x half>
-; SDWA-SIZE: Cost Model: Found an estimated cost of 4 for instruction: %buh = uitofp <4 x i17> %b to <4 x half>
-; SDWA-SIZE: Cost Model: Found an estimated cost of 4 for instruction: %csf = sitofp <4 x i31> %c to <4 x float>
-; SDWA-SIZE: Cost Model: Found an estimated cost of 4 for instruction: %cuf = uitofp <4 x i31> %c to <4 x float>
-; SDWA-SIZE: Cost Model: Found an estimated cost of 4 for instruction: %csh = sitofp <4 x i31> %c to <4 x half>
-; SDWA-SIZE: Cost Model: Found an estimated cost of 4 for instruction: %cuh = uitofp <4 x i31> %c to <4 x half>
-; SDWA-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %dsh = sitofp <3 x i17> %d to <3 x half>
-; SDWA-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %duh = uitofp <3 x i17> %d to <3 x half>
+; SDWA-SIZE: Cost Model: Found an estimated cost of 6 for instruction: %ash = sitofp <4 x i16> %a to <4 x half>
+; SDWA-SIZE: Cost Model: Found an estimated cost of 6 for instruction: %auh = uitofp <4 x i16> %a to <4 x half>
+; SDWA-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %bsf = sitofp <4 x i17> %b to <4 x float>
+; SDWA-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %buf = uitofp <4 x i17> %b to <4 x float>
+; SDWA-SIZE: Cost Model: Found an estimated cost of 14 for instruction: %bsh = sitofp <4 x i17> %b to <4 x half>
+; SDWA-SIZE: Cost Model: Found an estimated cost of 14 for instruction: %buh = uitofp <4 x i17> %b to <4 x half>
+; SDWA-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %csf = sitofp <4 x i31> %c to <4 x float>
+; SDWA-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %cuf = uitofp <4 x i31> %c to <4 x float>
+; SDWA-SIZE: Cost Model: Found an estimated cost of 14 for instruction: %csh = sitofp <4 x i31> %c to <4 x half>
+; SDWA-SIZE: Cost Model: Found an estimated cost of 14 for instruction: %cuh = uitofp <4 x i31> %c to <4 x half>
+; SDWA-SIZE: Cost Model: Found an estimated cost of 10 for instruction: %dsh = sitofp <3 x i17> %d to <3 x half>
+; SDWA-SIZE: Cost Model: Found an estimated cost of 10 for instruction: %duh = uitofp <3 x i17> %d to <3 x half>
;
%asf = sitofp <4 x i16> %a to <4 x float>
%auf = uitofp <4 x i16> %a to <4 x float>
More information about the llvm-commits
mailing list