[llvm] [AMDGPU] Price scalar integer to fp casts by source width and sign (PR #225343)
Dmitry Sidorov via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 2 02:36:14 PDT 2026
https://github.com/MrSidims updated https://github.com/llvm/llvm-project/pull/225343
>From e52494828f8f261114c71014e68b2e21a8930f99 Mon Sep 17 00:00:00 2001
From: Dmitry Sidorov <Dmitry.Sidorov at amd.com>
Date: Thu, 17 Sep 2026 01:40:15 +0200
Subject: [PATCH 1/6] [AMDGPU] Price scalar integer to fp casts by source width
and sign
Scalar sources between a byte and 31 bits fell to the default cost of one
while the matching vector lanes were already priced, which skewed the
difference SLP weighs a bundle against. Such a source is extended before
the conversion, and what the extension takes depends on the width, on the
sign and on whether the subtarget has SDWA and 16 bit instructions.
Sources narrower than a byte are left alone, because their vector form is
not priced either.
---
.../AMDGPU/AMDGPUTargetTransformInfo.cpp | 38 +-
.../CostModel/AMDGPU/narrow-int-to-bfloat.ll | 144 ++--
.../CostModel/AMDGPU/narrow-int-to-fp.ll | 776 +++++++++---------
3 files changed, 489 insertions(+), 469 deletions(-)
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
index 9662be4530f78..3ac6855b2299b 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
@@ -1100,20 +1100,16 @@ InstructionCost GCNTTIImpl::getCastInstrCost(unsigned Opcode, Type *Dst,
if (IsIntToFP) {
const unsigned ExtOps = UsesInt64 && SrcBits < 64 ? (IsSigned ? 2 : 1) : 0;
if (FPTy->isBFloatTy()) {
- const bool NarrowLanes =
- SrcBits >= 8 && SrcBits < 32 && isa<FixedVectorType>(Src);
- if (!NarrowLanes && SrcBits != 8 && SrcBits != 16 && SrcBits != 32 &&
- !UsesInt64)
+ if (SrcBits < 8 || (SrcBits > 32 && !UsesInt64))
return BaseT::getCastInstrCost(Opcode, Dst, Src, CCH, CostKind, I);
// Each integer is converted to f32 first.
InstructionCost FloatCost =
Scale(UsesInt64 ? ExtOps + (IsSigned ? 12 : 8) : 1);
- if (NarrowLanes) {
- auto *FloatTy =
- FixedVectorType::get(Type::getFloatTy(Dst->getContext()), NElts);
- FloatCost = getCastInstrCost(Opcode, FloatTy, Src, CCH, CostKind);
- }
+ if (SrcBits < 32)
+ FloatCost = getCastInstrCost(
+ Opcode, Dst->getWithNewType(Type::getFloatTy(Dst->getContext())),
+ Src, CCH, CostKind);
// Native rounding can convert a pair. With 16 bit instructions the
// expansion extracts the low significand bit, adds the rounding bias,
@@ -1187,6 +1183,30 @@ InstructionCost GCNTTIImpl::getCastInstrCost(unsigned Opcode, Type *Dst,
return Scale(PerElt);
}
+ // A narrow scalar source is extended before the conversion. An unsigned
+ // byte is converted straight out of its register, and a signed one with
+ // SDWA. A source wider than a byte but narrower than 16 bits is masked
+ // or sign extended first. Without 16 bit instructions a half result is
+ // rounded from f32.
+ if (SrcBits >= 8 && SrcBits < 32) {
+ const bool Narrow = SrcBits > 8 && SrcBits < 16;
+ const bool SignExtend16 = IsSigned && Narrow && ST->has16BitInsts();
+ if (FPTy->isDoubleTy())
+ return Scale(1 + 2 * SignExtend16, 1);
+ if (SrcBits > 16)
+ return Scale(FPTy->isHalfTy() ? 3 : 2);
+ if (FPTy->isHalfTy() && ST->has16BitInsts())
+ return Scale(Narrow ? (IsSigned ? 3 : 2)
+ : SrcBits == 8 && !ST->hasSDWA() ? 2
+ : 1);
+ const InstructionCost FloatCost =
+ SignExtend16 ? Scale(ST->hasSDWA() ? 3 : 4)
+ : Narrow ? Scale(2)
+ : SrcBits == 8 && !IsSigned ? Scale(1)
+ : Scale(ST->hasSDWA() ? 1 : 2);
+ return FPTy->isHalfTy() ? FloatCost + Scale(1) : FloatCost;
+ }
+
return BaseT::getCastInstrCost(Opcode, Dst, Src, CCH, CostKind, I);
}
diff --git a/llvm/test/Analysis/CostModel/AMDGPU/narrow-int-to-bfloat.ll b/llvm/test/Analysis/CostModel/AMDGPU/narrow-int-to-bfloat.ll
index d49ab6541ed09..d33d6864a6115 100644
--- a/llvm/test/Analysis/CostModel/AMDGPU/narrow-int-to-bfloat.ll
+++ b/llvm/test/Analysis/CostModel/AMDGPU/narrow-int-to-bfloat.ll
@@ -156,76 +156,76 @@ define void @narrow_to_bfloat(<4 x i8> %a, <4 x i12> %b, <4 x i16> %c, <4 x i17>
define void @narrow_scalars_to_bfloat(i8 %a, i12 %b, i16 %c, i17 %d, i31 %e) {
; GFX6-LABEL: 'narrow_scalars_to_bfloat'
-; GFX6: Cost Model: Found an estimated cost of 2 for instruction: %as = sitofp i8 %a to bfloat
+; GFX6: Cost Model: Found an estimated cost of 3 for instruction: %as = sitofp i8 %a to bfloat
; GFX6: Cost Model: Found an estimated cost of 2 for instruction: %au = uitofp i8 %a to bfloat
-; GFX6: Cost Model: Found an estimated cost of 1 for instruction: %bs = sitofp i12 %b to bfloat
-; GFX6: Cost Model: Found an estimated cost of 1 for instruction: %bu = uitofp i12 %b to bfloat
-; GFX6: Cost Model: Found an estimated cost of 2 for instruction: %cs = sitofp i16 %c to bfloat
-; GFX6: Cost Model: Found an estimated cost of 2 for instruction: %cu = uitofp i16 %c to bfloat
-; GFX6: Cost Model: Found an estimated cost of 1 for instruction: %ds = sitofp i17 %d to bfloat
-; GFX6: Cost Model: Found an estimated cost of 1 for instruction: %du = uitofp i17 %d to bfloat
-; GFX6: Cost Model: Found an estimated cost of 1 for instruction: %es = sitofp i31 %e to bfloat
-; GFX6: Cost Model: Found an estimated cost of 1 for instruction: %eu = uitofp i31 %e to bfloat
+; GFX6: Cost Model: Found an estimated cost of 3 for instruction: %bs = sitofp i12 %b to bfloat
+; GFX6: Cost Model: Found an estimated cost of 3 for instruction: %bu = uitofp i12 %b to bfloat
+; GFX6: Cost Model: Found an estimated cost of 3 for instruction: %cs = sitofp i16 %c to bfloat
+; GFX6: Cost Model: Found an estimated cost of 3 for instruction: %cu = uitofp i16 %c to bfloat
+; GFX6: Cost Model: Found an estimated cost of 3 for instruction: %ds = sitofp i17 %d to bfloat
+; GFX6: Cost Model: Found an estimated cost of 3 for instruction: %du = uitofp i17 %d to bfloat
+; GFX6: Cost Model: Found an estimated cost of 3 for instruction: %es = sitofp i31 %e to bfloat
+; GFX6: Cost Model: Found an estimated cost of 3 for instruction: %eu = uitofp i31 %e to bfloat
;
; GFX8-LABEL: 'narrow_scalars_to_bfloat'
; GFX8: Cost Model: Found an estimated cost of 8 for instruction: %as = sitofp i8 %a to bfloat
; GFX8: Cost Model: Found an estimated cost of 8 for instruction: %au = uitofp i8 %a to bfloat
-; GFX8: Cost Model: Found an estimated cost of 1 for instruction: %bs = sitofp i12 %b to bfloat
-; GFX8: Cost Model: Found an estimated cost of 1 for instruction: %bu = uitofp i12 %b to bfloat
+; GFX8: Cost Model: Found an estimated cost of 10 for instruction: %bs = sitofp i12 %b to bfloat
+; GFX8: Cost Model: Found an estimated cost of 9 for instruction: %bu = uitofp i12 %b to bfloat
; GFX8: Cost Model: Found an estimated cost of 8 for instruction: %cs = sitofp i16 %c to bfloat
; GFX8: Cost Model: Found an estimated cost of 8 for instruction: %cu = uitofp i16 %c to bfloat
-; GFX8: Cost Model: Found an estimated cost of 1 for instruction: %ds = sitofp i17 %d to bfloat
-; GFX8: Cost Model: Found an estimated cost of 1 for instruction: %du = uitofp i17 %d to bfloat
-; GFX8: Cost Model: Found an estimated cost of 1 for instruction: %es = sitofp i31 %e to bfloat
-; GFX8: Cost Model: Found an estimated cost of 1 for instruction: %eu = uitofp i31 %e to bfloat
+; GFX8: Cost Model: Found an estimated cost of 9 for instruction: %ds = sitofp i17 %d to bfloat
+; GFX8: Cost Model: Found an estimated cost of 9 for instruction: %du = uitofp i17 %d to bfloat
+; GFX8: Cost Model: Found an estimated cost of 9 for instruction: %es = sitofp i31 %e to bfloat
+; GFX8: Cost Model: Found an estimated cost of 9 for instruction: %eu = uitofp i31 %e to bfloat
;
; GFX9-LABEL: 'narrow_scalars_to_bfloat'
; GFX9: Cost Model: Found an estimated cost of 7 for instruction: %as = sitofp i8 %a to bfloat
; GFX9: Cost Model: Found an estimated cost of 7 for instruction: %au = uitofp i8 %a to bfloat
-; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %bs = sitofp i12 %b to bfloat
-; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %bu = uitofp i12 %b to bfloat
+; GFX9: Cost Model: Found an estimated cost of 9 for instruction: %bs = sitofp i12 %b to bfloat
+; GFX9: Cost Model: Found an estimated cost of 8 for instruction: %bu = uitofp i12 %b to bfloat
; GFX9: Cost Model: Found an estimated cost of 7 for instruction: %cs = sitofp i16 %c to bfloat
; GFX9: Cost Model: Found an estimated cost of 7 for instruction: %cu = uitofp i16 %c to bfloat
-; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %ds = sitofp i17 %d to bfloat
-; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %du = uitofp i17 %d to bfloat
-; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %es = sitofp i31 %e to bfloat
-; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %eu = uitofp i31 %e to bfloat
+; GFX9: Cost Model: Found an estimated cost of 8 for instruction: %ds = sitofp i17 %d to bfloat
+; GFX9: Cost Model: Found an estimated cost of 8 for instruction: %du = uitofp i17 %d to bfloat
+; GFX9: Cost Model: Found an estimated cost of 8 for instruction: %es = sitofp i31 %e to bfloat
+; GFX9: Cost Model: Found an estimated cost of 8 for instruction: %eu = uitofp i31 %e to bfloat
;
; NOSDWA-LABEL: 'narrow_scalars_to_bfloat'
-; NOSDWA: Cost Model: Found an estimated cost of 7 for instruction: %as = sitofp i8 %a to bfloat
+; NOSDWA: Cost Model: Found an estimated cost of 8 for instruction: %as = sitofp i8 %a to bfloat
; NOSDWA: Cost Model: Found an estimated cost of 7 for instruction: %au = uitofp i8 %a to bfloat
-; NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %bs = sitofp i12 %b to bfloat
-; NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %bu = uitofp i12 %b to bfloat
-; NOSDWA: Cost Model: Found an estimated cost of 7 for instruction: %cs = sitofp i16 %c to bfloat
-; NOSDWA: Cost Model: Found an estimated cost of 7 for instruction: %cu = uitofp i16 %c to bfloat
-; NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %ds = sitofp i17 %d to bfloat
-; NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %du = uitofp i17 %d to bfloat
-; NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %es = sitofp i31 %e to bfloat
-; NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %eu = uitofp i31 %e to bfloat
+; NOSDWA: Cost Model: Found an estimated cost of 10 for instruction: %bs = sitofp i12 %b to bfloat
+; NOSDWA: Cost Model: Found an estimated cost of 8 for instruction: %bu = uitofp i12 %b to bfloat
+; NOSDWA: Cost Model: Found an estimated cost of 8 for instruction: %cs = sitofp i16 %c to bfloat
+; NOSDWA: Cost Model: Found an estimated cost of 8 for instruction: %cu = uitofp i16 %c to bfloat
+; NOSDWA: Cost Model: Found an estimated cost of 8 for instruction: %ds = sitofp i17 %d to bfloat
+; NOSDWA: Cost Model: Found an estimated cost of 8 for instruction: %du = uitofp i17 %d to bfloat
+; NOSDWA: Cost Model: Found an estimated cost of 8 for instruction: %es = sitofp i31 %e to bfloat
+; NOSDWA: Cost Model: Found an estimated cost of 8 for instruction: %eu = uitofp i31 %e to bfloat
;
; GFX950-LABEL: 'narrow_scalars_to_bfloat'
; GFX950: Cost Model: Found an estimated cost of 2 for instruction: %as = sitofp i8 %a to bfloat
; GFX950: Cost Model: Found an estimated cost of 2 for instruction: %au = uitofp i8 %a to bfloat
-; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %bs = sitofp i12 %b to bfloat
-; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %bu = uitofp i12 %b to bfloat
+; GFX950: Cost Model: Found an estimated cost of 4 for instruction: %bs = sitofp i12 %b to bfloat
+; GFX950: Cost Model: Found an estimated cost of 3 for instruction: %bu = uitofp i12 %b to bfloat
; GFX950: Cost Model: Found an estimated cost of 2 for instruction: %cs = sitofp i16 %c to bfloat
; GFX950: Cost Model: Found an estimated cost of 2 for instruction: %cu = uitofp i16 %c to bfloat
-; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %ds = sitofp i17 %d to bfloat
-; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %du = uitofp i17 %d to bfloat
-; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %es = sitofp i31 %e to bfloat
-; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %eu = uitofp i31 %e to bfloat
+; GFX950: Cost Model: Found an estimated cost of 3 for instruction: %ds = sitofp i17 %d to bfloat
+; GFX950: Cost Model: Found an estimated cost of 3 for instruction: %du = uitofp i17 %d to bfloat
+; GFX950: Cost Model: Found an estimated cost of 3 for instruction: %es = sitofp i31 %e to bfloat
+; GFX950: Cost Model: Found an estimated cost of 3 for instruction: %eu = uitofp i31 %e to bfloat
;
; GFX1250-LABEL: 'narrow_scalars_to_bfloat'
-; GFX1250: Cost Model: Found an estimated cost of 2 for instruction: %as = sitofp i8 %a to bfloat
+; GFX1250: Cost Model: Found an estimated cost of 3 for instruction: %as = sitofp i8 %a to bfloat
; GFX1250: Cost Model: Found an estimated cost of 2 for instruction: %au = uitofp i8 %a to bfloat
-; GFX1250: Cost Model: Found an estimated cost of 1 for instruction: %bs = sitofp i12 %b to bfloat
-; GFX1250: Cost Model: Found an estimated cost of 1 for instruction: %bu = uitofp i12 %b to bfloat
-; GFX1250: Cost Model: Found an estimated cost of 2 for instruction: %cs = sitofp i16 %c to bfloat
-; GFX1250: Cost Model: Found an estimated cost of 2 for instruction: %cu = uitofp i16 %c to bfloat
-; GFX1250: Cost Model: Found an estimated cost of 1 for instruction: %ds = sitofp i17 %d to bfloat
-; GFX1250: Cost Model: Found an estimated cost of 1 for instruction: %du = uitofp i17 %d to bfloat
-; GFX1250: Cost Model: Found an estimated cost of 1 for instruction: %es = sitofp i31 %e to bfloat
-; GFX1250: Cost Model: Found an estimated cost of 1 for instruction: %eu = uitofp i31 %e to bfloat
+; GFX1250: Cost Model: Found an estimated cost of 5 for instruction: %bs = sitofp i12 %b to bfloat
+; GFX1250: Cost Model: Found an estimated cost of 3 for instruction: %bu = uitofp i12 %b to bfloat
+; GFX1250: Cost Model: Found an estimated cost of 3 for instruction: %cs = sitofp i16 %c to bfloat
+; GFX1250: Cost Model: Found an estimated cost of 3 for instruction: %cu = uitofp i16 %c to bfloat
+; GFX1250: Cost Model: Found an estimated cost of 3 for instruction: %ds = sitofp i17 %d to bfloat
+; GFX1250: Cost Model: Found an estimated cost of 3 for instruction: %du = uitofp i17 %d to bfloat
+; GFX1250: Cost Model: Found an estimated cost of 3 for instruction: %es = sitofp i31 %e to bfloat
+; GFX1250: Cost Model: Found an estimated cost of 3 for instruction: %eu = uitofp i31 %e to bfloat
;
%as = sitofp i8 %a to bfloat
%au = uitofp i8 %a to bfloat
@@ -242,34 +242,34 @@ define void @narrow_scalars_to_bfloat(i8 %a, i12 %b, i16 %c, i17 %d, i31 %e) {
define void @loaded_scalars_to_bfloat(ptr addrspace(1) %p) {
; GFX6-LABEL: 'loaded_scalars_to_bfloat'
-; GFX6: Cost Model: Found an estimated cost of 1 for instruction: %as = sitofp i24 %a to bfloat
-; GFX6: Cost Model: Found an estimated cost of 1 for instruction: %bu = uitofp i24 %b to bfloat
-; GFX6: Cost Model: Found an estimated cost of 2 for instruction: %cs = sitofp i16 %c to bfloat
+; GFX6: Cost Model: Found an estimated cost of 3 for instruction: %as = sitofp i24 %a to bfloat
+; GFX6: Cost Model: Found an estimated cost of 3 for instruction: %bu = uitofp i24 %b to bfloat
+; GFX6: Cost Model: Found an estimated cost of 3 for instruction: %cs = sitofp i16 %c to bfloat
;
; GFX8-LABEL: 'loaded_scalars_to_bfloat'
-; GFX8: Cost Model: Found an estimated cost of 1 for instruction: %as = sitofp i24 %a to bfloat
-; GFX8: Cost Model: Found an estimated cost of 1 for instruction: %bu = uitofp i24 %b to bfloat
+; GFX8: Cost Model: Found an estimated cost of 9 for instruction: %as = sitofp i24 %a to bfloat
+; GFX8: Cost Model: Found an estimated cost of 9 for instruction: %bu = uitofp i24 %b to bfloat
; GFX8: Cost Model: Found an estimated cost of 8 for instruction: %cs = sitofp i16 %c to bfloat
;
; GFX9-LABEL: 'loaded_scalars_to_bfloat'
-; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %as = sitofp i24 %a to bfloat
-; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %bu = uitofp i24 %b to bfloat
+; GFX9: Cost Model: Found an estimated cost of 8 for instruction: %as = sitofp i24 %a to bfloat
+; GFX9: Cost Model: Found an estimated cost of 8 for instruction: %bu = uitofp i24 %b to bfloat
; GFX9: Cost Model: Found an estimated cost of 7 for instruction: %cs = sitofp i16 %c to bfloat
;
; NOSDWA-LABEL: 'loaded_scalars_to_bfloat'
-; NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %as = sitofp i24 %a to bfloat
-; NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %bu = uitofp i24 %b to bfloat
-; NOSDWA: Cost Model: Found an estimated cost of 7 for instruction: %cs = sitofp i16 %c to bfloat
+; NOSDWA: Cost Model: Found an estimated cost of 8 for instruction: %as = sitofp i24 %a to bfloat
+; NOSDWA: Cost Model: Found an estimated cost of 8 for instruction: %bu = uitofp i24 %b to bfloat
+; NOSDWA: Cost Model: Found an estimated cost of 8 for instruction: %cs = sitofp i16 %c to bfloat
;
; GFX950-LABEL: 'loaded_scalars_to_bfloat'
-; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %as = sitofp i24 %a to bfloat
-; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %bu = uitofp i24 %b to bfloat
+; GFX950: Cost Model: Found an estimated cost of 3 for instruction: %as = sitofp i24 %a to bfloat
+; GFX950: Cost Model: Found an estimated cost of 3 for instruction: %bu = uitofp i24 %b to bfloat
; GFX950: Cost Model: Found an estimated cost of 2 for instruction: %cs = sitofp i16 %c to bfloat
;
; GFX1250-LABEL: 'loaded_scalars_to_bfloat'
-; GFX1250: Cost Model: Found an estimated cost of 1 for instruction: %as = sitofp i24 %a to bfloat
-; GFX1250: Cost Model: Found an estimated cost of 1 for instruction: %bu = uitofp i24 %b to bfloat
-; GFX1250: Cost Model: Found an estimated cost of 2 for instruction: %cs = sitofp i16 %c to bfloat
+; GFX1250: Cost Model: Found an estimated cost of 3 for instruction: %as = sitofp i24 %a to bfloat
+; GFX1250: Cost Model: Found an estimated cost of 3 for instruction: %bu = uitofp i24 %b to bfloat
+; GFX1250: Cost Model: Found an estimated cost of 3 for instruction: %cs = sitofp i16 %c to bfloat
;
%a = load i24, ptr addrspace(1) %p
%as = sitofp i24 %a to bfloat
@@ -322,38 +322,38 @@ define void @loaded_wide_scalars_to_bfloat(ptr addrspace(1) %p) {
define void @loaded_constant_scalars_to_bfloat(ptr addrspace(4) %p, ptr addrspace(1) %r) {
; GFX6-LABEL: 'loaded_constant_scalars_to_bfloat'
-; GFX6: Cost Model: Found an estimated cost of 1 for instruction: %as = sitofp i24 %a to bfloat
-; GFX6: Cost Model: Found an estimated cost of 1 for instruction: %bs = sitofp i24 %b to bfloat
+; GFX6: Cost Model: Found an estimated cost of 3 for instruction: %as = sitofp i24 %a to bfloat
+; GFX6: Cost Model: Found an estimated cost of 3 for instruction: %bs = sitofp i24 %b to bfloat
; GFX6: Cost Model: Found an estimated cost of 10 for instruction: %cu = uitofp i48 %c to bfloat
; GFX6: Cost Model: Found an estimated cost of 10 for instruction: %du = uitofp i48 %d to bfloat
;
; GFX8-LABEL: 'loaded_constant_scalars_to_bfloat'
-; GFX8: Cost Model: Found an estimated cost of 1 for instruction: %as = sitofp i24 %a to bfloat
-; GFX8: Cost Model: Found an estimated cost of 1 for instruction: %bs = sitofp i24 %b to bfloat
+; GFX8: Cost Model: Found an estimated cost of 9 for instruction: %as = sitofp i24 %a to bfloat
+; GFX8: Cost Model: Found an estimated cost of 9 for instruction: %bs = sitofp i24 %b to bfloat
; GFX8: Cost Model: Found an estimated cost of 16 for instruction: %cu = uitofp i48 %c to bfloat
; GFX8: Cost Model: Found an estimated cost of 16 for instruction: %du = uitofp i48 %d to bfloat
;
; GFX9-LABEL: 'loaded_constant_scalars_to_bfloat'
-; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %as = sitofp i24 %a to bfloat
-; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %bs = sitofp i24 %b to bfloat
+; GFX9: Cost Model: Found an estimated cost of 8 for instruction: %as = sitofp i24 %a to bfloat
+; GFX9: Cost Model: Found an estimated cost of 8 for instruction: %bs = sitofp i24 %b to bfloat
; GFX9: Cost Model: Found an estimated cost of 15 for instruction: %cu = uitofp i48 %c to bfloat
; GFX9: Cost Model: Found an estimated cost of 15 for instruction: %du = uitofp i48 %d to bfloat
;
; NOSDWA-LABEL: 'loaded_constant_scalars_to_bfloat'
-; NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %as = sitofp i24 %a to bfloat
-; NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %bs = sitofp i24 %b to bfloat
+; NOSDWA: Cost Model: Found an estimated cost of 8 for instruction: %as = sitofp i24 %a to bfloat
+; NOSDWA: Cost Model: Found an estimated cost of 8 for instruction: %bs = sitofp i24 %b to bfloat
; NOSDWA: Cost Model: Found an estimated cost of 15 for instruction: %cu = uitofp i48 %c to bfloat
; NOSDWA: Cost Model: Found an estimated cost of 15 for instruction: %du = uitofp i48 %d to bfloat
;
; GFX950-LABEL: 'loaded_constant_scalars_to_bfloat'
-; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %as = sitofp i24 %a to bfloat
-; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %bs = sitofp i24 %b to bfloat
+; GFX950: Cost Model: Found an estimated cost of 3 for instruction: %as = sitofp i24 %a to bfloat
+; GFX950: Cost Model: Found an estimated cost of 3 for instruction: %bs = sitofp i24 %b to bfloat
; GFX950: Cost Model: Found an estimated cost of 10 for instruction: %cu = uitofp i48 %c to bfloat
; GFX950: Cost Model: Found an estimated cost of 10 for instruction: %du = uitofp i48 %d to bfloat
;
; GFX1250-LABEL: 'loaded_constant_scalars_to_bfloat'
-; GFX1250: Cost Model: Found an estimated cost of 1 for instruction: %as = sitofp i24 %a to bfloat
-; GFX1250: Cost Model: Found an estimated cost of 1 for instruction: %bs = sitofp i24 %b to bfloat
+; GFX1250: Cost Model: Found an estimated cost of 3 for instruction: %as = sitofp i24 %a to bfloat
+; GFX1250: Cost Model: Found an estimated cost of 3 for instruction: %bs = sitofp i24 %b to bfloat
; GFX1250: Cost Model: Found an estimated cost of 10 for instruction: %cu = uitofp i48 %c to bfloat
; GFX1250: Cost Model: Found an estimated cost of 10 for instruction: %du = uitofp i48 %d 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 36cfa0e5fb5c6..3b406d0a16fd4 100644
--- a/llvm/test/Analysis/CostModel/AMDGPU/narrow-int-to-fp.ll
+++ b/llvm/test/Analysis/CostModel/AMDGPU/narrow-int-to-fp.ll
@@ -307,364 +307,364 @@ define void @wide_lanes_to_fp(<4 x i16> %a, <4 x i17> %b, <4 x i31> %c, <3 x i17
define void @wide_scalars_to_fp(i16 %a, i17 %b, i31 %c, i12 %d, i32 %e, i8 %f) {
; NO16BIT-LABEL: 'wide_scalars_to_fp'
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %asf = sitofp i16 %a to float
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %auf = uitofp i16 %a to float
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %ash = sitofp i16 %a to half
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %auh = uitofp i16 %a to half
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %bsf = sitofp i17 %b to float
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %buf = uitofp i17 %b to float
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %bsh = sitofp i17 %b to half
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %buh = uitofp i17 %b to half
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %bsd = sitofp i17 %b to double
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %bud = uitofp i17 %b to double
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp i31 %c to float
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %cuf = uitofp i31 %c to float
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %csh = sitofp i31 %c to half
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %cuh = uitofp i31 %c to half
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %dsf = sitofp i12 %d to float
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %duf = uitofp i12 %d to float
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %dsh = sitofp i12 %d to half
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %duh = uitofp i12 %d to half
+; NO16BIT: Cost Model: Found an estimated cost of 2 for instruction: %asf = sitofp i16 %a to float
+; NO16BIT: Cost Model: Found an estimated cost of 2 for instruction: %auf = uitofp i16 %a to float
+; NO16BIT: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i16 %a to half
+; NO16BIT: Cost Model: Found an estimated cost of 3 for instruction: %auh = uitofp i16 %a to half
+; NO16BIT: Cost Model: Found an estimated cost of 2 for instruction: %bsf = sitofp i17 %b to float
+; NO16BIT: Cost Model: Found an estimated cost of 2 for instruction: %buf = uitofp i17 %b to float
+; NO16BIT: Cost Model: Found an estimated cost of 3 for instruction: %bsh = sitofp i17 %b to half
+; NO16BIT: Cost Model: Found an estimated cost of 3 for instruction: %buh = uitofp i17 %b to half
+; NO16BIT: Cost Model: Found an estimated cost of 5 for instruction: %bsd = sitofp i17 %b to double
+; NO16BIT: Cost Model: Found an estimated cost of 5 for instruction: %bud = uitofp i17 %b to double
+; NO16BIT: Cost Model: Found an estimated cost of 2 for instruction: %csf = sitofp i31 %c to float
+; NO16BIT: Cost Model: Found an estimated cost of 2 for instruction: %cuf = uitofp i31 %c to float
+; NO16BIT: Cost Model: Found an estimated cost of 3 for instruction: %csh = sitofp i31 %c to half
+; NO16BIT: Cost Model: Found an estimated cost of 3 for instruction: %cuh = uitofp i31 %c to half
+; NO16BIT: Cost Model: Found an estimated cost of 2 for instruction: %dsf = sitofp i12 %d to float
+; NO16BIT: Cost Model: Found an estimated cost of 2 for instruction: %duf = uitofp i12 %d to float
+; NO16BIT: Cost Model: Found an estimated cost of 3 for instruction: %dsh = sitofp i12 %d to half
+; NO16BIT: Cost Model: Found an estimated cost of 3 for instruction: %duh = uitofp i12 %d to half
; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %esf = sitofp i32 %e to float
; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %euf = uitofp i32 %e to float
; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %esh = sitofp i32 %e to half
; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %euh = uitofp i32 %e to half
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %asd = sitofp i16 %a to double
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %aud = uitofp i16 %a to double
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %csd = sitofp i31 %c to double
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %cud = uitofp i31 %c to double
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %dsd = sitofp i12 %d to double
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %dud = uitofp i12 %d to double
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %fsf = sitofp i8 %f to float
+; NO16BIT: Cost Model: Found an estimated cost of 5 for instruction: %asd = sitofp i16 %a to double
+; NO16BIT: Cost Model: Found an estimated cost of 5 for instruction: %aud = uitofp i16 %a to double
+; NO16BIT: Cost Model: Found an estimated cost of 5 for instruction: %csd = sitofp i31 %c to double
+; NO16BIT: Cost Model: Found an estimated cost of 5 for instruction: %cud = uitofp i31 %c to double
+; NO16BIT: Cost Model: Found an estimated cost of 5 for instruction: %dsd = sitofp i12 %d to double
+; NO16BIT: Cost Model: Found an estimated cost of 5 for instruction: %dud = uitofp i12 %d to double
+; NO16BIT: Cost Model: Found an estimated cost of 2 for instruction: %fsf = sitofp i8 %f to float
; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %fuf = uitofp i8 %f to float
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %fsh = sitofp i8 %f to half
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %fuh = uitofp i8 %f to half
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %fsd = sitofp i8 %f to double
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %fud = uitofp i8 %f to double
+; NO16BIT: Cost Model: Found an estimated cost of 3 for instruction: %fsh = sitofp i8 %f to half
+; NO16BIT: Cost Model: Found an estimated cost of 2 for instruction: %fuh = uitofp i8 %f to half
+; NO16BIT: Cost Model: Found an estimated cost of 5 for instruction: %fsd = sitofp i8 %f to double
+; NO16BIT: Cost Model: Found an estimated cost of 5 for instruction: %fud = uitofp i8 %f to double
;
; GFX9-LABEL: 'wide_scalars_to_fp'
; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %asf = sitofp i16 %a to float
; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %auf = uitofp i16 %a to float
; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %ash = sitofp i16 %a to half
; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %auh = uitofp i16 %a to half
-; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %bsf = sitofp i17 %b to float
-; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %buf = uitofp i17 %b to float
-; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %bsh = sitofp i17 %b to half
-; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %buh = uitofp i17 %b to half
-; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %bsd = sitofp i17 %b to double
-; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %bud = uitofp i17 %b to double
-; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp i31 %c to float
-; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %cuf = uitofp i31 %c to float
-; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %csh = sitofp i31 %c to half
-; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %cuh = uitofp i31 %c to half
-; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %dsf = sitofp i12 %d to float
-; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %duf = uitofp i12 %d to float
-; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %dsh = sitofp i12 %d to half
-; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %duh = uitofp i12 %d to half
+; GFX9: Cost Model: Found an estimated cost of 2 for instruction: %bsf = sitofp i17 %b to float
+; GFX9: Cost Model: Found an estimated cost of 2 for instruction: %buf = uitofp i17 %b to float
+; GFX9: Cost Model: Found an estimated cost of 3 for instruction: %bsh = sitofp i17 %b to half
+; GFX9: Cost Model: Found an estimated cost of 3 for instruction: %buh = uitofp i17 %b to half
+; GFX9: Cost Model: Found an estimated cost of 5 for instruction: %bsd = sitofp i17 %b to double
+; GFX9: Cost Model: Found an estimated cost of 5 for instruction: %bud = uitofp i17 %b to double
+; GFX9: Cost Model: Found an estimated cost of 2 for instruction: %csf = sitofp i31 %c to float
+; GFX9: Cost Model: Found an estimated cost of 2 for instruction: %cuf = uitofp i31 %c to float
+; GFX9: Cost Model: Found an estimated cost of 3 for instruction: %csh = sitofp i31 %c to half
+; GFX9: Cost Model: Found an estimated cost of 3 for instruction: %cuh = uitofp i31 %c to half
+; GFX9: Cost Model: Found an estimated cost of 3 for instruction: %dsf = sitofp i12 %d to float
+; GFX9: Cost Model: Found an estimated cost of 2 for instruction: %duf = uitofp i12 %d to float
+; GFX9: Cost Model: Found an estimated cost of 3 for instruction: %dsh = sitofp i12 %d to half
+; GFX9: Cost Model: Found an estimated cost of 2 for instruction: %duh = uitofp i12 %d to half
; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %esf = sitofp i32 %e to float
; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %euf = uitofp i32 %e to float
; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %esh = sitofp i32 %e to half
; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %euh = uitofp i32 %e to half
-; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %asd = sitofp i16 %a to double
-; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %aud = uitofp i16 %a to double
-; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %csd = sitofp i31 %c to double
-; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %cud = uitofp i31 %c to double
-; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %dsd = sitofp i12 %d to double
-; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %dud = uitofp i12 %d to double
+; GFX9: Cost Model: Found an estimated cost of 5 for instruction: %asd = sitofp i16 %a to double
+; GFX9: Cost Model: Found an estimated cost of 5 for instruction: %aud = uitofp i16 %a to double
+; GFX9: Cost Model: Found an estimated cost of 5 for instruction: %csd = sitofp i31 %c to double
+; GFX9: Cost Model: Found an estimated cost of 5 for instruction: %cud = uitofp i31 %c to double
+; GFX9: Cost Model: Found an estimated cost of 7 for instruction: %dsd = sitofp i12 %d to double
+; GFX9: Cost Model: Found an estimated cost of 5 for instruction: %dud = uitofp i12 %d to double
; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %fsf = sitofp i8 %f to float
; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %fuf = uitofp i8 %f to float
; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %fsh = sitofp i8 %f to half
; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %fuh = uitofp i8 %f to half
-; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %fsd = sitofp i8 %f to double
-; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %fud = uitofp i8 %f to double
+; GFX9: Cost Model: Found an estimated cost of 5 for instruction: %fsd = sitofp i8 %f to double
+; GFX9: Cost Model: Found an estimated cost of 5 for instruction: %fud = uitofp i8 %f to double
;
; GFX9-NOSDWA-LABEL: 'wide_scalars_to_fp'
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %asf = sitofp i16 %a to float
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %auf = uitofp i16 %a to float
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 2 for instruction: %asf = sitofp i16 %a to float
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 2 for instruction: %auf = uitofp i16 %a to float
; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %ash = sitofp i16 %a to half
; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %auh = uitofp i16 %a to half
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %bsf = sitofp i17 %b to float
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %buf = uitofp i17 %b to float
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %bsh = sitofp i17 %b to half
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %buh = uitofp i17 %b to half
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %bsd = sitofp i17 %b to double
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %bud = uitofp i17 %b to double
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp i31 %c to float
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %cuf = uitofp i31 %c to float
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %csh = sitofp i31 %c to half
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %cuh = uitofp i31 %c to half
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %dsf = sitofp i12 %d to float
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %duf = uitofp i12 %d to float
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %dsh = sitofp i12 %d to half
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %duh = uitofp i12 %d to half
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 2 for instruction: %bsf = sitofp i17 %b to float
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 2 for instruction: %buf = uitofp i17 %b to float
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 3 for instruction: %bsh = sitofp i17 %b to half
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 3 for instruction: %buh = uitofp i17 %b to half
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 5 for instruction: %bsd = sitofp i17 %b to double
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 5 for instruction: %bud = uitofp i17 %b to double
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 2 for instruction: %csf = sitofp i31 %c to float
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 2 for instruction: %cuf = uitofp i31 %c to float
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 3 for instruction: %csh = sitofp i31 %c to half
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 3 for instruction: %cuh = uitofp i31 %c to half
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 4 for instruction: %dsf = sitofp i12 %d to float
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 2 for instruction: %duf = uitofp i12 %d to float
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 3 for instruction: %dsh = sitofp i12 %d to half
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 2 for instruction: %duh = uitofp i12 %d to half
; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %esf = sitofp i32 %e to float
; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %euf = uitofp i32 %e to float
; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %esh = sitofp i32 %e to half
; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %euh = uitofp i32 %e to half
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %asd = sitofp i16 %a to double
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %aud = uitofp i16 %a to double
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %csd = sitofp i31 %c to double
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %cud = uitofp i31 %c to double
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %dsd = sitofp i12 %d to double
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %dud = uitofp i12 %d to double
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %fsf = sitofp i8 %f to float
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 5 for instruction: %asd = sitofp i16 %a to double
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 5 for instruction: %aud = uitofp i16 %a to double
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 5 for instruction: %csd = sitofp i31 %c to double
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 5 for instruction: %cud = uitofp i31 %c to double
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 7 for instruction: %dsd = sitofp i12 %d to double
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 5 for instruction: %dud = uitofp i12 %d to double
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 2 for instruction: %fsf = sitofp i8 %f to float
; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %fuf = uitofp i8 %f to float
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %fsh = sitofp i8 %f to half
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %fuh = uitofp i8 %f to half
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %fsd = sitofp i8 %f to double
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %fud = uitofp i8 %f to double
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 2 for instruction: %fsh = sitofp i8 %f to half
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 2 for instruction: %fuh = uitofp i8 %f to half
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 5 for instruction: %fsd = sitofp i8 %f to double
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 5 for instruction: %fud = uitofp i8 %f to double
;
; GFX11-FAKE16-LABEL: 'wide_scalars_to_fp'
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %asf = sitofp i16 %a to float
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %auf = uitofp i16 %a to float
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %asf = sitofp i16 %a to float
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %auf = uitofp i16 %a to float
; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %ash = sitofp i16 %a to half
; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %auh = uitofp i16 %a to half
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %bsf = sitofp i17 %b to float
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %buf = uitofp i17 %b to float
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %bsh = sitofp i17 %b to half
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %buh = uitofp i17 %b to half
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %bsd = sitofp i17 %b to double
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %bud = uitofp i17 %b to double
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp i31 %c to float
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %cuf = uitofp i31 %c to float
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %csh = sitofp i31 %c to half
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %cuh = uitofp i31 %c to half
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %dsf = sitofp i12 %d to float
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %duf = uitofp i12 %d to float
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %dsh = sitofp i12 %d to half
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %duh = uitofp i12 %d to half
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %bsf = sitofp i17 %b to float
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %buf = uitofp i17 %b to float
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 3 for instruction: %bsh = sitofp i17 %b to half
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 3 for instruction: %buh = uitofp i17 %b to half
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 5 for instruction: %bsd = sitofp i17 %b to double
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 5 for instruction: %bud = uitofp i17 %b to double
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %csf = sitofp i31 %c to float
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %cuf = uitofp i31 %c to float
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 3 for instruction: %csh = sitofp i31 %c to half
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 3 for instruction: %cuh = uitofp i31 %c to half
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 4 for instruction: %dsf = sitofp i12 %d to float
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %duf = uitofp i12 %d to float
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 3 for instruction: %dsh = sitofp i12 %d to half
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %duh = uitofp i12 %d to half
; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %esf = sitofp i32 %e to float
; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %euf = uitofp i32 %e to float
; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %esh = sitofp i32 %e to half
; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %euh = uitofp i32 %e to half
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %asd = sitofp i16 %a to double
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %aud = uitofp i16 %a to double
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %csd = sitofp i31 %c to double
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %cud = uitofp i31 %c to double
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %dsd = sitofp i12 %d to double
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %dud = uitofp i12 %d to double
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %fsf = sitofp i8 %f to float
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 5 for instruction: %asd = sitofp i16 %a to double
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 5 for instruction: %aud = uitofp i16 %a to double
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 5 for instruction: %csd = sitofp i31 %c to double
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 5 for instruction: %cud = uitofp i31 %c to double
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 7 for instruction: %dsd = sitofp i12 %d to double
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 5 for instruction: %dud = uitofp i12 %d to double
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %fsf = sitofp i8 %f to float
; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %fuf = uitofp i8 %f to float
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %fsh = sitofp i8 %f to half
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %fuh = uitofp i8 %f to half
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %fsd = sitofp i8 %f to double
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %fud = uitofp i8 %f to double
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %fsh = sitofp i8 %f to half
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %fuh = uitofp i8 %f to half
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 5 for instruction: %fsd = sitofp i8 %f to double
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 5 for instruction: %fud = uitofp i8 %f to double
;
; GFX11-TRUE16-LABEL: 'wide_scalars_to_fp'
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %asf = sitofp i16 %a to float
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %auf = uitofp i16 %a to float
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %asf = sitofp i16 %a to float
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %auf = uitofp i16 %a to float
; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %ash = sitofp i16 %a to half
; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %auh = uitofp i16 %a to half
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %bsf = sitofp i17 %b to float
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %buf = uitofp i17 %b to float
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %bsh = sitofp i17 %b to half
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %buh = uitofp i17 %b to half
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %bsd = sitofp i17 %b to double
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %bud = uitofp i17 %b to double
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp i31 %c to float
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %cuf = uitofp i31 %c to float
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %csh = sitofp i31 %c to half
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %cuh = uitofp i31 %c to half
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %dsf = sitofp i12 %d to float
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %duf = uitofp i12 %d to float
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %dsh = sitofp i12 %d to half
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %duh = uitofp i12 %d to half
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %bsf = sitofp i17 %b to float
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %buf = uitofp i17 %b to float
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 3 for instruction: %bsh = sitofp i17 %b to half
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 3 for instruction: %buh = uitofp i17 %b to half
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 5 for instruction: %bsd = sitofp i17 %b to double
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 5 for instruction: %bud = uitofp i17 %b to double
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %csf = sitofp i31 %c to float
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %cuf = uitofp i31 %c to float
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 3 for instruction: %csh = sitofp i31 %c to half
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 3 for instruction: %cuh = uitofp i31 %c to half
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 4 for instruction: %dsf = sitofp i12 %d to float
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %duf = uitofp i12 %d to float
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 3 for instruction: %dsh = sitofp i12 %d to half
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %duh = uitofp i12 %d to half
; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %esf = sitofp i32 %e to float
; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %euf = uitofp i32 %e to float
; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %esh = sitofp i32 %e to half
; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %euh = uitofp i32 %e to half
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %asd = sitofp i16 %a to double
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %aud = uitofp i16 %a to double
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %csd = sitofp i31 %c to double
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %cud = uitofp i31 %c to double
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %dsd = sitofp i12 %d to double
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %dud = uitofp i12 %d to double
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %fsf = sitofp i8 %f to float
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 5 for instruction: %asd = sitofp i16 %a to double
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 5 for instruction: %aud = uitofp i16 %a to double
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 5 for instruction: %csd = sitofp i31 %c to double
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 5 for instruction: %cud = uitofp i31 %c to double
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 7 for instruction: %dsd = sitofp i12 %d to double
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 5 for instruction: %dud = uitofp i12 %d to double
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %fsf = sitofp i8 %f to float
; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %fuf = uitofp i8 %f to float
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %fsh = sitofp i8 %f to half
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %fuh = uitofp i8 %f to half
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %fsd = sitofp i8 %f to double
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %fud = uitofp i8 %f to double
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %fsh = sitofp i8 %f to half
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %fuh = uitofp i8 %f to half
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 5 for instruction: %fsd = sitofp i8 %f to double
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 5 for instruction: %fud = uitofp i8 %f to double
;
; GFX950-LABEL: 'wide_scalars_to_fp'
; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %asf = sitofp i16 %a to float
; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %auf = uitofp i16 %a to float
; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %ash = sitofp i16 %a to half
; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %auh = uitofp i16 %a to half
-; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %bsf = sitofp i17 %b to float
-; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %buf = uitofp i17 %b to float
-; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %bsh = sitofp i17 %b to half
-; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %buh = uitofp i17 %b to half
-; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %bsd = sitofp i17 %b to double
-; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %bud = uitofp i17 %b to double
-; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp i31 %c to float
-; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %cuf = uitofp i31 %c to float
-; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %csh = sitofp i31 %c to half
-; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %cuh = uitofp i31 %c to half
-; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %dsf = sitofp i12 %d to float
-; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %duf = uitofp i12 %d to float
-; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %dsh = sitofp i12 %d to half
-; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %duh = uitofp i12 %d to half
+; GFX950: Cost Model: Found an estimated cost of 2 for instruction: %bsf = sitofp i17 %b to float
+; GFX950: Cost Model: Found an estimated cost of 2 for instruction: %buf = uitofp i17 %b to float
+; GFX950: Cost Model: Found an estimated cost of 3 for instruction: %bsh = sitofp i17 %b to half
+; GFX950: Cost Model: Found an estimated cost of 3 for instruction: %buh = uitofp i17 %b to half
+; GFX950: Cost Model: Found an estimated cost of 2 for instruction: %bsd = sitofp i17 %b to double
+; GFX950: Cost Model: Found an estimated cost of 2 for instruction: %bud = uitofp i17 %b to double
+; GFX950: Cost Model: Found an estimated cost of 2 for instruction: %csf = sitofp i31 %c to float
+; GFX950: Cost Model: Found an estimated cost of 2 for instruction: %cuf = uitofp i31 %c to float
+; GFX950: Cost Model: Found an estimated cost of 3 for instruction: %csh = sitofp i31 %c to half
+; GFX950: Cost Model: Found an estimated cost of 3 for instruction: %cuh = uitofp i31 %c to half
+; GFX950: Cost Model: Found an estimated cost of 3 for instruction: %dsf = sitofp i12 %d to float
+; GFX950: Cost Model: Found an estimated cost of 2 for instruction: %duf = uitofp i12 %d to float
+; GFX950: Cost Model: Found an estimated cost of 3 for instruction: %dsh = sitofp i12 %d to half
+; GFX950: Cost Model: Found an estimated cost of 2 for instruction: %duh = uitofp i12 %d to half
; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %esf = sitofp i32 %e to float
; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %euf = uitofp i32 %e to float
; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %esh = sitofp i32 %e to half
; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %euh = uitofp i32 %e to half
-; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %asd = sitofp i16 %a to double
-; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %aud = uitofp i16 %a to double
-; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %csd = sitofp i31 %c to double
-; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %cud = uitofp i31 %c to double
-; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %dsd = sitofp i12 %d to double
-; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %dud = uitofp i12 %d to double
+; GFX950: Cost Model: Found an estimated cost of 2 for instruction: %asd = sitofp i16 %a to double
+; GFX950: Cost Model: Found an estimated cost of 2 for instruction: %aud = uitofp i16 %a to double
+; GFX950: Cost Model: Found an estimated cost of 2 for instruction: %csd = sitofp i31 %c to double
+; GFX950: Cost Model: Found an estimated cost of 2 for instruction: %cud = uitofp i31 %c to double
+; GFX950: Cost Model: Found an estimated cost of 4 for instruction: %dsd = sitofp i12 %d to double
+; GFX950: Cost Model: Found an estimated cost of 2 for instruction: %dud = uitofp i12 %d to double
; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %fsf = sitofp i8 %f to float
; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %fuf = uitofp i8 %f to float
; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %fsh = sitofp i8 %f to half
; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %fuh = uitofp i8 %f to half
-; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %fsd = sitofp i8 %f to double
-; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %fud = uitofp i8 %f to double
+; GFX950: Cost Model: Found an estimated cost of 2 for instruction: %fsd = sitofp i8 %f to double
+; GFX950: Cost Model: Found an estimated cost of 2 for instruction: %fud = uitofp i8 %f to double
;
; GFX1250-FAKE16-LABEL: 'wide_scalars_to_fp'
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %asf = sitofp i16 %a to float
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %auf = uitofp i16 %a to float
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %asf = sitofp i16 %a to float
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %auf = uitofp i16 %a to float
; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %ash = sitofp i16 %a to half
; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %auh = uitofp i16 %a to half
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %bsf = sitofp i17 %b to float
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %buf = uitofp i17 %b to float
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %bsh = sitofp i17 %b to half
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %buh = uitofp i17 %b to half
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %bsd = sitofp i17 %b to double
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %bud = uitofp i17 %b to double
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp i31 %c to float
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %cuf = uitofp i31 %c to float
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %csh = sitofp i31 %c to half
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %cuh = uitofp i31 %c to half
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %dsf = sitofp i12 %d to float
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %duf = uitofp i12 %d to float
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %dsh = sitofp i12 %d to half
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %duh = uitofp i12 %d to half
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %bsf = sitofp i17 %b to float
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %buf = uitofp i17 %b to float
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 3 for instruction: %bsh = sitofp i17 %b to half
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 3 for instruction: %buh = uitofp i17 %b to half
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 5 for instruction: %bsd = sitofp i17 %b to double
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 5 for instruction: %bud = uitofp i17 %b to double
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %csf = sitofp i31 %c to float
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %cuf = uitofp i31 %c to float
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 3 for instruction: %csh = sitofp i31 %c to half
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 3 for instruction: %cuh = uitofp i31 %c to half
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 4 for instruction: %dsf = sitofp i12 %d to float
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %duf = uitofp i12 %d to float
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 3 for instruction: %dsh = sitofp i12 %d to half
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %duh = uitofp i12 %d to half
; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %esf = sitofp i32 %e to float
; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %euf = uitofp i32 %e to float
; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %esh = sitofp i32 %e to half
; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %euh = uitofp i32 %e to half
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %asd = sitofp i16 %a to double
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %aud = uitofp i16 %a to double
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %csd = sitofp i31 %c to double
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %cud = uitofp i31 %c to double
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %dsd = sitofp i12 %d to double
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %dud = uitofp i12 %d to double
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %fsf = sitofp i8 %f to float
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 5 for instruction: %asd = sitofp i16 %a to double
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 5 for instruction: %aud = uitofp i16 %a to double
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 5 for instruction: %csd = sitofp i31 %c to double
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 5 for instruction: %cud = uitofp i31 %c to double
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 7 for instruction: %dsd = sitofp i12 %d to double
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 5 for instruction: %dud = uitofp i12 %d to double
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %fsf = sitofp i8 %f to float
; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %fuf = uitofp i8 %f to float
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %fsh = sitofp i8 %f to half
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %fuh = uitofp i8 %f to half
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %fsd = sitofp i8 %f to double
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %fud = uitofp i8 %f to double
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %fsh = sitofp i8 %f to half
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %fuh = uitofp i8 %f to half
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 5 for instruction: %fsd = sitofp i8 %f to double
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 5 for instruction: %fud = uitofp i8 %f to double
;
; GFX1250-TRUE16-LABEL: 'wide_scalars_to_fp'
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %asf = sitofp i16 %a to float
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %auf = uitofp i16 %a to float
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %asf = sitofp i16 %a to float
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %auf = uitofp i16 %a to float
; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %ash = sitofp i16 %a to half
; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %auh = uitofp i16 %a to half
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %bsf = sitofp i17 %b to float
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %buf = uitofp i17 %b to float
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %bsh = sitofp i17 %b to half
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %buh = uitofp i17 %b to half
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %bsd = sitofp i17 %b to double
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %bud = uitofp i17 %b to double
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp i31 %c to float
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %cuf = uitofp i31 %c to float
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %csh = sitofp i31 %c to half
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %cuh = uitofp i31 %c to half
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %dsf = sitofp i12 %d to float
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %duf = uitofp i12 %d to float
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %dsh = sitofp i12 %d to half
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %duh = uitofp i12 %d to half
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %bsf = sitofp i17 %b to float
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %buf = uitofp i17 %b to float
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 3 for instruction: %bsh = sitofp i17 %b to half
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 3 for instruction: %buh = uitofp i17 %b to half
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 5 for instruction: %bsd = sitofp i17 %b to double
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 5 for instruction: %bud = uitofp i17 %b to double
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %csf = sitofp i31 %c to float
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %cuf = uitofp i31 %c to float
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 3 for instruction: %csh = sitofp i31 %c to half
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 3 for instruction: %cuh = uitofp i31 %c to half
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 4 for instruction: %dsf = sitofp i12 %d to float
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %duf = uitofp i12 %d to float
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 3 for instruction: %dsh = sitofp i12 %d to half
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %duh = uitofp i12 %d to half
; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %esf = sitofp i32 %e to float
; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %euf = uitofp i32 %e to float
; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %esh = sitofp i32 %e to half
; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %euh = uitofp i32 %e to half
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %asd = sitofp i16 %a to double
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %aud = uitofp i16 %a to double
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %csd = sitofp i31 %c to double
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %cud = uitofp i31 %c to double
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %dsd = sitofp i12 %d to double
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %dud = uitofp i12 %d to double
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %fsf = sitofp i8 %f to float
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 5 for instruction: %asd = sitofp i16 %a to double
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 5 for instruction: %aud = uitofp i16 %a to double
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 5 for instruction: %csd = sitofp i31 %c to double
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 5 for instruction: %cud = uitofp i31 %c to double
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 7 for instruction: %dsd = sitofp i12 %d to double
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 5 for instruction: %dud = uitofp i12 %d to double
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %fsf = sitofp i8 %f to float
; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %fuf = uitofp i8 %f to float
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %fsh = sitofp i8 %f to half
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %fuh = uitofp i8 %f to half
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %fsd = sitofp i8 %f to double
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %fud = uitofp i8 %f to double
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %fsh = sitofp i8 %f to half
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %fuh = uitofp i8 %f to half
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 5 for instruction: %fsd = sitofp i8 %f to double
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 5 for instruction: %fud = uitofp i8 %f to double
;
; GFX6-SIZE-LABEL: 'wide_scalars_to_fp'
-; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %asf = sitofp i16 %a to float
-; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %auf = uitofp i16 %a to float
-; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %ash = sitofp i16 %a to half
-; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %auh = uitofp i16 %a to half
-; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %bsf = sitofp i17 %b to float
-; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %buf = uitofp i17 %b to float
-; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %bsh = sitofp i17 %b to half
-; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %buh = uitofp i17 %b to half
-; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %bsd = sitofp i17 %b to double
-; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %bud = uitofp i17 %b to double
-; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp i31 %c to float
-; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %cuf = uitofp i31 %c to float
-; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %csh = sitofp i31 %c to half
-; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %cuh = uitofp i31 %c to half
-; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %dsf = sitofp i12 %d to float
-; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %duf = uitofp i12 %d to float
-; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %dsh = sitofp i12 %d to half
-; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %duh = uitofp i12 %d to half
+; GFX6-SIZE: Cost Model: Found an estimated cost of 2 for instruction: %asf = sitofp i16 %a to float
+; GFX6-SIZE: Cost Model: Found an estimated cost of 2 for instruction: %auf = uitofp i16 %a to float
+; GFX6-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i16 %a to half
+; GFX6-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %auh = uitofp i16 %a to half
+; GFX6-SIZE: Cost Model: Found an estimated cost of 2 for instruction: %bsf = sitofp i17 %b to float
+; GFX6-SIZE: Cost Model: Found an estimated cost of 2 for instruction: %buf = uitofp i17 %b to float
+; GFX6-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %bsh = sitofp i17 %b to half
+; GFX6-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %buh = uitofp i17 %b to half
+; GFX6-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %bsd = sitofp i17 %b to double
+; GFX6-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %bud = uitofp i17 %b to double
+; GFX6-SIZE: Cost Model: Found an estimated cost of 2 for instruction: %csf = sitofp i31 %c to float
+; GFX6-SIZE: Cost Model: Found an estimated cost of 2 for instruction: %cuf = uitofp i31 %c to float
+; GFX6-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %csh = sitofp i31 %c to half
+; GFX6-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %cuh = uitofp i31 %c to half
+; GFX6-SIZE: Cost Model: Found an estimated cost of 2 for instruction: %dsf = sitofp i12 %d to float
+; GFX6-SIZE: Cost Model: Found an estimated cost of 2 for instruction: %duf = uitofp i12 %d to float
+; GFX6-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %dsh = sitofp i12 %d to half
+; GFX6-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %duh = uitofp i12 %d to half
; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %esf = sitofp i32 %e to float
; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %euf = uitofp i32 %e to float
; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %esh = sitofp i32 %e to half
; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %euh = uitofp i32 %e to half
-; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %asd = sitofp i16 %a to double
-; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %aud = uitofp i16 %a to double
-; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %csd = sitofp i31 %c to double
-; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %cud = uitofp i31 %c to double
-; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %dsd = sitofp i12 %d to double
-; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %dud = uitofp i12 %d to double
-; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %fsf = sitofp i8 %f to float
+; GFX6-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %asd = sitofp i16 %a to double
+; GFX6-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %aud = uitofp i16 %a to double
+; GFX6-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %csd = sitofp i31 %c to double
+; GFX6-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %cud = uitofp i31 %c to double
+; GFX6-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %dsd = sitofp i12 %d to double
+; GFX6-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %dud = uitofp i12 %d to double
+; GFX6-SIZE: Cost Model: Found an estimated cost of 2 for instruction: %fsf = sitofp i8 %f to float
; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %fuf = uitofp i8 %f to float
-; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %fsh = sitofp i8 %f to half
-; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %fuh = uitofp i8 %f to half
-; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %fsd = sitofp i8 %f to double
-; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %fud = uitofp i8 %f to double
+; GFX6-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %fsh = sitofp i8 %f to half
+; GFX6-SIZE: Cost Model: Found an estimated cost of 2 for instruction: %fuh = uitofp i8 %f to half
+; GFX6-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %fsd = sitofp i8 %f to double
+; GFX6-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %fud = uitofp i8 %f to double
;
; GFX9-SIZE-LABEL: 'wide_scalars_to_fp'
; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %asf = sitofp i16 %a to float
; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %auf = uitofp i16 %a to float
; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %ash = sitofp i16 %a to half
; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %auh = uitofp i16 %a to half
-; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %bsf = sitofp i17 %b to float
-; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %buf = uitofp i17 %b to float
-; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %bsh = sitofp i17 %b to half
-; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %buh = uitofp i17 %b to half
-; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %bsd = sitofp i17 %b to double
-; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %bud = uitofp i17 %b to double
-; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp i31 %c to float
-; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %cuf = uitofp i31 %c to float
-; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %csh = sitofp i31 %c to half
-; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %cuh = uitofp i31 %c to half
-; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %dsf = sitofp i12 %d to float
-; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %duf = uitofp i12 %d to float
-; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %dsh = sitofp i12 %d to half
-; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %duh = uitofp i12 %d to half
+; GFX9-SIZE: Cost Model: Found an estimated cost of 2 for instruction: %bsf = sitofp i17 %b to float
+; GFX9-SIZE: Cost Model: Found an estimated cost of 2 for instruction: %buf = uitofp i17 %b to float
+; GFX9-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %bsh = sitofp i17 %b to half
+; GFX9-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %buh = uitofp i17 %b to half
+; GFX9-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %bsd = sitofp i17 %b to double
+; GFX9-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %bud = uitofp i17 %b to double
+; GFX9-SIZE: Cost Model: Found an estimated cost of 2 for instruction: %csf = sitofp i31 %c to float
+; GFX9-SIZE: Cost Model: Found an estimated cost of 2 for instruction: %cuf = uitofp i31 %c to float
+; GFX9-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %csh = sitofp i31 %c to half
+; GFX9-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %cuh = uitofp i31 %c to half
+; GFX9-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %dsf = sitofp i12 %d to float
+; GFX9-SIZE: Cost Model: Found an estimated cost of 2 for instruction: %duf = uitofp i12 %d to float
+; GFX9-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %dsh = sitofp i12 %d to half
+; GFX9-SIZE: Cost Model: Found an estimated cost of 2 for instruction: %duh = uitofp i12 %d to half
; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %esf = sitofp i32 %e to float
; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %euf = uitofp i32 %e to float
; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %esh = sitofp i32 %e to half
; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %euh = uitofp i32 %e to half
-; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %asd = sitofp i16 %a to double
-; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %aud = uitofp i16 %a to double
-; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %csd = sitofp i31 %c to double
-; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %cud = uitofp i31 %c to double
-; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %dsd = sitofp i12 %d to double
-; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %dud = uitofp i12 %d to double
+; GFX9-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %asd = sitofp i16 %a to double
+; GFX9-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %aud = uitofp i16 %a to double
+; GFX9-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %csd = sitofp i31 %c to double
+; GFX9-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %cud = uitofp i31 %c to double
+; GFX9-SIZE: Cost Model: Found an estimated cost of 5 for instruction: %dsd = sitofp i12 %d to double
+; GFX9-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %dud = uitofp i12 %d to double
; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %fsf = sitofp i8 %f to float
; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %fuf = uitofp i8 %f to float
; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %fsh = sitofp i8 %f to half
; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %fuh = uitofp i8 %f to half
-; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %fsd = sitofp i8 %f to double
-; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %fud = uitofp i8 %f to double
+; GFX9-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %fsd = sitofp i8 %f to double
+; GFX9-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %fud = uitofp i8 %f to double
;
%asf = sitofp i16 %a to float
%auf = uitofp i16 %a to float
@@ -705,132 +705,132 @@ define void @wide_scalars_to_fp(i16 %a, i17 %b, i31 %c, i12 %d, i32 %e, i8 %f) {
define void @loaded_scalars_to_fp(ptr addrspace(1) %p) {
; NO16BIT-LABEL: 'loaded_scalars_to_fp'
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %ash = sitofp i24 %a to half
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %buh = uitofp i24 %b to half
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp i24 %c to float
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %duf = uitofp i24 %d to float
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %esd = sitofp i24 %e to double
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %fud = uitofp i24 %f to double
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %gsh = sitofp i24 %g to half
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %guh = uitofp i24 %g to half
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %hsh = sitofp i24 %h to half
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %ish = sitofp i16 %i to half
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %jsh = sitofp i8 %j to half
+; NO16BIT: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
+; NO16BIT: Cost Model: Found an estimated cost of 3 for instruction: %buh = uitofp i24 %b to half
+; NO16BIT: Cost Model: Found an estimated cost of 2 for instruction: %csf = sitofp i24 %c to float
+; NO16BIT: Cost Model: Found an estimated cost of 2 for instruction: %duf = uitofp i24 %d to float
+; NO16BIT: Cost Model: Found an estimated cost of 5 for instruction: %esd = sitofp i24 %e to double
+; NO16BIT: Cost Model: Found an estimated cost of 5 for instruction: %fud = uitofp i24 %f to double
+; NO16BIT: Cost Model: Found an estimated cost of 3 for instruction: %gsh = sitofp i24 %g to half
+; NO16BIT: Cost Model: Found an estimated cost of 3 for instruction: %guh = uitofp i24 %g to half
+; NO16BIT: Cost Model: Found an estimated cost of 3 for instruction: %hsh = sitofp i24 %h to half
+; NO16BIT: Cost Model: Found an estimated cost of 3 for instruction: %ish = sitofp i16 %i to half
+; NO16BIT: Cost Model: Found an estimated cost of 3 for instruction: %jsh = sitofp i8 %j to half
;
; GFX9-LABEL: 'loaded_scalars_to_fp'
-; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %ash = sitofp i24 %a to half
-; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %buh = uitofp i24 %b to half
-; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp i24 %c to float
-; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %duf = uitofp i24 %d to float
-; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %esd = sitofp i24 %e to double
-; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %fud = uitofp i24 %f to double
-; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %gsh = sitofp i24 %g to half
-; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %guh = uitofp i24 %g to half
-; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %hsh = sitofp i24 %h to half
+; GFX9: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
+; GFX9: Cost Model: Found an estimated cost of 3 for instruction: %buh = uitofp i24 %b to half
+; GFX9: Cost Model: Found an estimated cost of 2 for instruction: %csf = sitofp i24 %c to float
+; GFX9: Cost Model: Found an estimated cost of 2 for instruction: %duf = uitofp i24 %d to float
+; GFX9: Cost Model: Found an estimated cost of 5 for instruction: %esd = sitofp i24 %e to double
+; GFX9: Cost Model: Found an estimated cost of 5 for instruction: %fud = uitofp i24 %f to double
+; GFX9: Cost Model: Found an estimated cost of 3 for instruction: %gsh = sitofp i24 %g to half
+; GFX9: Cost Model: Found an estimated cost of 3 for instruction: %guh = uitofp i24 %g to half
+; GFX9: Cost Model: Found an estimated cost of 3 for instruction: %hsh = sitofp i24 %h to half
; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %ish = sitofp i16 %i to half
; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %jsh = sitofp i8 %j to half
;
; GFX9-NOSDWA-LABEL: 'loaded_scalars_to_fp'
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %ash = sitofp i24 %a to half
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %buh = uitofp i24 %b to half
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp i24 %c to float
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %duf = uitofp i24 %d to float
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %esd = sitofp i24 %e to double
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %fud = uitofp i24 %f to double
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %gsh = sitofp i24 %g to half
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %guh = uitofp i24 %g to half
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %hsh = sitofp i24 %h to half
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 3 for instruction: %buh = uitofp i24 %b to half
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 2 for instruction: %csf = sitofp i24 %c to float
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 2 for instruction: %duf = uitofp i24 %d to float
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 5 for instruction: %esd = sitofp i24 %e to double
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 5 for instruction: %fud = uitofp i24 %f to double
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 3 for instruction: %gsh = sitofp i24 %g to half
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 3 for instruction: %guh = uitofp i24 %g to half
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 3 for instruction: %hsh = sitofp i24 %h to half
; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %ish = sitofp i16 %i to half
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %jsh = sitofp i8 %j to half
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 2 for instruction: %jsh = sitofp i8 %j to half
;
; GFX11-FAKE16-LABEL: 'loaded_scalars_to_fp'
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %ash = sitofp i24 %a to half
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %buh = uitofp i24 %b to half
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp i24 %c to float
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %duf = uitofp i24 %d to float
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %esd = sitofp i24 %e to double
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %fud = uitofp i24 %f to double
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %gsh = sitofp i24 %g to half
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %guh = uitofp i24 %g to half
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %hsh = sitofp i24 %h to half
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 3 for instruction: %buh = uitofp i24 %b to half
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %csf = sitofp i24 %c to float
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %duf = uitofp i24 %d to float
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 5 for instruction: %esd = sitofp i24 %e to double
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 5 for instruction: %fud = uitofp i24 %f to double
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 3 for instruction: %gsh = sitofp i24 %g to half
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 3 for instruction: %guh = uitofp i24 %g to half
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 3 for instruction: %hsh = sitofp i24 %h to half
; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %ish = sitofp i16 %i to half
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %jsh = sitofp i8 %j to half
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %jsh = sitofp i8 %j to half
;
; GFX11-TRUE16-LABEL: 'loaded_scalars_to_fp'
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %ash = sitofp i24 %a to half
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %buh = uitofp i24 %b to half
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp i24 %c to float
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %duf = uitofp i24 %d to float
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %esd = sitofp i24 %e to double
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %fud = uitofp i24 %f to double
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %gsh = sitofp i24 %g to half
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %guh = uitofp i24 %g to half
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %hsh = sitofp i24 %h to half
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 3 for instruction: %buh = uitofp i24 %b to half
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %csf = sitofp i24 %c to float
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %duf = uitofp i24 %d to float
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 5 for instruction: %esd = sitofp i24 %e to double
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 5 for instruction: %fud = uitofp i24 %f to double
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 3 for instruction: %gsh = sitofp i24 %g to half
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 3 for instruction: %guh = uitofp i24 %g to half
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 3 for instruction: %hsh = sitofp i24 %h to half
; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %ish = sitofp i16 %i to half
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %jsh = sitofp i8 %j to half
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %jsh = sitofp i8 %j to half
;
; GFX950-LABEL: 'loaded_scalars_to_fp'
-; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %ash = sitofp i24 %a to half
-; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %buh = uitofp i24 %b to half
-; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp i24 %c to float
-; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %duf = uitofp i24 %d to float
-; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %esd = sitofp i24 %e to double
-; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %fud = uitofp i24 %f to double
-; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %gsh = sitofp i24 %g to half
-; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %guh = uitofp i24 %g to half
-; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %hsh = sitofp i24 %h to half
+; GFX950: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
+; GFX950: Cost Model: Found an estimated cost of 3 for instruction: %buh = uitofp i24 %b to half
+; GFX950: Cost Model: Found an estimated cost of 2 for instruction: %csf = sitofp i24 %c to float
+; GFX950: Cost Model: Found an estimated cost of 2 for instruction: %duf = uitofp i24 %d to float
+; GFX950: Cost Model: Found an estimated cost of 2 for instruction: %esd = sitofp i24 %e to double
+; GFX950: Cost Model: Found an estimated cost of 2 for instruction: %fud = uitofp i24 %f to double
+; GFX950: Cost Model: Found an estimated cost of 3 for instruction: %gsh = sitofp i24 %g to half
+; GFX950: Cost Model: Found an estimated cost of 3 for instruction: %guh = uitofp i24 %g to half
+; GFX950: Cost Model: Found an estimated cost of 3 for instruction: %hsh = sitofp i24 %h to half
; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %ish = sitofp i16 %i to half
; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %jsh = sitofp i8 %j to half
;
; GFX1250-FAKE16-LABEL: 'loaded_scalars_to_fp'
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %ash = sitofp i24 %a to half
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %buh = uitofp i24 %b to half
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp i24 %c to float
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %duf = uitofp i24 %d to float
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %esd = sitofp i24 %e to double
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %fud = uitofp i24 %f to double
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %gsh = sitofp i24 %g to half
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %guh = uitofp i24 %g to half
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %hsh = sitofp i24 %h to half
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 3 for instruction: %buh = uitofp i24 %b to half
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %csf = sitofp i24 %c to float
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %duf = uitofp i24 %d to float
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 5 for instruction: %esd = sitofp i24 %e to double
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 5 for instruction: %fud = uitofp i24 %f to double
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 3 for instruction: %gsh = sitofp i24 %g to half
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 3 for instruction: %guh = uitofp i24 %g to half
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 3 for instruction: %hsh = sitofp i24 %h to half
; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %ish = sitofp i16 %i to half
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %jsh = sitofp i8 %j to half
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %jsh = sitofp i8 %j to half
;
; GFX1250-TRUE16-LABEL: 'loaded_scalars_to_fp'
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %ash = sitofp i24 %a to half
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %buh = uitofp i24 %b to half
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp i24 %c to float
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %duf = uitofp i24 %d to float
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %esd = sitofp i24 %e to double
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %fud = uitofp i24 %f to double
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %gsh = sitofp i24 %g to half
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %guh = uitofp i24 %g to half
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %hsh = sitofp i24 %h to half
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 3 for instruction: %buh = uitofp i24 %b to half
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %csf = sitofp i24 %c to float
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %duf = uitofp i24 %d to float
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 5 for instruction: %esd = sitofp i24 %e to double
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 5 for instruction: %fud = uitofp i24 %f to double
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 3 for instruction: %gsh = sitofp i24 %g to half
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 3 for instruction: %guh = uitofp i24 %g to half
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 3 for instruction: %hsh = sitofp i24 %h to half
; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %ish = sitofp i16 %i to half
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %jsh = sitofp i8 %j to half
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %jsh = sitofp i8 %j to half
;
; GFX6-SIZE-LABEL: 'loaded_scalars_to_fp'
-; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %ash = sitofp i24 %a to half
-; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %buh = uitofp i24 %b to half
-; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp i24 %c to float
-; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %duf = uitofp i24 %d to float
-; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %esd = sitofp i24 %e to double
-; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %fud = uitofp i24 %f to double
-; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %gsh = sitofp i24 %g to half
-; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %guh = uitofp i24 %g to half
-; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %hsh = sitofp i24 %h to half
-; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %ish = sitofp i16 %i to half
-; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %jsh = sitofp i8 %j to half
+; GFX6-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
+; GFX6-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %buh = uitofp i24 %b to half
+; GFX6-SIZE: Cost Model: Found an estimated cost of 2 for instruction: %csf = sitofp i24 %c to float
+; GFX6-SIZE: Cost Model: Found an estimated cost of 2 for instruction: %duf = uitofp i24 %d to float
+; GFX6-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %esd = sitofp i24 %e to double
+; GFX6-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %fud = uitofp i24 %f to double
+; GFX6-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %gsh = sitofp i24 %g to half
+; GFX6-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %guh = uitofp i24 %g to half
+; GFX6-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %hsh = sitofp i24 %h to half
+; GFX6-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %ish = sitofp i16 %i to half
+; GFX6-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %jsh = sitofp i8 %j to half
;
; GFX9-SIZE-LABEL: 'loaded_scalars_to_fp'
-; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %ash = sitofp i24 %a to half
-; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %buh = uitofp i24 %b to half
-; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp i24 %c to float
-; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %duf = uitofp i24 %d to float
-; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %esd = sitofp i24 %e to double
-; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %fud = uitofp i24 %f to double
-; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %gsh = sitofp i24 %g to half
-; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %guh = uitofp i24 %g to half
-; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %hsh = sitofp i24 %h to half
+; GFX9-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
+; GFX9-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %buh = uitofp i24 %b to half
+; GFX9-SIZE: Cost Model: Found an estimated cost of 2 for instruction: %csf = sitofp i24 %c to float
+; GFX9-SIZE: Cost Model: Found an estimated cost of 2 for instruction: %duf = uitofp i24 %d to float
+; GFX9-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %esd = sitofp i24 %e to double
+; GFX9-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %fud = uitofp i24 %f to double
+; GFX9-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %gsh = sitofp i24 %g to half
+; GFX9-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %guh = uitofp i24 %g to half
+; GFX9-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %hsh = sitofp i24 %h to half
; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %ish = sitofp i16 %i to half
; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %jsh = sitofp i8 %j to half
;
@@ -1015,104 +1015,104 @@ define void @loaded_wide_scalars_to_fp(ptr addrspace(1) %p) {
define void @loaded_constant_scalars_to_fp(ptr addrspace(4) %p, ptr addrspace(6) %q, ptr addrspace(1) %r) {
; NO16BIT-LABEL: 'loaded_constant_scalars_to_fp'
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %ash = sitofp i24 %a to half
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %bsh = sitofp i24 %b to half
+; NO16BIT: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
+; NO16BIT: Cost Model: Found an estimated cost of 3 for instruction: %bsh = sitofp i24 %b to half
; NO16BIT: Cost Model: Found an estimated cost of 9 for instruction: %cuf = uitofp i48 %c to float
; NO16BIT: Cost Model: Found an estimated cost of 9 for instruction: %duf = uitofp i48 %d to float
; NO16BIT: Cost Model: Found an estimated cost of 15 for instruction: %esh = sitofp i40 %e to half
; NO16BIT: Cost Model: Found an estimated cost of 14 for instruction: %fsf = sitofp i56 %f to float
; NO16BIT: Cost Model: Found an estimated cost of 14 for instruction: %gsf = sitofp i56 %g to float
-; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %hsd = sitofp i24 %h to double
+; NO16BIT: Cost Model: Found an estimated cost of 5 for instruction: %hsd = sitofp i24 %h to double
;
; GFX9-LABEL: 'loaded_constant_scalars_to_fp'
-; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %ash = sitofp i24 %a to half
-; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %bsh = sitofp i24 %b to half
+; GFX9: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
+; GFX9: Cost Model: Found an estimated cost of 3 for instruction: %bsh = sitofp i24 %b to half
; GFX9: Cost Model: Found an estimated cost of 9 for instruction: %cuf = uitofp i48 %c to float
; GFX9: Cost Model: Found an estimated cost of 9 for instruction: %duf = uitofp i48 %d to float
; GFX9: Cost Model: Found an estimated cost of 15 for instruction: %esh = sitofp i40 %e to half
; GFX9: Cost Model: Found an estimated cost of 14 for instruction: %fsf = sitofp i56 %f to float
; GFX9: Cost Model: Found an estimated cost of 14 for instruction: %gsf = sitofp i56 %g to float
-; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %hsd = sitofp i24 %h to double
+; GFX9: Cost Model: Found an estimated cost of 5 for instruction: %hsd = sitofp i24 %h to double
;
; GFX9-NOSDWA-LABEL: 'loaded_constant_scalars_to_fp'
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %ash = sitofp i24 %a to half
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %bsh = sitofp i24 %b to half
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 3 for instruction: %bsh = sitofp i24 %b to half
; GFX9-NOSDWA: Cost Model: Found an estimated cost of 9 for instruction: %cuf = uitofp i48 %c to float
; GFX9-NOSDWA: Cost Model: Found an estimated cost of 9 for instruction: %duf = uitofp i48 %d to float
; GFX9-NOSDWA: Cost Model: Found an estimated cost of 15 for instruction: %esh = sitofp i40 %e to half
; GFX9-NOSDWA: Cost Model: Found an estimated cost of 14 for instruction: %fsf = sitofp i56 %f to float
; GFX9-NOSDWA: Cost Model: Found an estimated cost of 14 for instruction: %gsf = sitofp i56 %g to float
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %hsd = sitofp i24 %h to double
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 5 for instruction: %hsd = sitofp i24 %h to double
;
; GFX11-FAKE16-LABEL: 'loaded_constant_scalars_to_fp'
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %ash = sitofp i24 %a to half
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %bsh = sitofp i24 %b to half
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 3 for instruction: %bsh = sitofp i24 %b to half
; GFX11-FAKE16: Cost Model: Found an estimated cost of 9 for instruction: %cuf = uitofp i48 %c to float
; GFX11-FAKE16: Cost Model: Found an estimated cost of 9 for instruction: %duf = uitofp i48 %d to float
; GFX11-FAKE16: Cost Model: Found an estimated cost of 15 for instruction: %esh = sitofp i40 %e to half
; GFX11-FAKE16: Cost Model: Found an estimated cost of 14 for instruction: %fsf = sitofp i56 %f to float
; GFX11-FAKE16: Cost Model: Found an estimated cost of 14 for instruction: %gsf = sitofp i56 %g to float
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %hsd = sitofp i24 %h to double
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 5 for instruction: %hsd = sitofp i24 %h to double
;
; GFX11-TRUE16-LABEL: 'loaded_constant_scalars_to_fp'
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %ash = sitofp i24 %a to half
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %bsh = sitofp i24 %b to half
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 3 for instruction: %bsh = sitofp i24 %b to half
; GFX11-TRUE16: Cost Model: Found an estimated cost of 9 for instruction: %cuf = uitofp i48 %c to float
; GFX11-TRUE16: Cost Model: Found an estimated cost of 9 for instruction: %duf = uitofp i48 %d to float
; GFX11-TRUE16: Cost Model: Found an estimated cost of 15 for instruction: %esh = sitofp i40 %e to half
; GFX11-TRUE16: Cost Model: Found an estimated cost of 14 for instruction: %fsf = sitofp i56 %f to float
; GFX11-TRUE16: Cost Model: Found an estimated cost of 14 for instruction: %gsf = sitofp i56 %g to float
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %hsd = sitofp i24 %h to double
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 5 for instruction: %hsd = sitofp i24 %h to double
;
; GFX950-LABEL: 'loaded_constant_scalars_to_fp'
-; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %ash = sitofp i24 %a to half
-; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %bsh = sitofp i24 %b to half
+; GFX950: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
+; GFX950: Cost Model: Found an estimated cost of 3 for instruction: %bsh = sitofp i24 %b to half
; GFX950: Cost Model: Found an estimated cost of 9 for instruction: %cuf = uitofp i48 %c to float
; GFX950: Cost Model: Found an estimated cost of 9 for instruction: %duf = uitofp i48 %d to float
; GFX950: Cost Model: Found an estimated cost of 15 for instruction: %esh = sitofp i40 %e to half
; GFX950: Cost Model: Found an estimated cost of 14 for instruction: %fsf = sitofp i56 %f to float
; GFX950: Cost Model: Found an estimated cost of 14 for instruction: %gsf = sitofp i56 %g to float
-; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %hsd = sitofp i24 %h to double
+; GFX950: Cost Model: Found an estimated cost of 2 for instruction: %hsd = sitofp i24 %h to double
;
; GFX1250-FAKE16-LABEL: 'loaded_constant_scalars_to_fp'
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %ash = sitofp i24 %a to half
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %bsh = sitofp i24 %b to half
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 3 for instruction: %bsh = sitofp i24 %b to half
; GFX1250-FAKE16: Cost Model: Found an estimated cost of 9 for instruction: %cuf = uitofp i48 %c to float
; GFX1250-FAKE16: Cost Model: Found an estimated cost of 9 for instruction: %duf = uitofp i48 %d to float
; GFX1250-FAKE16: Cost Model: Found an estimated cost of 15 for instruction: %esh = sitofp i40 %e to half
; GFX1250-FAKE16: Cost Model: Found an estimated cost of 14 for instruction: %fsf = sitofp i56 %f to float
; GFX1250-FAKE16: Cost Model: Found an estimated cost of 14 for instruction: %gsf = sitofp i56 %g to float
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %hsd = sitofp i24 %h to double
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 5 for instruction: %hsd = sitofp i24 %h to double
;
; GFX1250-TRUE16-LABEL: 'loaded_constant_scalars_to_fp'
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %ash = sitofp i24 %a to half
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %bsh = sitofp i24 %b to half
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 3 for instruction: %bsh = sitofp i24 %b to half
; GFX1250-TRUE16: Cost Model: Found an estimated cost of 9 for instruction: %cuf = uitofp i48 %c to float
; GFX1250-TRUE16: Cost Model: Found an estimated cost of 9 for instruction: %duf = uitofp i48 %d to float
; GFX1250-TRUE16: Cost Model: Found an estimated cost of 15 for instruction: %esh = sitofp i40 %e to half
; GFX1250-TRUE16: Cost Model: Found an estimated cost of 14 for instruction: %fsf = sitofp i56 %f to float
; GFX1250-TRUE16: Cost Model: Found an estimated cost of 14 for instruction: %gsf = sitofp i56 %g to float
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %hsd = sitofp i24 %h to double
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 5 for instruction: %hsd = sitofp i24 %h to double
;
; GFX6-SIZE-LABEL: 'loaded_constant_scalars_to_fp'
-; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %ash = sitofp i24 %a to half
-; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %bsh = sitofp i24 %b to half
+; GFX6-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
+; GFX6-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %bsh = sitofp i24 %b to half
; GFX6-SIZE: Cost Model: Found an estimated cost of 9 for instruction: %cuf = uitofp i48 %c to float
; GFX6-SIZE: Cost Model: Found an estimated cost of 9 for instruction: %duf = uitofp i48 %d to float
; GFX6-SIZE: Cost Model: Found an estimated cost of 15 for instruction: %esh = sitofp i40 %e to half
; GFX6-SIZE: Cost Model: Found an estimated cost of 14 for instruction: %fsf = sitofp i56 %f to float
; GFX6-SIZE: Cost Model: Found an estimated cost of 14 for instruction: %gsf = sitofp i56 %g to float
-; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %hsd = sitofp i24 %h to double
+; GFX6-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %hsd = sitofp i24 %h to double
;
; GFX9-SIZE-LABEL: 'loaded_constant_scalars_to_fp'
-; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %ash = sitofp i24 %a to half
-; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %bsh = sitofp i24 %b to half
+; GFX9-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
+; GFX9-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %bsh = sitofp i24 %b to half
; GFX9-SIZE: Cost Model: Found an estimated cost of 9 for instruction: %cuf = uitofp i48 %c to float
; GFX9-SIZE: Cost Model: Found an estimated cost of 9 for instruction: %duf = uitofp i48 %d to float
; GFX9-SIZE: Cost Model: Found an estimated cost of 15 for instruction: %esh = sitofp i40 %e to half
; GFX9-SIZE: Cost Model: Found an estimated cost of 14 for instruction: %fsf = sitofp i56 %f to float
; GFX9-SIZE: Cost Model: Found an estimated cost of 14 for instruction: %gsf = sitofp i56 %g to float
-; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %hsd = sitofp i24 %h to double
+; GFX9-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %hsd = sitofp i24 %h to double
;
%a = load i24, ptr addrspace(4) %p, align 4
%ash = sitofp i24 %a to half
>From 293fc582c7d6feb98ea0daf4028c5c89e97ccd77 Mon Sep 17 00:00:00 2001
From: Dmitry Sidorov <Dmitry.Sidorov at amd.com>
Date: Wed, 23 Sep 2026 00:19:00 +0200
Subject: [PATCH 2/6] format
---
llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
index 3ac6855b2299b..a3366f451172b 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
@@ -1196,7 +1196,7 @@ InstructionCost GCNTTIImpl::getCastInstrCost(unsigned Opcode, Type *Dst,
if (SrcBits > 16)
return Scale(FPTy->isHalfTy() ? 3 : 2);
if (FPTy->isHalfTy() && ST->has16BitInsts())
- return Scale(Narrow ? (IsSigned ? 3 : 2)
+ return Scale(Narrow ? (IsSigned ? 3 : 2)
: SrcBits == 8 && !ST->hasSDWA() ? 2
: 1);
const InstructionCost FloatCost =
>From f161776d203ce7918a3123bbd0a17f23b2d88801 Mon Sep 17 00:00:00 2001
From: Dmitry Sidorov <Dmitry.Sidorov at amd.com>
Date: Tue, 29 Sep 2026 15:42:57 +0200
Subject: [PATCH 3/6] update slp-int-to-fp.ll
---
llvm/test/CodeGen/AMDGPU/slp-int-to-fp.ll | 292 +++++++++-------------
1 file changed, 125 insertions(+), 167 deletions(-)
diff --git a/llvm/test/CodeGen/AMDGPU/slp-int-to-fp.ll b/llvm/test/CodeGen/AMDGPU/slp-int-to-fp.ll
index 5b73c71c29f13..c610efb5af441 100644
--- a/llvm/test/CodeGen/AMDGPU/slp-int-to-fp.ll
+++ b/llvm/test/CodeGen/AMDGPU/slp-int-to-fp.ll
@@ -400,30 +400,30 @@ define void @sitofp_i8_scaled_to_float(ptr addrspace(1) noalias %out, ptr addrsp
; GFX1250-NEXT: s_wait_kmcnt 0x0
; GFX1250-NEXT: global_load_b64 v[2:3], v[2:3], off
; GFX1250-NEXT: s_wait_loadcnt 0x0
-; GFX1250-NEXT: v_bfe_i32 v5, v2, 0, 8
-; GFX1250-NEXT: v_bfe_i32 v6, v2, 8, 8
-; GFX1250-NEXT: v_bfe_i32 v7, v2, 16, 8
-; GFX1250-NEXT: v_dual_ashrrev_i32 v8, 24, v2 :: v_dual_ashrrev_i32 v13, 24, v3
-; GFX1250-NEXT: v_bfe_i32 v9, v3, 0, 8
-; GFX1250-NEXT: v_bfe_i32 v11, v3, 8, 8
-; GFX1250-NEXT: v_bfe_i32 v12, v3, 16, 8
+; GFX1250-NEXT: v_bfe_i32 v5, v2, 8, 8
+; GFX1250-NEXT: v_bfe_i32 v6, v2, 0, 8
+; GFX1250-NEXT: v_dual_ashrrev_i32 v7, 24, v2 :: v_dual_ashrrev_i32 v13, 24, v3
+; GFX1250-NEXT: v_bfe_i32 v8, v2, 16, 8
+; GFX1250-NEXT: v_bfe_i32 v10, v3, 8, 8
+; GFX1250-NEXT: v_bfe_i32 v12, v3, 0, 8
+; GFX1250-NEXT: v_bfe_i32 v14, v3, 16, 8
; GFX1250-NEXT: s_wait_xcnt 0x0
-; GFX1250-NEXT: v_cvt_f32_i32_e32 v2, v5
-; GFX1250-NEXT: v_cvt_f32_i32_e32 v3, v6
-; GFX1250-NEXT: v_cvt_f32_i32_e32 v6, v7
-; GFX1250-NEXT: v_cvt_f32_i32_e32 v7, v8
-; GFX1250-NEXT: v_cvt_f32_i32_e32 v10, v9
-; GFX1250-NEXT: v_cvt_f32_i32_e32 v12, v12
+; GFX1250-NEXT: v_cvt_f32_i32_e32 v3, v5
+; GFX1250-NEXT: v_cvt_f32_i32_e32 v2, v6
+; GFX1250-NEXT: v_cvt_f32_i32_e32 v9, v7
+; GFX1250-NEXT: v_cvt_f32_i32_e32 v8, v8
+; GFX1250-NEXT: v_cvt_f32_i32_e32 v11, v10
+; GFX1250-NEXT: v_cvt_f32_i32_e32 v10, v12
; GFX1250-NEXT: v_cvt_f32_i32_e32 v13, v13
-; GFX1250-NEXT: v_cvt_f32_i32_e32 v11, v11
-; GFX1250-NEXT: v_pk_mul_f32 v[8:9], v[6:7], v[4:5] op_sel_hi:[1,0]
+; GFX1250-NEXT: v_cvt_f32_i32_e32 v12, v14
; GFX1250-NEXT: v_pk_mul_f32 v[6:7], v[2:3], v[4:5] op_sel_hi:[1,0]
-; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
-; GFX1250-NEXT: v_pk_mul_f32 v[12:13], v[12:13], v[4:5] op_sel_hi:[1,0]
-; GFX1250-NEXT: v_pk_mul_f32 v[10:11], v[10:11], v[4:5] op_sel_hi:[1,0]
+; GFX1250-NEXT: v_pk_mul_f32 v[8:9], v[8:9], v[4:5] op_sel_hi:[1,0]
+; GFX1250-NEXT: v_pk_mul_f32 v[2:3], v[10:11], v[4:5] op_sel_hi:[1,0]
+; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_4)
+; GFX1250-NEXT: v_pk_mul_f32 v[4:5], v[12:13], v[4:5] op_sel_hi:[1,0]
; GFX1250-NEXT: s_clause 0x1
; GFX1250-NEXT: global_store_b128 v[0:1], v[6:9], off
-; GFX1250-NEXT: global_store_b128 v[0:1], v[10:13], off offset:16
+; GFX1250-NEXT: global_store_b128 v[0:1], v[2:5], off offset:16
; GFX1250-NEXT: s_set_pc_i64 s[30:31]
%x0 = load i8, ptr addrspace(1) %in, align 1
%c0 = sitofp i8 %x0 to float
@@ -479,20 +479,15 @@ define void @sitofp_i12_to_half(ptr addrspace(1) noalias %out, ptr addrspace(1)
; GFX900: ; %bb.0:
; GFX900-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-NEXT: global_load_dwordx2 v[2:3], v[2:3], off
-; GFX900-NEXT: v_mov_b32_e32 v4, 4
; GFX900-NEXT: s_waitcnt vmcnt(0)
-; GFX900-NEXT: v_lshlrev_b16_e32 v5, 4, v2
-; GFX900-NEXT: v_lshlrev_b16_sdwa v2, v4, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
-; GFX900-NEXT: v_lshlrev_b16_e32 v6, 4, v3
-; GFX900-NEXT: v_lshlrev_b16_sdwa v3, v4, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
-; GFX900-NEXT: v_ashrrev_i16_e32 v4, 4, v5
-; GFX900-NEXT: v_ashrrev_i16_e32 v2, 4, v2
-; GFX900-NEXT: v_ashrrev_i16_e32 v5, 4, v6
-; GFX900-NEXT: v_ashrrev_i16_e32 v3, 4, v3
-; GFX900-NEXT: v_cvt_f16_i16_e32 v4, v4
-; GFX900-NEXT: v_cvt_f16_i16_e32 v2, v2
-; GFX900-NEXT: v_cvt_f16_i16_e32 v5, v5
-; GFX900-NEXT: v_cvt_f16_i16_e32 v3, v3
+; GFX900-NEXT: v_pk_lshlrev_b16 v2, 4, v2 op_sel_hi:[0,1]
+; GFX900-NEXT: v_pk_lshlrev_b16 v3, 4, v3 op_sel_hi:[0,1]
+; GFX900-NEXT: v_pk_ashrrev_i16 v2, 4, v2 op_sel_hi:[0,1]
+; GFX900-NEXT: v_pk_ashrrev_i16 v3, 4, v3 op_sel_hi:[0,1]
+; GFX900-NEXT: v_cvt_f16_i16_e32 v4, v2
+; GFX900-NEXT: v_cvt_f16_i16_sdwa v2, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1
+; GFX900-NEXT: v_cvt_f16_i16_e32 v5, v3
+; GFX900-NEXT: v_cvt_f16_i16_sdwa v3, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1
; GFX900-NEXT: v_pack_b32_f16 v3, v5, v3
; GFX900-NEXT: v_pack_b32_f16 v2, v4, v2
; GFX900-NEXT: global_store_dwordx2 v[0:1], v[2:3], off
@@ -503,22 +498,17 @@ define void @sitofp_i12_to_half(ptr addrspace(1) noalias %out, ptr addrspace(1)
; GFX90A: ; %bb.0:
; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX90A-NEXT: global_load_dwordx2 v[2:3], v[2:3], off
-; GFX90A-NEXT: v_mov_b32_e32 v4, 4
; GFX90A-NEXT: s_waitcnt vmcnt(0)
-; GFX90A-NEXT: v_lshlrev_b16_e32 v5, 4, v2
-; GFX90A-NEXT: v_lshlrev_b16_sdwa v2, v4, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
-; GFX90A-NEXT: v_lshlrev_b16_e32 v6, 4, v3
-; GFX90A-NEXT: v_lshlrev_b16_sdwa v3, v4, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
-; GFX90A-NEXT: v_ashrrev_i16_e32 v4, 4, v5
-; GFX90A-NEXT: v_ashrrev_i16_e32 v2, 4, v2
-; GFX90A-NEXT: v_ashrrev_i16_e32 v5, 4, v6
-; GFX90A-NEXT: v_ashrrev_i16_e32 v3, 4, v3
-; GFX90A-NEXT: v_cvt_f16_i16_e32 v4, v4
-; GFX90A-NEXT: v_cvt_f16_i16_e32 v2, v2
-; GFX90A-NEXT: v_cvt_f16_i16_e32 v5, v5
-; GFX90A-NEXT: v_cvt_f16_i16_e32 v3, v3
-; GFX90A-NEXT: v_pack_b32_f16 v3, v5, v3
-; GFX90A-NEXT: v_pack_b32_f16 v2, v4, v2
+; GFX90A-NEXT: v_pk_lshlrev_b16 v2, 4, v2 op_sel_hi:[0,1]
+; GFX90A-NEXT: v_pk_lshlrev_b16 v3, 4, v3 op_sel_hi:[0,1]
+; GFX90A-NEXT: v_pk_ashrrev_i16 v2, 4, v2 op_sel_hi:[0,1]
+; GFX90A-NEXT: v_pk_ashrrev_i16 v3, 4, v3 op_sel_hi:[0,1]
+; GFX90A-NEXT: v_cvt_f16_i16_e32 v4, v3
+; GFX90A-NEXT: v_cvt_f16_i16_sdwa v3, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1
+; GFX90A-NEXT: v_cvt_f16_i16_e32 v5, v2
+; GFX90A-NEXT: v_cvt_f16_i16_sdwa v2, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1
+; GFX90A-NEXT: v_pack_b32_f16 v3, v4, v3
+; GFX90A-NEXT: v_pack_b32_f16 v2, v5, v2
; GFX90A-NEXT: global_store_dwordx2 v[0:1], v[2:3], off
; GFX90A-NEXT: s_waitcnt vmcnt(0)
; GFX90A-NEXT: s_setpc_b64 s[30:31]
@@ -528,20 +518,15 @@ define void @sitofp_i12_to_half(ptr addrspace(1) noalias %out, ptr addrspace(1)
; GFX1100-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX1100-NEXT: global_load_b64 v[2:3], v[2:3], off
; GFX1100-NEXT: s_waitcnt vmcnt(0)
-; GFX1100-NEXT: v_lshlrev_b16 v2.l, 4, v2.l
-; GFX1100-NEXT: v_lshlrev_b16 v2.h, 4, v2.h
-; GFX1100-NEXT: v_lshlrev_b16 v3.l, 4, v3.l
-; GFX1100-NEXT: v_lshlrev_b16 v3.h, 4, v3.h
-; GFX1100-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
-; GFX1100-NEXT: v_ashrrev_i16 v2.l, 4, v2.l
-; GFX1100-NEXT: v_ashrrev_i16 v2.h, 4, v2.h
-; GFX1100-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
-; GFX1100-NEXT: v_ashrrev_i16 v3.l, 4, v3.l
-; GFX1100-NEXT: v_ashrrev_i16 v3.h, 4, v3.h
-; GFX1100-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
+; GFX1100-NEXT: v_pk_lshlrev_b16 v2, 4, v2 op_sel_hi:[0,1]
+; GFX1100-NEXT: v_pk_lshlrev_b16 v3, 4, v3 op_sel_hi:[0,1]
+; GFX1100-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
+; GFX1100-NEXT: v_pk_ashrrev_i16 v2, 4, v2 op_sel_hi:[0,1]
+; GFX1100-NEXT: v_pk_ashrrev_i16 v3, 4, v3 op_sel_hi:[0,1]
+; GFX1100-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
; GFX1100-NEXT: v_cvt_f16_i16_e32 v2.l, v2.l
; GFX1100-NEXT: v_cvt_f16_i16_e32 v2.h, v2.h
-; GFX1100-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
+; GFX1100-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_4)
; GFX1100-NEXT: v_cvt_f16_i16_e32 v3.l, v3.l
; GFX1100-NEXT: v_cvt_f16_i16_e32 v3.h, v3.h
; GFX1100-NEXT: global_store_b64 v[0:1], v[2:3], off
@@ -554,22 +539,17 @@ define void @sitofp_i12_to_half(ptr addrspace(1) noalias %out, ptr addrspace(1)
; GFX1250-NEXT: global_load_b64 v[2:3], v[2:3], off
; GFX1250-NEXT: s_wait_loadcnt 0x0
; GFX1250-NEXT: s_wait_xcnt 0x0
-; GFX1250-NEXT: v_lshlrev_b16 v2.l, 4, v2.l
-; GFX1250-NEXT: v_lshlrev_b16 v2.h, 4, v2.h
-; GFX1250-NEXT: v_lshlrev_b16 v3.l, 4, v3.l
-; GFX1250-NEXT: v_lshlrev_b16 v3.h, 4, v3.h
-; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
-; GFX1250-NEXT: v_ashrrev_i16 v2.l, 4, v2.l
-; GFX1250-NEXT: v_ashrrev_i16 v2.h, 4, v2.h
-; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
-; GFX1250-NEXT: v_ashrrev_i16 v3.l, 4, v3.l
-; GFX1250-NEXT: v_ashrrev_i16 v3.h, 4, v3.h
-; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
-; GFX1250-NEXT: v_cvt_f16_i16_e32 v2.l, v2.l
-; GFX1250-NEXT: v_cvt_f16_i16_e32 v2.h, v2.h
-; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
+; GFX1250-NEXT: v_pk_lshlrev_b16 v3, 4, v3 op_sel_hi:[0,1]
+; GFX1250-NEXT: v_pk_lshlrev_b16 v2, 4, v2 op_sel_hi:[0,1]
+; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
+; GFX1250-NEXT: v_pk_ashrrev_i16 v3, 4, v3 op_sel_hi:[0,1]
+; GFX1250-NEXT: v_pk_ashrrev_i16 v2, 4, v2 op_sel_hi:[0,1]
+; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
; GFX1250-NEXT: v_cvt_f16_i16_e32 v3.l, v3.l
; GFX1250-NEXT: v_cvt_f16_i16_e32 v3.h, v3.h
+; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_4)
+; GFX1250-NEXT: v_cvt_f16_i16_e32 v2.l, v2.l
+; GFX1250-NEXT: v_cvt_f16_i16_e32 v2.h, v2.h
; GFX1250-NEXT: global_store_b64 v[0:1], v[2:3], off
; GFX1250-NEXT: s_set_pc_i64 s[30:31]
%x0 = load i16, ptr addrspace(1) %in, align 2
@@ -602,22 +582,17 @@ define void @sitofp_i12_to_bfloat(ptr addrspace(1) noalias %out, ptr addrspace(1
; GFX900: ; %bb.0:
; GFX900-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-NEXT: global_load_dwordx2 v[2:3], v[2:3], off
-; GFX900-NEXT: v_mov_b32_e32 v4, 4
; GFX900-NEXT: s_movk_i32 s4, 0x7fff
; GFX900-NEXT: s_mov_b32 s5, 0x7060302
; GFX900-NEXT: s_waitcnt vmcnt(0)
-; GFX900-NEXT: v_lshlrev_b16_e32 v5, 4, v2
-; GFX900-NEXT: v_lshlrev_b16_sdwa v2, v4, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
-; GFX900-NEXT: v_lshlrev_b16_e32 v6, 4, v3
-; GFX900-NEXT: v_lshlrev_b16_sdwa v3, v4, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
-; GFX900-NEXT: v_ashrrev_i16_e32 v4, 4, v5
-; GFX900-NEXT: v_ashrrev_i16_e32 v2, 4, v2
-; GFX900-NEXT: v_cvt_f32_i32_sdwa v4, sext(v4) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_0
-; GFX900-NEXT: v_ashrrev_i16_e32 v5, 4, v6
-; GFX900-NEXT: v_cvt_f32_i32_sdwa v2, sext(v2) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_0
-; GFX900-NEXT: v_ashrrev_i16_e32 v3, 4, v3
-; GFX900-NEXT: v_cvt_f32_i32_sdwa v5, sext(v5) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_0
-; GFX900-NEXT: v_cvt_f32_i32_sdwa v3, sext(v3) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_0
+; GFX900-NEXT: v_pk_lshlrev_b16 v2, 4, v2 op_sel_hi:[0,1]
+; GFX900-NEXT: v_pk_ashrrev_i16 v2, 4, v2 op_sel_hi:[0,1]
+; GFX900-NEXT: v_pk_lshlrev_b16 v3, 4, v3 op_sel_hi:[0,1]
+; GFX900-NEXT: v_cvt_f32_i32_sdwa v4, sext(v2) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_0
+; GFX900-NEXT: v_pk_ashrrev_i16 v3, 4, v3 op_sel_hi:[0,1]
+; GFX900-NEXT: v_cvt_f32_i32_sdwa v2, sext(v2) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1
+; GFX900-NEXT: v_cvt_f32_i32_sdwa v5, sext(v3) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_0
+; GFX900-NEXT: v_cvt_f32_i32_sdwa v3, sext(v3) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1
; GFX900-NEXT: v_bfe_u32 v6, v4, 16, 1
; GFX900-NEXT: v_or_b32_e32 v7, 0x400000, v4
; GFX900-NEXT: v_bfe_u32 v8, v2, 16, 1
@@ -648,44 +623,39 @@ define void @sitofp_i12_to_bfloat(ptr addrspace(1) noalias %out, ptr addrspace(1
; GFX90A: ; %bb.0:
; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX90A-NEXT: global_load_dwordx2 v[2:3], v[2:3], off
-; GFX90A-NEXT: v_mov_b32_e32 v4, 4
; GFX90A-NEXT: s_movk_i32 s4, 0x7fff
; GFX90A-NEXT: s_mov_b32 s5, 0x7060302
; GFX90A-NEXT: s_waitcnt vmcnt(0)
-; GFX90A-NEXT: v_lshlrev_b16_e32 v5, 4, v2
-; GFX90A-NEXT: v_lshlrev_b16_sdwa v2, v4, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
-; GFX90A-NEXT: v_lshlrev_b16_e32 v6, 4, v3
-; GFX90A-NEXT: v_lshlrev_b16_sdwa v3, v4, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
-; GFX90A-NEXT: v_ashrrev_i16_e32 v4, 4, v5
-; GFX90A-NEXT: v_ashrrev_i16_e32 v2, 4, v2
-; GFX90A-NEXT: v_cvt_f32_i32_sdwa v4, sext(v4) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_0
-; GFX90A-NEXT: v_ashrrev_i16_e32 v5, 4, v6
-; GFX90A-NEXT: v_cvt_f32_i32_sdwa v2, sext(v2) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_0
-; GFX90A-NEXT: v_ashrrev_i16_e32 v3, 4, v3
-; GFX90A-NEXT: v_cvt_f32_i32_sdwa v5, sext(v5) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_0
-; GFX90A-NEXT: v_cvt_f32_i32_sdwa v3, sext(v3) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_0
+; GFX90A-NEXT: v_pk_lshlrev_b16 v3, 4, v3 op_sel_hi:[0,1]
+; GFX90A-NEXT: v_pk_ashrrev_i16 v3, 4, v3 op_sel_hi:[0,1]
+; GFX90A-NEXT: v_pk_lshlrev_b16 v2, 4, v2 op_sel_hi:[0,1]
+; GFX90A-NEXT: v_cvt_f32_i32_sdwa v4, sext(v3) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_0
+; GFX90A-NEXT: v_pk_ashrrev_i16 v2, 4, v2 op_sel_hi:[0,1]
+; GFX90A-NEXT: v_cvt_f32_i32_sdwa v3, sext(v3) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1
+; GFX90A-NEXT: v_cvt_f32_i32_sdwa v5, sext(v2) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_0
+; GFX90A-NEXT: v_cvt_f32_i32_sdwa v2, sext(v2) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1
; GFX90A-NEXT: v_bfe_u32 v6, v4, 16, 1
; GFX90A-NEXT: v_or_b32_e32 v7, 0x400000, v4
-; GFX90A-NEXT: v_bfe_u32 v8, v2, 16, 1
+; GFX90A-NEXT: v_bfe_u32 v8, v3, 16, 1
; GFX90A-NEXT: v_add3_u32 v6, v6, v4, s4
; GFX90A-NEXT: v_cmp_u_f32_e32 vcc, v4, v4
-; GFX90A-NEXT: v_or_b32_e32 v9, 0x400000, v2
+; GFX90A-NEXT: v_or_b32_e32 v9, 0x400000, v3
; GFX90A-NEXT: v_bfe_u32 v10, v5, 16, 1
-; GFX90A-NEXT: v_add3_u32 v8, v8, v2, s4
+; GFX90A-NEXT: v_add3_u32 v8, v8, v3, s4
; GFX90A-NEXT: v_cndmask_b32_e32 v4, v6, v7, vcc
-; GFX90A-NEXT: v_cmp_u_f32_e32 vcc, v2, v2
+; GFX90A-NEXT: v_cmp_u_f32_e32 vcc, v3, v3
; GFX90A-NEXT: v_or_b32_e32 v11, 0x400000, v5
-; GFX90A-NEXT: v_bfe_u32 v12, v3, 16, 1
+; GFX90A-NEXT: v_bfe_u32 v12, v2, 16, 1
; GFX90A-NEXT: v_add3_u32 v10, v10, v5, s4
-; GFX90A-NEXT: v_cndmask_b32_e32 v2, v8, v9, vcc
+; GFX90A-NEXT: v_cndmask_b32_e32 v3, v8, v9, vcc
; GFX90A-NEXT: v_cmp_u_f32_e32 vcc, v5, v5
-; GFX90A-NEXT: v_or_b32_e32 v13, 0x400000, v3
-; GFX90A-NEXT: v_add3_u32 v12, v12, v3, s4
+; GFX90A-NEXT: v_or_b32_e32 v13, 0x400000, v2
+; GFX90A-NEXT: v_add3_u32 v12, v12, v2, s4
; GFX90A-NEXT: v_cndmask_b32_e32 v5, v10, v11, vcc
-; GFX90A-NEXT: v_cmp_u_f32_e32 vcc, v3, v3
-; GFX90A-NEXT: v_cndmask_b32_e32 v3, v12, v13, vcc
-; GFX90A-NEXT: v_perm_b32 v3, v3, v5, s5
-; GFX90A-NEXT: v_perm_b32 v2, v2, v4, s5
+; GFX90A-NEXT: v_cmp_u_f32_e32 vcc, v2, v2
+; GFX90A-NEXT: v_cndmask_b32_e32 v2, v12, v13, vcc
+; GFX90A-NEXT: v_perm_b32 v3, v3, v4, s5
+; GFX90A-NEXT: v_perm_b32 v2, v2, v5, s5
; GFX90A-NEXT: global_store_dwordx2 v[0:1], v[2:3], off
; GFX90A-NEXT: s_waitcnt vmcnt(0)
; GFX90A-NEXT: s_setpc_b64 s[30:31]
@@ -695,51 +665,46 @@ define void @sitofp_i12_to_bfloat(ptr addrspace(1) noalias %out, ptr addrspace(1
; GFX1100-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX1100-NEXT: global_load_b64 v[2:3], v[2:3], off
; GFX1100-NEXT: s_waitcnt vmcnt(0)
-; GFX1100-NEXT: v_lshlrev_b16 v2.l, 4, v2.l
-; GFX1100-NEXT: v_lshlrev_b16 v2.h, 4, v2.h
-; GFX1100-NEXT: v_lshlrev_b16 v3.l, 4, v3.l
-; GFX1100-NEXT: v_lshlrev_b16 v3.h, 4, v3.h
-; GFX1100-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
-; GFX1100-NEXT: v_ashrrev_i16 v2.l, 4, v2.l
-; GFX1100-NEXT: v_ashrrev_i16 v4.l, 4, v2.h
-; GFX1100-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
-; GFX1100-NEXT: v_ashrrev_i16 v3.l, 4, v3.l
-; GFX1100-NEXT: v_ashrrev_i16 v5.l, 4, v3.h
-; GFX1100-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
+; GFX1100-NEXT: v_pk_lshlrev_b16 v2, 4, v2 op_sel_hi:[0,1]
+; GFX1100-NEXT: v_pk_lshlrev_b16 v3, 4, v3 op_sel_hi:[0,1]
+; GFX1100-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
+; GFX1100-NEXT: v_pk_ashrrev_i16 v2, 4, v2 op_sel_hi:[0,1]
+; GFX1100-NEXT: v_pk_ashrrev_i16 v3, 4, v3 op_sel_hi:[0,1]
+; GFX1100-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
+; GFX1100-NEXT: v_ashrrev_i32_e32 v4, 16, v2
; GFX1100-NEXT: v_bfe_i32 v2, v2, 0, 16
-; GFX1100-NEXT: v_bfe_i32 v4, v4, 0, 16
-; GFX1100-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
+; GFX1100-NEXT: v_ashrrev_i32_e32 v5, 16, v3
; GFX1100-NEXT: v_bfe_i32 v3, v3, 0, 16
-; GFX1100-NEXT: v_bfe_i32 v5, v5, 0, 16
; GFX1100-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
-; GFX1100-NEXT: v_cvt_f32_i32_e32 v2, v2
; GFX1100-NEXT: v_cvt_f32_i32_e32 v4, v4
+; GFX1100-NEXT: v_cvt_f32_i32_e32 v2, v2
; GFX1100-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
-; GFX1100-NEXT: v_cvt_f32_i32_e32 v3, v3
; GFX1100-NEXT: v_cvt_f32_i32_e32 v5, v5
-; GFX1100-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(SKIP_1) | instid1(VALU_DEP_4)
-; GFX1100-NEXT: v_bfe_u32 v6, v2, 16, 1
-; GFX1100-NEXT: v_or_b32_e32 v7, 0x400000, v2
-; GFX1100-NEXT: v_bfe_u32 v10, v3, 16, 1
+; GFX1100-NEXT: v_cvt_f32_i32_e32 v3, v3
+; GFX1100-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
+; GFX1100-NEXT: v_bfe_u32 v6, v4, 16, 1
+; GFX1100-NEXT: v_bfe_u32 v8, v2, 16, 1
+; GFX1100-NEXT: v_or_b32_e32 v9, 0x400000, v2
+; GFX1100-NEXT: s_delay_alu instid0(VALU_DEP_4)
+; GFX1100-NEXT: v_bfe_u32 v11, v3, 16, 1
; GFX1100-NEXT: v_cmp_u_f32_e32 vcc_lo, v2, v2
-; GFX1100-NEXT: v_bfe_u32 v8, v4, 16, 1
-; GFX1100-NEXT: v_add3_u32 v6, v6, v2, 0x7fff
-; GFX1100-NEXT: v_or_b32_e32 v11, 0x400000, v3
-; GFX1100-NEXT: v_add3_u32 v10, v10, v3, 0x7fff
-; GFX1100-NEXT: v_or_b32_e32 v9, 0x400000, v4
-; GFX1100-NEXT: v_bfe_u32 v12, v5, 16, 1
-; GFX1100-NEXT: v_cndmask_b32_e32 v6, v6, v7, vcc_lo
+; GFX1100-NEXT: v_or_b32_e32 v13, 0x400000, v3
+; GFX1100-NEXT: v_add3_u32 v8, v8, v2, 0x7fff
+; GFX1100-NEXT: v_or_b32_e32 v7, 0x400000, v4
+; GFX1100-NEXT: v_add3_u32 v11, v11, v3, 0x7fff
+; GFX1100-NEXT: v_bfe_u32 v10, v5, 16, 1
+; GFX1100-NEXT: v_add3_u32 v6, v6, v4, 0x7fff
+; GFX1100-NEXT: v_cndmask_b32_e32 v8, v8, v9, vcc_lo
; GFX1100-NEXT: v_cmp_u_f32_e32 vcc_lo, v3, v3
-; GFX1100-NEXT: v_add3_u32 v8, v8, v4, 0x7fff
-; GFX1100-NEXT: v_or_b32_e32 v13, 0x400000, v5
-; GFX1100-NEXT: v_add3_u32 v12, v12, v5, 0x7fff
-; GFX1100-NEXT: v_cndmask_b32_e32 v7, v10, v11, vcc_lo
+; GFX1100-NEXT: v_or_b32_e32 v12, 0x400000, v5
+; GFX1100-NEXT: v_add3_u32 v10, v10, v5, 0x7fff
+; GFX1100-NEXT: v_cndmask_b32_e32 v9, v11, v13, vcc_lo
; GFX1100-NEXT: v_cmp_u_f32_e32 vcc_lo, v4, v4
-; GFX1100-NEXT: v_cndmask_b32_e32 v2, v8, v9, vcc_lo
+; GFX1100-NEXT: v_cndmask_b32_e32 v2, v6, v7, vcc_lo
; GFX1100-NEXT: v_cmp_u_f32_e32 vcc_lo, v5, v5
-; GFX1100-NEXT: v_mov_b16_e32 v2.l, v6.h
-; GFX1100-NEXT: v_cndmask_b32_e32 v3, v12, v13, vcc_lo
-; GFX1100-NEXT: v_mov_b16_e32 v3.l, v7.h
+; GFX1100-NEXT: v_mov_b16_e32 v2.l, v8.h
+; GFX1100-NEXT: v_cndmask_b32_e32 v3, v10, v12, vcc_lo
+; GFX1100-NEXT: v_mov_b16_e32 v3.l, v9.h
; GFX1100-NEXT: global_store_b64 v[0:1], v[2:3], off
; GFX1100-NEXT: s_setpc_b64 s[30:31]
;
@@ -747,33 +712,26 @@ define void @sitofp_i12_to_bfloat(ptr addrspace(1) noalias %out, ptr addrspace(1
; GFX1250: ; %bb.0:
; GFX1250-NEXT: s_wait_loadcnt_dscnt 0x0
; GFX1250-NEXT: s_wait_kmcnt 0x0
-; GFX1250-NEXT: global_load_b64 v[4:5], v[2:3], off
+; GFX1250-NEXT: global_load_b64 v[2:3], v[2:3], off
; GFX1250-NEXT: s_wait_loadcnt 0x0
; GFX1250-NEXT: s_wait_xcnt 0x0
-; GFX1250-NEXT: v_lshlrev_b16 v2.l, 4, v4.l
-; GFX1250-NEXT: v_lshlrev_b16 v2.h, 4, v5.l
-; GFX1250-NEXT: v_lshlrev_b16 v3.l, 4, v5.h
-; GFX1250-NEXT: v_lshlrev_b16 v3.h, 4, v4.h
-; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
-; GFX1250-NEXT: v_ashrrev_i16 v2.l, 4, v2.l
-; GFX1250-NEXT: v_ashrrev_i16 v4.l, 4, v2.h
-; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
-; GFX1250-NEXT: v_ashrrev_i16 v3.l, 4, v3.l
-; GFX1250-NEXT: v_ashrrev_i16 v5.l, 4, v3.h
-; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
-; GFX1250-NEXT: v_bfe_i32 v2, v2, 0, 16
-; GFX1250-NEXT: v_bfe_i32 v4, v4, 0, 16
-; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
+; GFX1250-NEXT: v_pk_lshlrev_b16 v3, 4, v3 op_sel_hi:[0,1]
+; GFX1250-NEXT: v_pk_lshlrev_b16 v2, 4, v2 op_sel_hi:[0,1]
+; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
+; GFX1250-NEXT: v_pk_ashrrev_i16 v3, 4, v3 op_sel_hi:[0,1]
+; GFX1250-NEXT: v_pk_ashrrev_i16 v2, 4, v2 op_sel_hi:[0,1]
+; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_3)
+; GFX1250-NEXT: v_dual_ashrrev_i32 v4, 16, v3 :: v_dual_ashrrev_i32 v5, 16, v2
; GFX1250-NEXT: v_bfe_i32 v3, v3, 0, 16
-; GFX1250-NEXT: v_bfe_i32 v5, v5, 0, 16
-; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
-; GFX1250-NEXT: v_cvt_f32_i32_e32 v2, v2
+; GFX1250-NEXT: v_bfe_i32 v2, v2, 0, 16
; GFX1250-NEXT: v_cvt_f32_i32_e32 v4, v4
; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
-; GFX1250-NEXT: v_cvt_f32_i32_e32 v3, v3
; GFX1250-NEXT: v_cvt_f32_i32_e32 v5, v5
-; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
-; GFX1250-NEXT: v_cvt_pk_bf16_f32 v3, v4, v3
+; GFX1250-NEXT: v_cvt_f32_i32_e32 v3, v3
+; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_2)
+; GFX1250-NEXT: v_cvt_f32_i32_e32 v2, v2
+; GFX1250-NEXT: v_cvt_pk_bf16_f32 v3, v3, v4
+; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_2)
; GFX1250-NEXT: v_cvt_pk_bf16_f32 v2, v2, v5
; GFX1250-NEXT: global_store_b64 v[0:1], v[2:3], off
; GFX1250-NEXT: s_set_pc_i64 s[30:31]
>From 6cbd60ef5fc42bb6c1e3f91530f7889e91607a1b Mon Sep 17 00:00:00 2001
From: Dmitry Sidorov <Dmitry.Sidorov at amd.com>
Date: Wed, 30 Sep 2026 17:59:06 +0200
Subject: [PATCH 4/6] few fixes
---
.../AMDGPU/AMDGPUTargetTransformInfo.cpp | 11 +-
.../CostModel/AMDGPU/narrow-int-to-bfloat.ll | 48 ++---
.../CostModel/AMDGPU/narrow-int-to-fp.ll | 180 +++++++++---------
3 files changed, 124 insertions(+), 115 deletions(-)
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
index a3366f451172b..d65b073f2af19 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
@@ -1109,7 +1109,7 @@ InstructionCost GCNTTIImpl::getCastInstrCost(unsigned Opcode, Type *Dst,
if (SrcBits < 32)
FloatCost = getCastInstrCost(
Opcode, Dst->getWithNewType(Type::getFloatTy(Dst->getContext())),
- Src, CCH, CostKind);
+ Src, CCH, CostKind, I);
// Native rounding can convert a pair. With 16 bit instructions the
// expansion extracts the low significand bit, adds the rounding bias,
@@ -1189,6 +1189,15 @@ InstructionCost GCNTTIImpl::getCastInstrCost(unsigned Opcode, Type *Dst,
// or sign extended first. Without 16 bit instructions a half result is
// rounded from f32.
if (SrcBits >= 8 && SrcBits < 32) {
+ // A 24 bit load is split and its high byte load extends the source.
+ const auto *Load = I && I->getOperand(0)->getType() == Src
+ ? dyn_cast<LoadInst>(I->getOperand(0))
+ : nullptr;
+ if (SrcBits == 24 && Load && Load->isSimple() && Load->hasOneUse()) {
+ if (FPTy->isDoubleTy())
+ return Scale(0, 1);
+ return Scale(FPTy->isHalfTy() ? 2 : 1);
+ }
const bool Narrow = SrcBits > 8 && SrcBits < 16;
const bool SignExtend16 = IsSigned && Narrow && ST->has16BitInsts();
if (FPTy->isDoubleTy())
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 d33d6864a6115..142efad50cb92 100644
--- a/llvm/test/Analysis/CostModel/AMDGPU/narrow-int-to-bfloat.ll
+++ b/llvm/test/Analysis/CostModel/AMDGPU/narrow-int-to-bfloat.ll
@@ -242,33 +242,33 @@ define void @narrow_scalars_to_bfloat(i8 %a, i12 %b, i16 %c, i17 %d, i31 %e) {
define void @loaded_scalars_to_bfloat(ptr addrspace(1) %p) {
; GFX6-LABEL: 'loaded_scalars_to_bfloat'
-; GFX6: Cost Model: Found an estimated cost of 3 for instruction: %as = sitofp i24 %a to bfloat
-; GFX6: Cost Model: Found an estimated cost of 3 for instruction: %bu = uitofp i24 %b to bfloat
+; GFX6: Cost Model: Found an estimated cost of 2 for instruction: %as = sitofp i24 %a to bfloat
+; GFX6: Cost Model: Found an estimated cost of 2 for instruction: %bu = uitofp i24 %b to bfloat
; GFX6: Cost Model: Found an estimated cost of 3 for instruction: %cs = sitofp i16 %c to bfloat
;
; GFX8-LABEL: 'loaded_scalars_to_bfloat'
-; GFX8: Cost Model: Found an estimated cost of 9 for instruction: %as = sitofp i24 %a to bfloat
-; GFX8: Cost Model: Found an estimated cost of 9 for instruction: %bu = uitofp i24 %b to bfloat
+; GFX8: Cost Model: Found an estimated cost of 8 for instruction: %as = sitofp i24 %a to bfloat
+; GFX8: Cost Model: Found an estimated cost of 8 for instruction: %bu = uitofp i24 %b to bfloat
; GFX8: Cost Model: Found an estimated cost of 8 for instruction: %cs = sitofp i16 %c to bfloat
;
; GFX9-LABEL: 'loaded_scalars_to_bfloat'
-; GFX9: Cost Model: Found an estimated cost of 8 for instruction: %as = sitofp i24 %a to bfloat
-; GFX9: Cost Model: Found an estimated cost of 8 for instruction: %bu = uitofp i24 %b to bfloat
+; GFX9: Cost Model: Found an estimated cost of 7 for instruction: %as = sitofp i24 %a to bfloat
+; GFX9: Cost Model: Found an estimated cost of 7 for instruction: %bu = uitofp i24 %b to bfloat
; GFX9: Cost Model: Found an estimated cost of 7 for instruction: %cs = sitofp i16 %c to bfloat
;
; NOSDWA-LABEL: 'loaded_scalars_to_bfloat'
-; NOSDWA: Cost Model: Found an estimated cost of 8 for instruction: %as = sitofp i24 %a to bfloat
-; NOSDWA: Cost Model: Found an estimated cost of 8 for instruction: %bu = uitofp i24 %b to bfloat
+; NOSDWA: Cost Model: Found an estimated cost of 7 for instruction: %as = sitofp i24 %a to bfloat
+; NOSDWA: Cost Model: Found an estimated cost of 7 for instruction: %bu = uitofp i24 %b to bfloat
; NOSDWA: Cost Model: Found an estimated cost of 8 for instruction: %cs = sitofp i16 %c to bfloat
;
; GFX950-LABEL: 'loaded_scalars_to_bfloat'
-; GFX950: Cost Model: Found an estimated cost of 3 for instruction: %as = sitofp i24 %a to bfloat
-; GFX950: Cost Model: Found an estimated cost of 3 for instruction: %bu = uitofp i24 %b to bfloat
+; GFX950: Cost Model: Found an estimated cost of 2 for instruction: %as = sitofp i24 %a to bfloat
+; GFX950: Cost Model: Found an estimated cost of 2 for instruction: %bu = uitofp i24 %b to bfloat
; GFX950: Cost Model: Found an estimated cost of 2 for instruction: %cs = sitofp i16 %c to bfloat
;
; GFX1250-LABEL: 'loaded_scalars_to_bfloat'
-; GFX1250: Cost Model: Found an estimated cost of 3 for instruction: %as = sitofp i24 %a to bfloat
-; GFX1250: Cost Model: Found an estimated cost of 3 for instruction: %bu = uitofp i24 %b to bfloat
+; GFX1250: Cost Model: Found an estimated cost of 2 for instruction: %as = sitofp i24 %a to bfloat
+; GFX1250: Cost Model: Found an estimated cost of 2 for instruction: %bu = uitofp i24 %b to bfloat
; GFX1250: Cost Model: Found an estimated cost of 3 for instruction: %cs = sitofp i16 %c to bfloat
;
%a = load i24, ptr addrspace(1) %p
@@ -322,38 +322,38 @@ define void @loaded_wide_scalars_to_bfloat(ptr addrspace(1) %p) {
define void @loaded_constant_scalars_to_bfloat(ptr addrspace(4) %p, ptr addrspace(1) %r) {
; GFX6-LABEL: 'loaded_constant_scalars_to_bfloat'
-; GFX6: Cost Model: Found an estimated cost of 3 for instruction: %as = sitofp i24 %a to bfloat
-; GFX6: Cost Model: Found an estimated cost of 3 for instruction: %bs = sitofp i24 %b to bfloat
+; GFX6: Cost Model: Found an estimated cost of 2 for instruction: %as = sitofp i24 %a to bfloat
+; GFX6: Cost Model: Found an estimated cost of 2 for instruction: %bs = sitofp i24 %b to bfloat
; GFX6: Cost Model: Found an estimated cost of 10 for instruction: %cu = uitofp i48 %c to bfloat
; GFX6: Cost Model: Found an estimated cost of 10 for instruction: %du = uitofp i48 %d to bfloat
;
; GFX8-LABEL: 'loaded_constant_scalars_to_bfloat'
-; GFX8: Cost Model: Found an estimated cost of 9 for instruction: %as = sitofp i24 %a to bfloat
-; GFX8: Cost Model: Found an estimated cost of 9 for instruction: %bs = sitofp i24 %b to bfloat
+; GFX8: Cost Model: Found an estimated cost of 8 for instruction: %as = sitofp i24 %a to bfloat
+; GFX8: Cost Model: Found an estimated cost of 8 for instruction: %bs = sitofp i24 %b to bfloat
; GFX8: Cost Model: Found an estimated cost of 16 for instruction: %cu = uitofp i48 %c to bfloat
; GFX8: Cost Model: Found an estimated cost of 16 for instruction: %du = uitofp i48 %d to bfloat
;
; GFX9-LABEL: 'loaded_constant_scalars_to_bfloat'
-; GFX9: Cost Model: Found an estimated cost of 8 for instruction: %as = sitofp i24 %a to bfloat
-; GFX9: Cost Model: Found an estimated cost of 8 for instruction: %bs = sitofp i24 %b to bfloat
+; GFX9: Cost Model: Found an estimated cost of 7 for instruction: %as = sitofp i24 %a to bfloat
+; GFX9: Cost Model: Found an estimated cost of 7 for instruction: %bs = sitofp i24 %b to bfloat
; GFX9: Cost Model: Found an estimated cost of 15 for instruction: %cu = uitofp i48 %c to bfloat
; GFX9: Cost Model: Found an estimated cost of 15 for instruction: %du = uitofp i48 %d to bfloat
;
; NOSDWA-LABEL: 'loaded_constant_scalars_to_bfloat'
-; NOSDWA: Cost Model: Found an estimated cost of 8 for instruction: %as = sitofp i24 %a to bfloat
-; NOSDWA: Cost Model: Found an estimated cost of 8 for instruction: %bs = sitofp i24 %b to bfloat
+; NOSDWA: Cost Model: Found an estimated cost of 7 for instruction: %as = sitofp i24 %a to bfloat
+; NOSDWA: Cost Model: Found an estimated cost of 7 for instruction: %bs = sitofp i24 %b to bfloat
; NOSDWA: Cost Model: Found an estimated cost of 15 for instruction: %cu = uitofp i48 %c to bfloat
; NOSDWA: Cost Model: Found an estimated cost of 15 for instruction: %du = uitofp i48 %d to bfloat
;
; GFX950-LABEL: 'loaded_constant_scalars_to_bfloat'
-; GFX950: Cost Model: Found an estimated cost of 3 for instruction: %as = sitofp i24 %a to bfloat
-; GFX950: Cost Model: Found an estimated cost of 3 for instruction: %bs = sitofp i24 %b to bfloat
+; GFX950: Cost Model: Found an estimated cost of 2 for instruction: %as = sitofp i24 %a to bfloat
+; GFX950: Cost Model: Found an estimated cost of 2 for instruction: %bs = sitofp i24 %b to bfloat
; GFX950: Cost Model: Found an estimated cost of 10 for instruction: %cu = uitofp i48 %c to bfloat
; GFX950: Cost Model: Found an estimated cost of 10 for instruction: %du = uitofp i48 %d to bfloat
;
; GFX1250-LABEL: 'loaded_constant_scalars_to_bfloat'
-; GFX1250: Cost Model: Found an estimated cost of 3 for instruction: %as = sitofp i24 %a to bfloat
-; GFX1250: Cost Model: Found an estimated cost of 3 for instruction: %bs = sitofp i24 %b to bfloat
+; GFX1250: Cost Model: Found an estimated cost of 2 for instruction: %as = sitofp i24 %a to bfloat
+; GFX1250: Cost Model: Found an estimated cost of 2 for instruction: %bs = sitofp i24 %b to bfloat
; GFX1250: Cost Model: Found an estimated cost of 10 for instruction: %cu = uitofp i48 %c to bfloat
; GFX1250: Cost Model: Found an estimated cost of 10 for instruction: %du = uitofp i48 %d 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 3b406d0a16fd4..26ac67a0dc926 100644
--- a/llvm/test/Analysis/CostModel/AMDGPU/narrow-int-to-fp.ll
+++ b/llvm/test/Analysis/CostModel/AMDGPU/narrow-int-to-fp.ll
@@ -705,12 +705,12 @@ define void @wide_scalars_to_fp(i16 %a, i17 %b, i31 %c, i12 %d, i32 %e, i8 %f) {
define void @loaded_scalars_to_fp(ptr addrspace(1) %p) {
; NO16BIT-LABEL: 'loaded_scalars_to_fp'
-; NO16BIT: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
-; NO16BIT: Cost Model: Found an estimated cost of 3 for instruction: %buh = uitofp i24 %b to half
-; NO16BIT: Cost Model: Found an estimated cost of 2 for instruction: %csf = sitofp i24 %c to float
-; NO16BIT: Cost Model: Found an estimated cost of 2 for instruction: %duf = uitofp i24 %d to float
-; NO16BIT: Cost Model: Found an estimated cost of 5 for instruction: %esd = sitofp i24 %e to double
-; NO16BIT: Cost Model: Found an estimated cost of 5 for instruction: %fud = uitofp i24 %f to double
+; NO16BIT: Cost Model: Found an estimated cost of 2 for instruction: %ash = sitofp i24 %a to half
+; NO16BIT: Cost Model: Found an estimated cost of 2 for instruction: %buh = uitofp i24 %b to half
+; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp i24 %c to float
+; NO16BIT: Cost Model: Found an estimated cost of 1 for instruction: %duf = uitofp i24 %d to float
+; NO16BIT: Cost Model: Found an estimated cost of 4 for instruction: %esd = sitofp i24 %e to double
+; NO16BIT: Cost Model: Found an estimated cost of 4 for instruction: %fud = uitofp i24 %f to double
; NO16BIT: Cost Model: Found an estimated cost of 3 for instruction: %gsh = sitofp i24 %g to half
; NO16BIT: Cost Model: Found an estimated cost of 3 for instruction: %guh = uitofp i24 %g to half
; NO16BIT: Cost Model: Found an estimated cost of 3 for instruction: %hsh = sitofp i24 %h to half
@@ -718,12 +718,12 @@ define void @loaded_scalars_to_fp(ptr addrspace(1) %p) {
; NO16BIT: Cost Model: Found an estimated cost of 3 for instruction: %jsh = sitofp i8 %j to half
;
; GFX9-LABEL: 'loaded_scalars_to_fp'
-; GFX9: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
-; GFX9: Cost Model: Found an estimated cost of 3 for instruction: %buh = uitofp i24 %b to half
-; GFX9: Cost Model: Found an estimated cost of 2 for instruction: %csf = sitofp i24 %c to float
-; GFX9: Cost Model: Found an estimated cost of 2 for instruction: %duf = uitofp i24 %d to float
-; GFX9: Cost Model: Found an estimated cost of 5 for instruction: %esd = sitofp i24 %e to double
-; GFX9: Cost Model: Found an estimated cost of 5 for instruction: %fud = uitofp i24 %f to double
+; GFX9: Cost Model: Found an estimated cost of 2 for instruction: %ash = sitofp i24 %a to half
+; GFX9: Cost Model: Found an estimated cost of 2 for instruction: %buh = uitofp i24 %b to half
+; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp i24 %c to float
+; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %duf = uitofp i24 %d to float
+; GFX9: Cost Model: Found an estimated cost of 4 for instruction: %esd = sitofp i24 %e to double
+; GFX9: Cost Model: Found an estimated cost of 4 for instruction: %fud = uitofp i24 %f to double
; GFX9: Cost Model: Found an estimated cost of 3 for instruction: %gsh = sitofp i24 %g to half
; GFX9: Cost Model: Found an estimated cost of 3 for instruction: %guh = uitofp i24 %g to half
; GFX9: Cost Model: Found an estimated cost of 3 for instruction: %hsh = sitofp i24 %h to half
@@ -731,12 +731,12 @@ define void @loaded_scalars_to_fp(ptr addrspace(1) %p) {
; GFX9: Cost Model: Found an estimated cost of 1 for instruction: %jsh = sitofp i8 %j to half
;
; GFX9-NOSDWA-LABEL: 'loaded_scalars_to_fp'
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 3 for instruction: %buh = uitofp i24 %b to half
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 2 for instruction: %csf = sitofp i24 %c to float
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 2 for instruction: %duf = uitofp i24 %d to float
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 5 for instruction: %esd = sitofp i24 %e to double
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 5 for instruction: %fud = uitofp i24 %f to double
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 2 for instruction: %ash = sitofp i24 %a to half
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 2 for instruction: %buh = uitofp i24 %b to half
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp i24 %c to float
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 1 for instruction: %duf = uitofp i24 %d to float
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 4 for instruction: %esd = sitofp i24 %e to double
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 4 for instruction: %fud = uitofp i24 %f to double
; GFX9-NOSDWA: Cost Model: Found an estimated cost of 3 for instruction: %gsh = sitofp i24 %g to half
; GFX9-NOSDWA: Cost Model: Found an estimated cost of 3 for instruction: %guh = uitofp i24 %g to half
; GFX9-NOSDWA: Cost Model: Found an estimated cost of 3 for instruction: %hsh = sitofp i24 %h to half
@@ -744,12 +744,12 @@ define void @loaded_scalars_to_fp(ptr addrspace(1) %p) {
; GFX9-NOSDWA: Cost Model: Found an estimated cost of 2 for instruction: %jsh = sitofp i8 %j to half
;
; GFX11-FAKE16-LABEL: 'loaded_scalars_to_fp'
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 3 for instruction: %buh = uitofp i24 %b to half
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %csf = sitofp i24 %c to float
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %duf = uitofp i24 %d to float
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 5 for instruction: %esd = sitofp i24 %e to double
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 5 for instruction: %fud = uitofp i24 %f to double
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %ash = sitofp i24 %a to half
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %buh = uitofp i24 %b to half
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp i24 %c to float
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %duf = uitofp i24 %d to float
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 4 for instruction: %esd = sitofp i24 %e to double
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 4 for instruction: %fud = uitofp i24 %f to double
; GFX11-FAKE16: Cost Model: Found an estimated cost of 3 for instruction: %gsh = sitofp i24 %g to half
; GFX11-FAKE16: Cost Model: Found an estimated cost of 3 for instruction: %guh = uitofp i24 %g to half
; GFX11-FAKE16: Cost Model: Found an estimated cost of 3 for instruction: %hsh = sitofp i24 %h to half
@@ -757,12 +757,12 @@ define void @loaded_scalars_to_fp(ptr addrspace(1) %p) {
; GFX11-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %jsh = sitofp i8 %j to half
;
; GFX11-TRUE16-LABEL: 'loaded_scalars_to_fp'
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 3 for instruction: %buh = uitofp i24 %b to half
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %csf = sitofp i24 %c to float
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %duf = uitofp i24 %d to float
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 5 for instruction: %esd = sitofp i24 %e to double
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 5 for instruction: %fud = uitofp i24 %f to double
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %ash = sitofp i24 %a to half
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %buh = uitofp i24 %b to half
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp i24 %c to float
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %duf = uitofp i24 %d to float
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 4 for instruction: %esd = sitofp i24 %e to double
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 4 for instruction: %fud = uitofp i24 %f to double
; GFX11-TRUE16: Cost Model: Found an estimated cost of 3 for instruction: %gsh = sitofp i24 %g to half
; GFX11-TRUE16: Cost Model: Found an estimated cost of 3 for instruction: %guh = uitofp i24 %g to half
; GFX11-TRUE16: Cost Model: Found an estimated cost of 3 for instruction: %hsh = sitofp i24 %h to half
@@ -770,12 +770,12 @@ define void @loaded_scalars_to_fp(ptr addrspace(1) %p) {
; GFX11-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %jsh = sitofp i8 %j to half
;
; GFX950-LABEL: 'loaded_scalars_to_fp'
-; GFX950: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
-; GFX950: Cost Model: Found an estimated cost of 3 for instruction: %buh = uitofp i24 %b to half
-; GFX950: Cost Model: Found an estimated cost of 2 for instruction: %csf = sitofp i24 %c to float
-; GFX950: Cost Model: Found an estimated cost of 2 for instruction: %duf = uitofp i24 %d to float
-; GFX950: Cost Model: Found an estimated cost of 2 for instruction: %esd = sitofp i24 %e to double
-; GFX950: Cost Model: Found an estimated cost of 2 for instruction: %fud = uitofp i24 %f to double
+; GFX950: Cost Model: Found an estimated cost of 2 for instruction: %ash = sitofp i24 %a to half
+; GFX950: Cost Model: Found an estimated cost of 2 for instruction: %buh = uitofp i24 %b to half
+; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp i24 %c to float
+; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %duf = uitofp i24 %d to float
+; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %esd = sitofp i24 %e to double
+; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %fud = uitofp i24 %f to double
; GFX950: Cost Model: Found an estimated cost of 3 for instruction: %gsh = sitofp i24 %g to half
; GFX950: Cost Model: Found an estimated cost of 3 for instruction: %guh = uitofp i24 %g to half
; GFX950: Cost Model: Found an estimated cost of 3 for instruction: %hsh = sitofp i24 %h to half
@@ -783,12 +783,12 @@ define void @loaded_scalars_to_fp(ptr addrspace(1) %p) {
; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %jsh = sitofp i8 %j to half
;
; GFX1250-FAKE16-LABEL: 'loaded_scalars_to_fp'
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 3 for instruction: %buh = uitofp i24 %b to half
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %csf = sitofp i24 %c to float
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %duf = uitofp i24 %d to float
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 5 for instruction: %esd = sitofp i24 %e to double
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 5 for instruction: %fud = uitofp i24 %f to double
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %ash = sitofp i24 %a to half
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %buh = uitofp i24 %b to half
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp i24 %c to float
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 1 for instruction: %duf = uitofp i24 %d to float
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 4 for instruction: %esd = sitofp i24 %e to double
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 4 for instruction: %fud = uitofp i24 %f to double
; GFX1250-FAKE16: Cost Model: Found an estimated cost of 3 for instruction: %gsh = sitofp i24 %g to half
; GFX1250-FAKE16: Cost Model: Found an estimated cost of 3 for instruction: %guh = uitofp i24 %g to half
; GFX1250-FAKE16: Cost Model: Found an estimated cost of 3 for instruction: %hsh = sitofp i24 %h to half
@@ -796,12 +796,12 @@ define void @loaded_scalars_to_fp(ptr addrspace(1) %p) {
; GFX1250-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %jsh = sitofp i8 %j to half
;
; GFX1250-TRUE16-LABEL: 'loaded_scalars_to_fp'
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 3 for instruction: %buh = uitofp i24 %b to half
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %csf = sitofp i24 %c to float
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %duf = uitofp i24 %d to float
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 5 for instruction: %esd = sitofp i24 %e to double
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 5 for instruction: %fud = uitofp i24 %f to double
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %ash = sitofp i24 %a to half
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %buh = uitofp i24 %b to half
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp i24 %c to float
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 1 for instruction: %duf = uitofp i24 %d to float
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 4 for instruction: %esd = sitofp i24 %e to double
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 4 for instruction: %fud = uitofp i24 %f to double
; GFX1250-TRUE16: Cost Model: Found an estimated cost of 3 for instruction: %gsh = sitofp i24 %g to half
; GFX1250-TRUE16: Cost Model: Found an estimated cost of 3 for instruction: %guh = uitofp i24 %g to half
; GFX1250-TRUE16: Cost Model: Found an estimated cost of 3 for instruction: %hsh = sitofp i24 %h to half
@@ -809,12 +809,12 @@ define void @loaded_scalars_to_fp(ptr addrspace(1) %p) {
; GFX1250-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %jsh = sitofp i8 %j to half
;
; GFX6-SIZE-LABEL: 'loaded_scalars_to_fp'
-; GFX6-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
-; GFX6-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %buh = uitofp i24 %b to half
-; GFX6-SIZE: Cost Model: Found an estimated cost of 2 for instruction: %csf = sitofp i24 %c to float
-; GFX6-SIZE: Cost Model: Found an estimated cost of 2 for instruction: %duf = uitofp i24 %d to float
-; GFX6-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %esd = sitofp i24 %e to double
-; GFX6-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %fud = uitofp i24 %f to double
+; GFX6-SIZE: Cost Model: Found an estimated cost of 2 for instruction: %ash = sitofp i24 %a to half
+; GFX6-SIZE: Cost Model: Found an estimated cost of 2 for instruction: %buh = uitofp i24 %b to half
+; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp i24 %c to float
+; GFX6-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %duf = uitofp i24 %d to float
+; GFX6-SIZE: Cost Model: Found an estimated cost of 2 for instruction: %esd = sitofp i24 %e to double
+; GFX6-SIZE: Cost Model: Found an estimated cost of 2 for instruction: %fud = uitofp i24 %f to double
; GFX6-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %gsh = sitofp i24 %g to half
; GFX6-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %guh = uitofp i24 %g to half
; GFX6-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %hsh = sitofp i24 %h to half
@@ -822,12 +822,12 @@ define void @loaded_scalars_to_fp(ptr addrspace(1) %p) {
; GFX6-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %jsh = sitofp i8 %j to half
;
; GFX9-SIZE-LABEL: 'loaded_scalars_to_fp'
-; GFX9-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
-; GFX9-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %buh = uitofp i24 %b to half
-; GFX9-SIZE: Cost Model: Found an estimated cost of 2 for instruction: %csf = sitofp i24 %c to float
-; GFX9-SIZE: Cost Model: Found an estimated cost of 2 for instruction: %duf = uitofp i24 %d to float
-; GFX9-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %esd = sitofp i24 %e to double
-; GFX9-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %fud = uitofp i24 %f to double
+; GFX9-SIZE: Cost Model: Found an estimated cost of 2 for instruction: %ash = sitofp i24 %a to half
+; GFX9-SIZE: Cost Model: Found an estimated cost of 2 for instruction: %buh = uitofp i24 %b to half
+; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %csf = sitofp i24 %c to float
+; GFX9-SIZE: Cost Model: Found an estimated cost of 1 for instruction: %duf = uitofp i24 %d to float
+; GFX9-SIZE: Cost Model: Found an estimated cost of 2 for instruction: %esd = sitofp i24 %e to double
+; GFX9-SIZE: Cost Model: Found an estimated cost of 2 for instruction: %fud = uitofp i24 %f to double
; GFX9-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %gsh = sitofp i24 %g to half
; GFX9-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %guh = uitofp i24 %g to half
; GFX9-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %hsh = sitofp i24 %h to half
@@ -1015,104 +1015,104 @@ define void @loaded_wide_scalars_to_fp(ptr addrspace(1) %p) {
define void @loaded_constant_scalars_to_fp(ptr addrspace(4) %p, ptr addrspace(6) %q, ptr addrspace(1) %r) {
; NO16BIT-LABEL: 'loaded_constant_scalars_to_fp'
-; NO16BIT: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
-; NO16BIT: Cost Model: Found an estimated cost of 3 for instruction: %bsh = sitofp i24 %b to half
+; NO16BIT: Cost Model: Found an estimated cost of 2 for instruction: %ash = sitofp i24 %a to half
+; NO16BIT: Cost Model: Found an estimated cost of 2 for instruction: %bsh = sitofp i24 %b to half
; NO16BIT: Cost Model: Found an estimated cost of 9 for instruction: %cuf = uitofp i48 %c to float
; NO16BIT: Cost Model: Found an estimated cost of 9 for instruction: %duf = uitofp i48 %d to float
; NO16BIT: Cost Model: Found an estimated cost of 15 for instruction: %esh = sitofp i40 %e to half
; NO16BIT: Cost Model: Found an estimated cost of 14 for instruction: %fsf = sitofp i56 %f to float
; NO16BIT: Cost Model: Found an estimated cost of 14 for instruction: %gsf = sitofp i56 %g to float
-; NO16BIT: Cost Model: Found an estimated cost of 5 for instruction: %hsd = sitofp i24 %h to double
+; NO16BIT: Cost Model: Found an estimated cost of 4 for instruction: %hsd = sitofp i24 %h to double
;
; GFX9-LABEL: 'loaded_constant_scalars_to_fp'
-; GFX9: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
-; GFX9: Cost Model: Found an estimated cost of 3 for instruction: %bsh = sitofp i24 %b to half
+; GFX9: Cost Model: Found an estimated cost of 2 for instruction: %ash = sitofp i24 %a to half
+; GFX9: Cost Model: Found an estimated cost of 2 for instruction: %bsh = sitofp i24 %b to half
; GFX9: Cost Model: Found an estimated cost of 9 for instruction: %cuf = uitofp i48 %c to float
; GFX9: Cost Model: Found an estimated cost of 9 for instruction: %duf = uitofp i48 %d to float
; GFX9: Cost Model: Found an estimated cost of 15 for instruction: %esh = sitofp i40 %e to half
; GFX9: Cost Model: Found an estimated cost of 14 for instruction: %fsf = sitofp i56 %f to float
; GFX9: Cost Model: Found an estimated cost of 14 for instruction: %gsf = sitofp i56 %g to float
-; GFX9: Cost Model: Found an estimated cost of 5 for instruction: %hsd = sitofp i24 %h to double
+; GFX9: Cost Model: Found an estimated cost of 4 for instruction: %hsd = sitofp i24 %h to double
;
; GFX9-NOSDWA-LABEL: 'loaded_constant_scalars_to_fp'
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 3 for instruction: %bsh = sitofp i24 %b to half
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 2 for instruction: %ash = sitofp i24 %a to half
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 2 for instruction: %bsh = sitofp i24 %b to half
; GFX9-NOSDWA: Cost Model: Found an estimated cost of 9 for instruction: %cuf = uitofp i48 %c to float
; GFX9-NOSDWA: Cost Model: Found an estimated cost of 9 for instruction: %duf = uitofp i48 %d to float
; GFX9-NOSDWA: Cost Model: Found an estimated cost of 15 for instruction: %esh = sitofp i40 %e to half
; GFX9-NOSDWA: Cost Model: Found an estimated cost of 14 for instruction: %fsf = sitofp i56 %f to float
; GFX9-NOSDWA: Cost Model: Found an estimated cost of 14 for instruction: %gsf = sitofp i56 %g to float
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 5 for instruction: %hsd = sitofp i24 %h to double
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 4 for instruction: %hsd = sitofp i24 %h to double
;
; GFX11-FAKE16-LABEL: 'loaded_constant_scalars_to_fp'
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 3 for instruction: %bsh = sitofp i24 %b to half
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %ash = sitofp i24 %a to half
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %bsh = sitofp i24 %b to half
; GFX11-FAKE16: Cost Model: Found an estimated cost of 9 for instruction: %cuf = uitofp i48 %c to float
; GFX11-FAKE16: Cost Model: Found an estimated cost of 9 for instruction: %duf = uitofp i48 %d to float
; GFX11-FAKE16: Cost Model: Found an estimated cost of 15 for instruction: %esh = sitofp i40 %e to half
; GFX11-FAKE16: Cost Model: Found an estimated cost of 14 for instruction: %fsf = sitofp i56 %f to float
; GFX11-FAKE16: Cost Model: Found an estimated cost of 14 for instruction: %gsf = sitofp i56 %g to float
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 5 for instruction: %hsd = sitofp i24 %h to double
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 4 for instruction: %hsd = sitofp i24 %h to double
;
; GFX11-TRUE16-LABEL: 'loaded_constant_scalars_to_fp'
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 3 for instruction: %bsh = sitofp i24 %b to half
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %ash = sitofp i24 %a to half
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %bsh = sitofp i24 %b to half
; GFX11-TRUE16: Cost Model: Found an estimated cost of 9 for instruction: %cuf = uitofp i48 %c to float
; GFX11-TRUE16: Cost Model: Found an estimated cost of 9 for instruction: %duf = uitofp i48 %d to float
; GFX11-TRUE16: Cost Model: Found an estimated cost of 15 for instruction: %esh = sitofp i40 %e to half
; GFX11-TRUE16: Cost Model: Found an estimated cost of 14 for instruction: %fsf = sitofp i56 %f to float
; GFX11-TRUE16: Cost Model: Found an estimated cost of 14 for instruction: %gsf = sitofp i56 %g to float
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 5 for instruction: %hsd = sitofp i24 %h to double
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 4 for instruction: %hsd = sitofp i24 %h to double
;
; GFX950-LABEL: 'loaded_constant_scalars_to_fp'
-; GFX950: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
-; GFX950: Cost Model: Found an estimated cost of 3 for instruction: %bsh = sitofp i24 %b to half
+; GFX950: Cost Model: Found an estimated cost of 2 for instruction: %ash = sitofp i24 %a to half
+; GFX950: Cost Model: Found an estimated cost of 2 for instruction: %bsh = sitofp i24 %b to half
; GFX950: Cost Model: Found an estimated cost of 9 for instruction: %cuf = uitofp i48 %c to float
; GFX950: Cost Model: Found an estimated cost of 9 for instruction: %duf = uitofp i48 %d to float
; GFX950: Cost Model: Found an estimated cost of 15 for instruction: %esh = sitofp i40 %e to half
; GFX950: Cost Model: Found an estimated cost of 14 for instruction: %fsf = sitofp i56 %f to float
; GFX950: Cost Model: Found an estimated cost of 14 for instruction: %gsf = sitofp i56 %g to float
-; GFX950: Cost Model: Found an estimated cost of 2 for instruction: %hsd = sitofp i24 %h to double
+; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %hsd = sitofp i24 %h to double
;
; GFX1250-FAKE16-LABEL: 'loaded_constant_scalars_to_fp'
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 3 for instruction: %bsh = sitofp i24 %b to half
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %ash = sitofp i24 %a to half
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %bsh = sitofp i24 %b to half
; GFX1250-FAKE16: Cost Model: Found an estimated cost of 9 for instruction: %cuf = uitofp i48 %c to float
; GFX1250-FAKE16: Cost Model: Found an estimated cost of 9 for instruction: %duf = uitofp i48 %d to float
; GFX1250-FAKE16: Cost Model: Found an estimated cost of 15 for instruction: %esh = sitofp i40 %e to half
; GFX1250-FAKE16: Cost Model: Found an estimated cost of 14 for instruction: %fsf = sitofp i56 %f to float
; GFX1250-FAKE16: Cost Model: Found an estimated cost of 14 for instruction: %gsf = sitofp i56 %g to float
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 5 for instruction: %hsd = sitofp i24 %h to double
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 4 for instruction: %hsd = sitofp i24 %h to double
;
; GFX1250-TRUE16-LABEL: 'loaded_constant_scalars_to_fp'
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 3 for instruction: %bsh = sitofp i24 %b to half
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %ash = sitofp i24 %a to half
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %bsh = sitofp i24 %b to half
; GFX1250-TRUE16: Cost Model: Found an estimated cost of 9 for instruction: %cuf = uitofp i48 %c to float
; GFX1250-TRUE16: Cost Model: Found an estimated cost of 9 for instruction: %duf = uitofp i48 %d to float
; GFX1250-TRUE16: Cost Model: Found an estimated cost of 15 for instruction: %esh = sitofp i40 %e to half
; GFX1250-TRUE16: Cost Model: Found an estimated cost of 14 for instruction: %fsf = sitofp i56 %f to float
; GFX1250-TRUE16: Cost Model: Found an estimated cost of 14 for instruction: %gsf = sitofp i56 %g to float
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 5 for instruction: %hsd = sitofp i24 %h to double
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 4 for instruction: %hsd = sitofp i24 %h to double
;
; GFX6-SIZE-LABEL: 'loaded_constant_scalars_to_fp'
-; GFX6-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
-; GFX6-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %bsh = sitofp i24 %b to half
+; GFX6-SIZE: Cost Model: Found an estimated cost of 2 for instruction: %ash = sitofp i24 %a to half
+; GFX6-SIZE: Cost Model: Found an estimated cost of 2 for instruction: %bsh = sitofp i24 %b to half
; GFX6-SIZE: Cost Model: Found an estimated cost of 9 for instruction: %cuf = uitofp i48 %c to float
; GFX6-SIZE: Cost Model: Found an estimated cost of 9 for instruction: %duf = uitofp i48 %d to float
; GFX6-SIZE: Cost Model: Found an estimated cost of 15 for instruction: %esh = sitofp i40 %e to half
; GFX6-SIZE: Cost Model: Found an estimated cost of 14 for instruction: %fsf = sitofp i56 %f to float
; GFX6-SIZE: Cost Model: Found an estimated cost of 14 for instruction: %gsf = sitofp i56 %g to float
-; GFX6-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %hsd = sitofp i24 %h to double
+; GFX6-SIZE: Cost Model: Found an estimated cost of 2 for instruction: %hsd = sitofp i24 %h to double
;
; GFX9-SIZE-LABEL: 'loaded_constant_scalars_to_fp'
-; GFX9-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
-; GFX9-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %bsh = sitofp i24 %b to half
+; GFX9-SIZE: Cost Model: Found an estimated cost of 2 for instruction: %ash = sitofp i24 %a to half
+; GFX9-SIZE: Cost Model: Found an estimated cost of 2 for instruction: %bsh = sitofp i24 %b to half
; GFX9-SIZE: Cost Model: Found an estimated cost of 9 for instruction: %cuf = uitofp i48 %c to float
; GFX9-SIZE: Cost Model: Found an estimated cost of 9 for instruction: %duf = uitofp i48 %d to float
; GFX9-SIZE: Cost Model: Found an estimated cost of 15 for instruction: %esh = sitofp i40 %e to half
; GFX9-SIZE: Cost Model: Found an estimated cost of 14 for instruction: %fsf = sitofp i56 %f to float
; GFX9-SIZE: Cost Model: Found an estimated cost of 14 for instruction: %gsf = sitofp i56 %g to float
-; GFX9-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %hsd = sitofp i24 %h to double
+; GFX9-SIZE: Cost Model: Found an estimated cost of 2 for instruction: %hsd = sitofp i24 %h to double
;
%a = load i24, ptr addrspace(4) %p, align 4
%ash = sitofp i24 %a to half
>From ca7e60362682a6699cadd6287d1ca301d6a26077 Mon Sep 17 00:00:00 2001
From: Dmitry Sidorov <Dmitry.Sidorov at amd.com>
Date: Thu, 1 Oct 2026 00:33:57 +0200
Subject: [PATCH 5/6] [AMDGPU] Do not price the extension of a loaded i40, i48
or i56 in int to fp casts
A widened constant or invariant load still pays it.
---
.../AMDGPU/AMDGPUTargetTransformInfo.cpp | 24 ++-
.../CostModel/AMDGPU/narrow-int-to-bfloat.ll | 48 ++---
.../CostModel/AMDGPU/narrow-int-to-fp.ll | 200 +++++++++---------
3 files changed, 142 insertions(+), 130 deletions(-)
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
index d65b073f2af19..51d2d4283a7ca 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
@@ -1098,7 +1098,23 @@ InstructionCost GCNTTIImpl::getCastInstrCost(unsigned Opcode, Type *Dst,
};
if (IsIntToFP) {
- const unsigned ExtOps = UsesInt64 && SrcBits < 64 ? (IsSigned ? 2 : 1) : 0;
+ // A scalar load of 24, 40, 48 or 56 bits is split and its high part load
+ // extends the source. A constant or invariant load aligned to 4 bytes may
+ // be widened instead and then still needs the extension.
+ const auto *Load =
+ I && Src->isIntegerTy() && I->getOperand(0)->getType() == Src
+ ? dyn_cast<LoadInst>(I->getOperand(0))
+ : nullptr;
+ const bool LoadMayWiden =
+ Load && Load->getAlign() >= Align(4) &&
+ (AMDGPU::isConstantAddressSpace(Load->getPointerAddressSpace()) ||
+ (Load->getPointerAddressSpace() == AMDGPUAS::GLOBAL_ADDRESS &&
+ Load->hasMetadata(LLVMContext::MD_invariant_load)));
+ const bool LoadExtends = Load && Load->isSimple() && Load->hasOneUse() &&
+ !LoadMayWiden && SrcBits % 8 == 0 &&
+ (SrcBits == 24 || (UsesInt64 && SrcBits < 64));
+ const unsigned ExtOps =
+ UsesInt64 && SrcBits < 64 && !LoadExtends ? (IsSigned ? 2 : 1) : 0;
if (FPTy->isBFloatTy()) {
if (SrcBits < 8 || (SrcBits > 32 && !UsesInt64))
return BaseT::getCastInstrCost(Opcode, Dst, Src, CCH, CostKind, I);
@@ -1189,11 +1205,7 @@ InstructionCost GCNTTIImpl::getCastInstrCost(unsigned Opcode, Type *Dst,
// or sign extended first. Without 16 bit instructions a half result is
// rounded from f32.
if (SrcBits >= 8 && SrcBits < 32) {
- // A 24 bit load is split and its high byte load extends the source.
- const auto *Load = I && I->getOperand(0)->getType() == Src
- ? dyn_cast<LoadInst>(I->getOperand(0))
- : nullptr;
- if (SrcBits == 24 && Load && Load->isSimple() && Load->hasOneUse()) {
+ if (LoadExtends) {
if (FPTy->isDoubleTy())
return Scale(0, 1);
return Scale(FPTy->isHalfTy() ? 2 : 1);
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 142efad50cb92..5fc7b7883e582 100644
--- a/llvm/test/Analysis/CostModel/AMDGPU/narrow-int-to-bfloat.ll
+++ b/llvm/test/Analysis/CostModel/AMDGPU/narrow-int-to-bfloat.ll
@@ -282,33 +282,33 @@ define void @loaded_scalars_to_bfloat(ptr addrspace(1) %p) {
define void @loaded_wide_scalars_to_bfloat(ptr addrspace(1) %p) {
; GFX6-LABEL: 'loaded_wide_scalars_to_bfloat'
-; GFX6: Cost Model: Found an estimated cost of 15 for instruction: %as = sitofp i40 %a to bfloat
-; GFX6: Cost Model: Found an estimated cost of 10 for instruction: %bu = uitofp i56 %b to bfloat
+; GFX6: Cost Model: Found an estimated cost of 13 for instruction: %as = sitofp i40 %a to bfloat
+; GFX6: Cost Model: Found an estimated cost of 9 for instruction: %bu = uitofp i56 %b to bfloat
; GFX6: Cost Model: Found an estimated cost of 15 for instruction: %cs = sitofp i48 %c to bfloat
;
; GFX8-LABEL: 'loaded_wide_scalars_to_bfloat'
-; GFX8: Cost Model: Found an estimated cost of 21 for instruction: %as = sitofp i40 %a to bfloat
-; GFX8: Cost Model: Found an estimated cost of 16 for instruction: %bu = uitofp i56 %b to bfloat
+; GFX8: Cost Model: Found an estimated cost of 19 for instruction: %as = sitofp i40 %a to bfloat
+; GFX8: Cost Model: Found an estimated cost of 15 for instruction: %bu = uitofp i56 %b to bfloat
; GFX8: Cost Model: Found an estimated cost of 21 for instruction: %cs = sitofp i48 %c to bfloat
;
; GFX9-LABEL: 'loaded_wide_scalars_to_bfloat'
-; GFX9: Cost Model: Found an estimated cost of 20 for instruction: %as = sitofp i40 %a to bfloat
-; GFX9: Cost Model: Found an estimated cost of 15 for instruction: %bu = uitofp i56 %b to bfloat
+; GFX9: Cost Model: Found an estimated cost of 18 for instruction: %as = sitofp i40 %a to bfloat
+; GFX9: Cost Model: Found an estimated cost of 14 for instruction: %bu = uitofp i56 %b to bfloat
; GFX9: Cost Model: Found an estimated cost of 20 for instruction: %cs = sitofp i48 %c to bfloat
;
; NOSDWA-LABEL: 'loaded_wide_scalars_to_bfloat'
-; NOSDWA: Cost Model: Found an estimated cost of 20 for instruction: %as = sitofp i40 %a to bfloat
-; NOSDWA: Cost Model: Found an estimated cost of 15 for instruction: %bu = uitofp i56 %b to bfloat
+; NOSDWA: Cost Model: Found an estimated cost of 18 for instruction: %as = sitofp i40 %a to bfloat
+; NOSDWA: Cost Model: Found an estimated cost of 14 for instruction: %bu = uitofp i56 %b to bfloat
; NOSDWA: Cost Model: Found an estimated cost of 20 for instruction: %cs = sitofp i48 %c to bfloat
;
; GFX950-LABEL: 'loaded_wide_scalars_to_bfloat'
-; GFX950: Cost Model: Found an estimated cost of 15 for instruction: %as = sitofp i40 %a to bfloat
-; GFX950: Cost Model: Found an estimated cost of 10 for instruction: %bu = uitofp i56 %b to bfloat
+; GFX950: Cost Model: Found an estimated cost of 13 for instruction: %as = sitofp i40 %a to bfloat
+; GFX950: Cost Model: Found an estimated cost of 9 for instruction: %bu = uitofp i56 %b to bfloat
; GFX950: Cost Model: Found an estimated cost of 15 for instruction: %cs = sitofp i48 %c to bfloat
;
; GFX1250-LABEL: 'loaded_wide_scalars_to_bfloat'
-; GFX1250: Cost Model: Found an estimated cost of 15 for instruction: %as = sitofp i40 %a to bfloat
-; GFX1250: Cost Model: Found an estimated cost of 10 for instruction: %bu = uitofp i56 %b to bfloat
+; GFX1250: Cost Model: Found an estimated cost of 13 for instruction: %as = sitofp i40 %a to bfloat
+; GFX1250: Cost Model: Found an estimated cost of 9 for instruction: %bu = uitofp i56 %b to bfloat
; GFX1250: Cost Model: Found an estimated cost of 15 for instruction: %cs = sitofp i48 %c to bfloat
;
%a = load i40, ptr addrspace(1) %p
@@ -322,40 +322,40 @@ define void @loaded_wide_scalars_to_bfloat(ptr addrspace(1) %p) {
define void @loaded_constant_scalars_to_bfloat(ptr addrspace(4) %p, ptr addrspace(1) %r) {
; GFX6-LABEL: 'loaded_constant_scalars_to_bfloat'
-; GFX6: Cost Model: Found an estimated cost of 2 for instruction: %as = sitofp i24 %a to bfloat
+; GFX6: Cost Model: Found an estimated cost of 3 for instruction: %as = sitofp i24 %a to bfloat
; GFX6: Cost Model: Found an estimated cost of 2 for instruction: %bs = sitofp i24 %b to bfloat
; GFX6: Cost Model: Found an estimated cost of 10 for instruction: %cu = uitofp i48 %c to bfloat
-; GFX6: Cost Model: Found an estimated cost of 10 for instruction: %du = uitofp i48 %d to bfloat
+; GFX6: Cost Model: Found an estimated cost of 9 for instruction: %du = uitofp i48 %d to bfloat
;
; GFX8-LABEL: 'loaded_constant_scalars_to_bfloat'
-; GFX8: Cost Model: Found an estimated cost of 8 for instruction: %as = sitofp i24 %a to bfloat
+; GFX8: Cost Model: Found an estimated cost of 9 for instruction: %as = sitofp i24 %a to bfloat
; GFX8: Cost Model: Found an estimated cost of 8 for instruction: %bs = sitofp i24 %b to bfloat
; GFX8: Cost Model: Found an estimated cost of 16 for instruction: %cu = uitofp i48 %c to bfloat
-; GFX8: Cost Model: Found an estimated cost of 16 for instruction: %du = uitofp i48 %d to bfloat
+; GFX8: Cost Model: Found an estimated cost of 15 for instruction: %du = uitofp i48 %d to bfloat
;
; GFX9-LABEL: 'loaded_constant_scalars_to_bfloat'
-; GFX9: Cost Model: Found an estimated cost of 7 for instruction: %as = sitofp i24 %a to bfloat
+; GFX9: Cost Model: Found an estimated cost of 8 for instruction: %as = sitofp i24 %a to bfloat
; GFX9: Cost Model: Found an estimated cost of 7 for instruction: %bs = sitofp i24 %b to bfloat
; GFX9: Cost Model: Found an estimated cost of 15 for instruction: %cu = uitofp i48 %c to bfloat
-; GFX9: Cost Model: Found an estimated cost of 15 for instruction: %du = uitofp i48 %d to bfloat
+; GFX9: Cost Model: Found an estimated cost of 14 for instruction: %du = uitofp i48 %d to bfloat
;
; NOSDWA-LABEL: 'loaded_constant_scalars_to_bfloat'
-; NOSDWA: Cost Model: Found an estimated cost of 7 for instruction: %as = sitofp i24 %a to bfloat
+; NOSDWA: Cost Model: Found an estimated cost of 8 for instruction: %as = sitofp i24 %a to bfloat
; NOSDWA: Cost Model: Found an estimated cost of 7 for instruction: %bs = sitofp i24 %b to bfloat
; NOSDWA: Cost Model: Found an estimated cost of 15 for instruction: %cu = uitofp i48 %c to bfloat
-; NOSDWA: Cost Model: Found an estimated cost of 15 for instruction: %du = uitofp i48 %d to bfloat
+; NOSDWA: Cost Model: Found an estimated cost of 14 for instruction: %du = uitofp i48 %d to bfloat
;
; GFX950-LABEL: 'loaded_constant_scalars_to_bfloat'
-; GFX950: Cost Model: Found an estimated cost of 2 for instruction: %as = sitofp i24 %a to bfloat
+; GFX950: Cost Model: Found an estimated cost of 3 for instruction: %as = sitofp i24 %a to bfloat
; GFX950: Cost Model: Found an estimated cost of 2 for instruction: %bs = sitofp i24 %b to bfloat
; GFX950: Cost Model: Found an estimated cost of 10 for instruction: %cu = uitofp i48 %c to bfloat
-; GFX950: Cost Model: Found an estimated cost of 10 for instruction: %du = uitofp i48 %d to bfloat
+; GFX950: Cost Model: Found an estimated cost of 9 for instruction: %du = uitofp i48 %d to bfloat
;
; GFX1250-LABEL: 'loaded_constant_scalars_to_bfloat'
-; GFX1250: Cost Model: Found an estimated cost of 2 for instruction: %as = sitofp i24 %a to bfloat
+; GFX1250: Cost Model: Found an estimated cost of 3 for instruction: %as = sitofp i24 %a to bfloat
; GFX1250: Cost Model: Found an estimated cost of 2 for instruction: %bs = sitofp i24 %b to bfloat
; GFX1250: Cost Model: Found an estimated cost of 10 for instruction: %cu = uitofp i48 %c to bfloat
-; GFX1250: Cost Model: Found an estimated cost of 10 for instruction: %du = uitofp i48 %d to bfloat
+; GFX1250: Cost Model: Found an estimated cost of 9 for instruction: %du = uitofp i48 %d to bfloat
;
%a = load i24, ptr addrspace(4) %p, align 4
%as = sitofp i24 %a to bfloat
diff --git a/llvm/test/Analysis/CostModel/AMDGPU/narrow-int-to-fp.ll b/llvm/test/Analysis/CostModel/AMDGPU/narrow-int-to-fp.ll
index 26ac67a0dc926..20270dcc5b94c 100644
--- a/llvm/test/Analysis/CostModel/AMDGPU/narrow-int-to-fp.ll
+++ b/llvm/test/Analysis/CostModel/AMDGPU/narrow-int-to-fp.ll
@@ -860,12 +860,12 @@ define void @loaded_scalars_to_fp(ptr addrspace(1) %p) {
define void @loaded_wide_scalars_to_fp(ptr addrspace(1) %p) {
; NO16BIT-LABEL: 'loaded_wide_scalars_to_fp'
-; NO16BIT: Cost Model: Found an estimated cost of 15 for instruction: %ash = sitofp i40 %a to half
-; NO16BIT: Cost Model: Found an estimated cost of 10 for instruction: %buh = uitofp i48 %b to half
-; NO16BIT: Cost Model: Found an estimated cost of 14 for instruction: %csf = sitofp i56 %c to float
-; NO16BIT: Cost Model: Found an estimated cost of 9 for instruction: %duf = uitofp i40 %d to float
-; NO16BIT: Cost Model: Found an estimated cost of 18 for instruction: %esd = sitofp i48 %e to double
-; NO16BIT: Cost Model: Found an estimated cost of 17 for instruction: %fud = uitofp i56 %f to double
+; NO16BIT: Cost Model: Found an estimated cost of 13 for instruction: %ash = sitofp i40 %a to half
+; NO16BIT: Cost Model: Found an estimated cost of 9 for instruction: %buh = uitofp i48 %b to half
+; NO16BIT: Cost Model: Found an estimated cost of 12 for instruction: %csf = sitofp i56 %c to float
+; NO16BIT: Cost Model: Found an estimated cost of 8 for instruction: %duf = uitofp i40 %d to float
+; NO16BIT: Cost Model: Found an estimated cost of 16 for instruction: %esd = sitofp i48 %e to double
+; NO16BIT: Cost Model: Found an estimated cost of 16 for instruction: %fud = uitofp i56 %f to double
; NO16BIT: Cost Model: Found an estimated cost of 15 for instruction: %gsh = sitofp i48 %g to half
; NO16BIT: Cost Model: Found an estimated cost of 10 for instruction: %guh = uitofp i48 %g to half
; NO16BIT: Cost Model: Found an estimated cost of 15 for instruction: %hsh = sitofp i48 %h to half
@@ -873,12 +873,12 @@ define void @loaded_wide_scalars_to_fp(ptr addrspace(1) %p) {
; NO16BIT: Cost Model: Found an estimated cost of 30 for instruction: %jsh = sitofp <2 x i48> %j to <2 x half>
;
; GFX9-LABEL: 'loaded_wide_scalars_to_fp'
-; GFX9: Cost Model: Found an estimated cost of 15 for instruction: %ash = sitofp i40 %a to half
-; GFX9: Cost Model: Found an estimated cost of 10 for instruction: %buh = uitofp i48 %b to half
-; GFX9: Cost Model: Found an estimated cost of 14 for instruction: %csf = sitofp i56 %c to float
-; GFX9: Cost Model: Found an estimated cost of 9 for instruction: %duf = uitofp i40 %d to float
-; GFX9: Cost Model: Found an estimated cost of 18 for instruction: %esd = sitofp i48 %e to double
-; GFX9: Cost Model: Found an estimated cost of 17 for instruction: %fud = uitofp i56 %f to double
+; GFX9: Cost Model: Found an estimated cost of 13 for instruction: %ash = sitofp i40 %a to half
+; GFX9: Cost Model: Found an estimated cost of 9 for instruction: %buh = uitofp i48 %b to half
+; GFX9: Cost Model: Found an estimated cost of 12 for instruction: %csf = sitofp i56 %c to float
+; GFX9: Cost Model: Found an estimated cost of 8 for instruction: %duf = uitofp i40 %d to float
+; GFX9: Cost Model: Found an estimated cost of 16 for instruction: %esd = sitofp i48 %e to double
+; GFX9: Cost Model: Found an estimated cost of 16 for instruction: %fud = uitofp i56 %f to double
; GFX9: Cost Model: Found an estimated cost of 15 for instruction: %gsh = sitofp i48 %g to half
; GFX9: Cost Model: Found an estimated cost of 10 for instruction: %guh = uitofp i48 %g to half
; GFX9: Cost Model: Found an estimated cost of 15 for instruction: %hsh = sitofp i48 %h to half
@@ -886,12 +886,12 @@ define void @loaded_wide_scalars_to_fp(ptr addrspace(1) %p) {
; GFX9: Cost Model: Found an estimated cost of 30 for instruction: %jsh = sitofp <2 x i48> %j to <2 x half>
;
; GFX9-NOSDWA-LABEL: 'loaded_wide_scalars_to_fp'
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 15 for instruction: %ash = sitofp i40 %a to half
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 10 for instruction: %buh = uitofp i48 %b to half
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 14 for instruction: %csf = sitofp i56 %c to float
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 9 for instruction: %duf = uitofp i40 %d to float
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 18 for instruction: %esd = sitofp i48 %e to double
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 17 for instruction: %fud = uitofp i56 %f to double
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 13 for instruction: %ash = sitofp i40 %a to half
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 9 for instruction: %buh = uitofp i48 %b to half
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 12 for instruction: %csf = sitofp i56 %c to float
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 8 for instruction: %duf = uitofp i40 %d to float
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 16 for instruction: %esd = sitofp i48 %e to double
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 16 for instruction: %fud = uitofp i56 %f to double
; GFX9-NOSDWA: Cost Model: Found an estimated cost of 15 for instruction: %gsh = sitofp i48 %g to half
; GFX9-NOSDWA: Cost Model: Found an estimated cost of 10 for instruction: %guh = uitofp i48 %g to half
; GFX9-NOSDWA: Cost Model: Found an estimated cost of 15 for instruction: %hsh = sitofp i48 %h to half
@@ -899,12 +899,12 @@ define void @loaded_wide_scalars_to_fp(ptr addrspace(1) %p) {
; GFX9-NOSDWA: Cost Model: Found an estimated cost of 30 for instruction: %jsh = sitofp <2 x i48> %j to <2 x half>
;
; GFX11-FAKE16-LABEL: 'loaded_wide_scalars_to_fp'
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 15 for instruction: %ash = sitofp i40 %a to half
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 10 for instruction: %buh = uitofp i48 %b to half
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 14 for instruction: %csf = sitofp i56 %c to float
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 9 for instruction: %duf = uitofp i40 %d to float
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 18 for instruction: %esd = sitofp i48 %e to double
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 17 for instruction: %fud = uitofp i56 %f to double
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 13 for instruction: %ash = sitofp i40 %a to half
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 9 for instruction: %buh = uitofp i48 %b to half
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 12 for instruction: %csf = sitofp i56 %c to float
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 8 for instruction: %duf = uitofp i40 %d to float
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 16 for instruction: %esd = sitofp i48 %e to double
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 16 for instruction: %fud = uitofp i56 %f to double
; GFX11-FAKE16: Cost Model: Found an estimated cost of 15 for instruction: %gsh = sitofp i48 %g to half
; GFX11-FAKE16: Cost Model: Found an estimated cost of 10 for instruction: %guh = uitofp i48 %g to half
; GFX11-FAKE16: Cost Model: Found an estimated cost of 15 for instruction: %hsh = sitofp i48 %h to half
@@ -912,12 +912,12 @@ define void @loaded_wide_scalars_to_fp(ptr addrspace(1) %p) {
; GFX11-FAKE16: Cost Model: Found an estimated cost of 30 for instruction: %jsh = sitofp <2 x i48> %j to <2 x half>
;
; GFX11-TRUE16-LABEL: 'loaded_wide_scalars_to_fp'
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 15 for instruction: %ash = sitofp i40 %a to half
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 10 for instruction: %buh = uitofp i48 %b to half
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 14 for instruction: %csf = sitofp i56 %c to float
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 9 for instruction: %duf = uitofp i40 %d to float
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 18 for instruction: %esd = sitofp i48 %e to double
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 17 for instruction: %fud = uitofp i56 %f to double
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 13 for instruction: %ash = sitofp i40 %a to half
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 9 for instruction: %buh = uitofp i48 %b to half
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 12 for instruction: %csf = sitofp i56 %c to float
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 8 for instruction: %duf = uitofp i40 %d to float
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 16 for instruction: %esd = sitofp i48 %e to double
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 16 for instruction: %fud = uitofp i56 %f to double
; GFX11-TRUE16: Cost Model: Found an estimated cost of 15 for instruction: %gsh = sitofp i48 %g to half
; GFX11-TRUE16: Cost Model: Found an estimated cost of 10 for instruction: %guh = uitofp i48 %g to half
; GFX11-TRUE16: Cost Model: Found an estimated cost of 15 for instruction: %hsh = sitofp i48 %h to half
@@ -925,12 +925,12 @@ define void @loaded_wide_scalars_to_fp(ptr addrspace(1) %p) {
; GFX11-TRUE16: Cost Model: Found an estimated cost of 30 for instruction: %jsh = sitofp <2 x i48> %j to <2 x half>
;
; GFX950-LABEL: 'loaded_wide_scalars_to_fp'
-; GFX950: Cost Model: Found an estimated cost of 15 for instruction: %ash = sitofp i40 %a to half
-; GFX950: Cost Model: Found an estimated cost of 10 for instruction: %buh = uitofp i48 %b to half
-; GFX950: Cost Model: Found an estimated cost of 14 for instruction: %csf = sitofp i56 %c to float
-; GFX950: Cost Model: Found an estimated cost of 9 for instruction: %duf = uitofp i40 %d to float
-; GFX950: Cost Model: Found an estimated cost of 6 for instruction: %esd = sitofp i48 %e to double
-; GFX950: Cost Model: Found an estimated cost of 5 for instruction: %fud = uitofp i56 %f to double
+; GFX950: Cost Model: Found an estimated cost of 13 for instruction: %ash = sitofp i40 %a to half
+; GFX950: Cost Model: Found an estimated cost of 9 for instruction: %buh = uitofp i48 %b to half
+; GFX950: Cost Model: Found an estimated cost of 12 for instruction: %csf = sitofp i56 %c to float
+; GFX950: Cost Model: Found an estimated cost of 8 for instruction: %duf = uitofp i40 %d to float
+; GFX950: Cost Model: Found an estimated cost of 4 for instruction: %esd = sitofp i48 %e to double
+; GFX950: Cost Model: Found an estimated cost of 4 for instruction: %fud = uitofp i56 %f to double
; GFX950: Cost Model: Found an estimated cost of 15 for instruction: %gsh = sitofp i48 %g to half
; GFX950: Cost Model: Found an estimated cost of 10 for instruction: %guh = uitofp i48 %g to half
; GFX950: Cost Model: Found an estimated cost of 15 for instruction: %hsh = sitofp i48 %h to half
@@ -938,12 +938,12 @@ define void @loaded_wide_scalars_to_fp(ptr addrspace(1) %p) {
; GFX950: Cost Model: Found an estimated cost of 30 for instruction: %jsh = sitofp <2 x i48> %j to <2 x half>
;
; GFX1250-FAKE16-LABEL: 'loaded_wide_scalars_to_fp'
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 15 for instruction: %ash = sitofp i40 %a to half
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 10 for instruction: %buh = uitofp i48 %b to half
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 14 for instruction: %csf = sitofp i56 %c to float
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 9 for instruction: %duf = uitofp i40 %d to float
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 18 for instruction: %esd = sitofp i48 %e to double
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 17 for instruction: %fud = uitofp i56 %f to double
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 13 for instruction: %ash = sitofp i40 %a to half
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 9 for instruction: %buh = uitofp i48 %b to half
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 12 for instruction: %csf = sitofp i56 %c to float
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 8 for instruction: %duf = uitofp i40 %d to float
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 16 for instruction: %esd = sitofp i48 %e to double
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 16 for instruction: %fud = uitofp i56 %f to double
; GFX1250-FAKE16: Cost Model: Found an estimated cost of 15 for instruction: %gsh = sitofp i48 %g to half
; GFX1250-FAKE16: Cost Model: Found an estimated cost of 10 for instruction: %guh = uitofp i48 %g to half
; GFX1250-FAKE16: Cost Model: Found an estimated cost of 15 for instruction: %hsh = sitofp i48 %h to half
@@ -951,12 +951,12 @@ define void @loaded_wide_scalars_to_fp(ptr addrspace(1) %p) {
; GFX1250-FAKE16: Cost Model: Found an estimated cost of 30 for instruction: %jsh = sitofp <2 x i48> %j to <2 x half>
;
; GFX1250-TRUE16-LABEL: 'loaded_wide_scalars_to_fp'
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 15 for instruction: %ash = sitofp i40 %a to half
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 10 for instruction: %buh = uitofp i48 %b to half
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 14 for instruction: %csf = sitofp i56 %c to float
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 9 for instruction: %duf = uitofp i40 %d to float
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 18 for instruction: %esd = sitofp i48 %e to double
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 17 for instruction: %fud = uitofp i56 %f to double
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 13 for instruction: %ash = sitofp i40 %a to half
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 9 for instruction: %buh = uitofp i48 %b to half
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 12 for instruction: %csf = sitofp i56 %c to float
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 8 for instruction: %duf = uitofp i40 %d to float
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 16 for instruction: %esd = sitofp i48 %e to double
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 16 for instruction: %fud = uitofp i56 %f to double
; GFX1250-TRUE16: Cost Model: Found an estimated cost of 15 for instruction: %gsh = sitofp i48 %g to half
; GFX1250-TRUE16: Cost Model: Found an estimated cost of 10 for instruction: %guh = uitofp i48 %g to half
; GFX1250-TRUE16: Cost Model: Found an estimated cost of 15 for instruction: %hsh = sitofp i48 %h to half
@@ -964,12 +964,12 @@ define void @loaded_wide_scalars_to_fp(ptr addrspace(1) %p) {
; GFX1250-TRUE16: Cost Model: Found an estimated cost of 30 for instruction: %jsh = sitofp <2 x i48> %j to <2 x half>
;
; GFX6-SIZE-LABEL: 'loaded_wide_scalars_to_fp'
-; GFX6-SIZE: Cost Model: Found an estimated cost of 15 for instruction: %ash = sitofp i40 %a to half
-; GFX6-SIZE: Cost Model: Found an estimated cost of 10 for instruction: %buh = uitofp i48 %b to half
-; GFX6-SIZE: Cost Model: Found an estimated cost of 14 for instruction: %csf = sitofp i56 %c to float
-; GFX6-SIZE: Cost Model: Found an estimated cost of 9 for instruction: %duf = uitofp i40 %d to float
-; GFX6-SIZE: Cost Model: Found an estimated cost of 10 for instruction: %esd = sitofp i48 %e to double
-; GFX6-SIZE: Cost Model: Found an estimated cost of 9 for instruction: %fud = uitofp i56 %f to double
+; GFX6-SIZE: Cost Model: Found an estimated cost of 13 for instruction: %ash = sitofp i40 %a to half
+; GFX6-SIZE: Cost Model: Found an estimated cost of 9 for instruction: %buh = uitofp i48 %b to half
+; GFX6-SIZE: Cost Model: Found an estimated cost of 12 for instruction: %csf = sitofp i56 %c to float
+; GFX6-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %duf = uitofp i40 %d to float
+; GFX6-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %esd = sitofp i48 %e to double
+; GFX6-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %fud = uitofp i56 %f to double
; GFX6-SIZE: Cost Model: Found an estimated cost of 15 for instruction: %gsh = sitofp i48 %g to half
; GFX6-SIZE: Cost Model: Found an estimated cost of 10 for instruction: %guh = uitofp i48 %g to half
; GFX6-SIZE: Cost Model: Found an estimated cost of 15 for instruction: %hsh = sitofp i48 %h to half
@@ -977,12 +977,12 @@ define void @loaded_wide_scalars_to_fp(ptr addrspace(1) %p) {
; GFX6-SIZE: Cost Model: Found an estimated cost of 30 for instruction: %jsh = sitofp <2 x i48> %j to <2 x half>
;
; GFX9-SIZE-LABEL: 'loaded_wide_scalars_to_fp'
-; GFX9-SIZE: Cost Model: Found an estimated cost of 15 for instruction: %ash = sitofp i40 %a to half
-; GFX9-SIZE: Cost Model: Found an estimated cost of 10 for instruction: %buh = uitofp i48 %b to half
-; GFX9-SIZE: Cost Model: Found an estimated cost of 14 for instruction: %csf = sitofp i56 %c to float
-; GFX9-SIZE: Cost Model: Found an estimated cost of 9 for instruction: %duf = uitofp i40 %d to float
-; GFX9-SIZE: Cost Model: Found an estimated cost of 10 for instruction: %esd = sitofp i48 %e to double
-; GFX9-SIZE: Cost Model: Found an estimated cost of 9 for instruction: %fud = uitofp i56 %f to double
+; GFX9-SIZE: Cost Model: Found an estimated cost of 13 for instruction: %ash = sitofp i40 %a to half
+; GFX9-SIZE: Cost Model: Found an estimated cost of 9 for instruction: %buh = uitofp i48 %b to half
+; GFX9-SIZE: Cost Model: Found an estimated cost of 12 for instruction: %csf = sitofp i56 %c to float
+; GFX9-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %duf = uitofp i40 %d to float
+; GFX9-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %esd = sitofp i48 %e to double
+; GFX9-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %fud = uitofp i56 %f to double
; GFX9-SIZE: Cost Model: Found an estimated cost of 15 for instruction: %gsh = sitofp i48 %g to half
; GFX9-SIZE: Cost Model: Found an estimated cost of 10 for instruction: %guh = uitofp i48 %g to half
; GFX9-SIZE: Cost Model: Found an estimated cost of 15 for instruction: %hsh = sitofp i48 %h to half
@@ -1015,104 +1015,104 @@ define void @loaded_wide_scalars_to_fp(ptr addrspace(1) %p) {
define void @loaded_constant_scalars_to_fp(ptr addrspace(4) %p, ptr addrspace(6) %q, ptr addrspace(1) %r) {
; NO16BIT-LABEL: 'loaded_constant_scalars_to_fp'
-; NO16BIT: Cost Model: Found an estimated cost of 2 for instruction: %ash = sitofp i24 %a to half
+; NO16BIT: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
; NO16BIT: Cost Model: Found an estimated cost of 2 for instruction: %bsh = sitofp i24 %b to half
; NO16BIT: Cost Model: Found an estimated cost of 9 for instruction: %cuf = uitofp i48 %c to float
-; NO16BIT: Cost Model: Found an estimated cost of 9 for instruction: %duf = uitofp i48 %d to float
+; NO16BIT: Cost Model: Found an estimated cost of 8 for instruction: %duf = uitofp i48 %d to float
; NO16BIT: Cost Model: Found an estimated cost of 15 for instruction: %esh = sitofp i40 %e to half
; NO16BIT: Cost Model: Found an estimated cost of 14 for instruction: %fsf = sitofp i56 %f to float
-; NO16BIT: Cost Model: Found an estimated cost of 14 for instruction: %gsf = sitofp i56 %g to float
-; NO16BIT: Cost Model: Found an estimated cost of 4 for instruction: %hsd = sitofp i24 %h to double
+; NO16BIT: Cost Model: Found an estimated cost of 12 for instruction: %gsf = sitofp i56 %g to float
+; NO16BIT: Cost Model: Found an estimated cost of 5 for instruction: %hsd = sitofp i24 %h to double
;
; GFX9-LABEL: 'loaded_constant_scalars_to_fp'
-; GFX9: Cost Model: Found an estimated cost of 2 for instruction: %ash = sitofp i24 %a to half
+; GFX9: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
; GFX9: Cost Model: Found an estimated cost of 2 for instruction: %bsh = sitofp i24 %b to half
; GFX9: Cost Model: Found an estimated cost of 9 for instruction: %cuf = uitofp i48 %c to float
-; GFX9: Cost Model: Found an estimated cost of 9 for instruction: %duf = uitofp i48 %d to float
+; GFX9: Cost Model: Found an estimated cost of 8 for instruction: %duf = uitofp i48 %d to float
; GFX9: Cost Model: Found an estimated cost of 15 for instruction: %esh = sitofp i40 %e to half
; GFX9: Cost Model: Found an estimated cost of 14 for instruction: %fsf = sitofp i56 %f to float
-; GFX9: Cost Model: Found an estimated cost of 14 for instruction: %gsf = sitofp i56 %g to float
-; GFX9: Cost Model: Found an estimated cost of 4 for instruction: %hsd = sitofp i24 %h to double
+; GFX9: Cost Model: Found an estimated cost of 12 for instruction: %gsf = sitofp i56 %g to float
+; GFX9: Cost Model: Found an estimated cost of 5 for instruction: %hsd = sitofp i24 %h to double
;
; GFX9-NOSDWA-LABEL: 'loaded_constant_scalars_to_fp'
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 2 for instruction: %ash = sitofp i24 %a to half
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
; GFX9-NOSDWA: Cost Model: Found an estimated cost of 2 for instruction: %bsh = sitofp i24 %b to half
; GFX9-NOSDWA: Cost Model: Found an estimated cost of 9 for instruction: %cuf = uitofp i48 %c to float
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 9 for instruction: %duf = uitofp i48 %d to float
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 8 for instruction: %duf = uitofp i48 %d to float
; GFX9-NOSDWA: Cost Model: Found an estimated cost of 15 for instruction: %esh = sitofp i40 %e to half
; GFX9-NOSDWA: Cost Model: Found an estimated cost of 14 for instruction: %fsf = sitofp i56 %f to float
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 14 for instruction: %gsf = sitofp i56 %g to float
-; GFX9-NOSDWA: Cost Model: Found an estimated cost of 4 for instruction: %hsd = sitofp i24 %h to double
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 12 for instruction: %gsf = sitofp i56 %g to float
+; GFX9-NOSDWA: Cost Model: Found an estimated cost of 5 for instruction: %hsd = sitofp i24 %h to double
;
; GFX11-FAKE16-LABEL: 'loaded_constant_scalars_to_fp'
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %ash = sitofp i24 %a to half
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
; GFX11-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %bsh = sitofp i24 %b to half
; GFX11-FAKE16: Cost Model: Found an estimated cost of 9 for instruction: %cuf = uitofp i48 %c to float
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 9 for instruction: %duf = uitofp i48 %d to float
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 8 for instruction: %duf = uitofp i48 %d to float
; GFX11-FAKE16: Cost Model: Found an estimated cost of 15 for instruction: %esh = sitofp i40 %e to half
; GFX11-FAKE16: Cost Model: Found an estimated cost of 14 for instruction: %fsf = sitofp i56 %f to float
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 14 for instruction: %gsf = sitofp i56 %g to float
-; GFX11-FAKE16: Cost Model: Found an estimated cost of 4 for instruction: %hsd = sitofp i24 %h to double
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 12 for instruction: %gsf = sitofp i56 %g to float
+; GFX11-FAKE16: Cost Model: Found an estimated cost of 5 for instruction: %hsd = sitofp i24 %h to double
;
; GFX11-TRUE16-LABEL: 'loaded_constant_scalars_to_fp'
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %ash = sitofp i24 %a to half
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
; GFX11-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %bsh = sitofp i24 %b to half
; GFX11-TRUE16: Cost Model: Found an estimated cost of 9 for instruction: %cuf = uitofp i48 %c to float
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 9 for instruction: %duf = uitofp i48 %d to float
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 8 for instruction: %duf = uitofp i48 %d to float
; GFX11-TRUE16: Cost Model: Found an estimated cost of 15 for instruction: %esh = sitofp i40 %e to half
; GFX11-TRUE16: Cost Model: Found an estimated cost of 14 for instruction: %fsf = sitofp i56 %f to float
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 14 for instruction: %gsf = sitofp i56 %g to float
-; GFX11-TRUE16: Cost Model: Found an estimated cost of 4 for instruction: %hsd = sitofp i24 %h to double
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 12 for instruction: %gsf = sitofp i56 %g to float
+; GFX11-TRUE16: Cost Model: Found an estimated cost of 5 for instruction: %hsd = sitofp i24 %h to double
;
; GFX950-LABEL: 'loaded_constant_scalars_to_fp'
-; GFX950: Cost Model: Found an estimated cost of 2 for instruction: %ash = sitofp i24 %a to half
+; GFX950: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
; GFX950: Cost Model: Found an estimated cost of 2 for instruction: %bsh = sitofp i24 %b to half
; GFX950: Cost Model: Found an estimated cost of 9 for instruction: %cuf = uitofp i48 %c to float
-; GFX950: Cost Model: Found an estimated cost of 9 for instruction: %duf = uitofp i48 %d to float
+; GFX950: Cost Model: Found an estimated cost of 8 for instruction: %duf = uitofp i48 %d to float
; GFX950: Cost Model: Found an estimated cost of 15 for instruction: %esh = sitofp i40 %e to half
; GFX950: Cost Model: Found an estimated cost of 14 for instruction: %fsf = sitofp i56 %f to float
-; GFX950: Cost Model: Found an estimated cost of 14 for instruction: %gsf = sitofp i56 %g to float
-; GFX950: Cost Model: Found an estimated cost of 1 for instruction: %hsd = sitofp i24 %h to double
+; GFX950: Cost Model: Found an estimated cost of 12 for instruction: %gsf = sitofp i56 %g to float
+; GFX950: Cost Model: Found an estimated cost of 2 for instruction: %hsd = sitofp i24 %h to double
;
; GFX1250-FAKE16-LABEL: 'loaded_constant_scalars_to_fp'
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %ash = sitofp i24 %a to half
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
; GFX1250-FAKE16: Cost Model: Found an estimated cost of 2 for instruction: %bsh = sitofp i24 %b to half
; GFX1250-FAKE16: Cost Model: Found an estimated cost of 9 for instruction: %cuf = uitofp i48 %c to float
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 9 for instruction: %duf = uitofp i48 %d to float
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 8 for instruction: %duf = uitofp i48 %d to float
; GFX1250-FAKE16: Cost Model: Found an estimated cost of 15 for instruction: %esh = sitofp i40 %e to half
; GFX1250-FAKE16: Cost Model: Found an estimated cost of 14 for instruction: %fsf = sitofp i56 %f to float
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 14 for instruction: %gsf = sitofp i56 %g to float
-; GFX1250-FAKE16: Cost Model: Found an estimated cost of 4 for instruction: %hsd = sitofp i24 %h to double
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 12 for instruction: %gsf = sitofp i56 %g to float
+; GFX1250-FAKE16: Cost Model: Found an estimated cost of 5 for instruction: %hsd = sitofp i24 %h to double
;
; GFX1250-TRUE16-LABEL: 'loaded_constant_scalars_to_fp'
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %ash = sitofp i24 %a to half
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
; GFX1250-TRUE16: Cost Model: Found an estimated cost of 2 for instruction: %bsh = sitofp i24 %b to half
; GFX1250-TRUE16: Cost Model: Found an estimated cost of 9 for instruction: %cuf = uitofp i48 %c to float
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 9 for instruction: %duf = uitofp i48 %d to float
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 8 for instruction: %duf = uitofp i48 %d to float
; GFX1250-TRUE16: Cost Model: Found an estimated cost of 15 for instruction: %esh = sitofp i40 %e to half
; GFX1250-TRUE16: Cost Model: Found an estimated cost of 14 for instruction: %fsf = sitofp i56 %f to float
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 14 for instruction: %gsf = sitofp i56 %g to float
-; GFX1250-TRUE16: Cost Model: Found an estimated cost of 4 for instruction: %hsd = sitofp i24 %h to double
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 12 for instruction: %gsf = sitofp i56 %g to float
+; GFX1250-TRUE16: Cost Model: Found an estimated cost of 5 for instruction: %hsd = sitofp i24 %h to double
;
; GFX6-SIZE-LABEL: 'loaded_constant_scalars_to_fp'
-; GFX6-SIZE: Cost Model: Found an estimated cost of 2 for instruction: %ash = sitofp i24 %a to half
+; GFX6-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
; GFX6-SIZE: Cost Model: Found an estimated cost of 2 for instruction: %bsh = sitofp i24 %b to half
; GFX6-SIZE: Cost Model: Found an estimated cost of 9 for instruction: %cuf = uitofp i48 %c to float
-; GFX6-SIZE: Cost Model: Found an estimated cost of 9 for instruction: %duf = uitofp i48 %d to float
+; GFX6-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %duf = uitofp i48 %d to float
; GFX6-SIZE: Cost Model: Found an estimated cost of 15 for instruction: %esh = sitofp i40 %e to half
; GFX6-SIZE: Cost Model: Found an estimated cost of 14 for instruction: %fsf = sitofp i56 %f to float
-; GFX6-SIZE: Cost Model: Found an estimated cost of 14 for instruction: %gsf = sitofp i56 %g to float
-; GFX6-SIZE: Cost Model: Found an estimated cost of 2 for instruction: %hsd = sitofp i24 %h to double
+; GFX6-SIZE: Cost Model: Found an estimated cost of 12 for instruction: %gsf = sitofp i56 %g to float
+; GFX6-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %hsd = sitofp i24 %h to double
;
; GFX9-SIZE-LABEL: 'loaded_constant_scalars_to_fp'
-; GFX9-SIZE: Cost Model: Found an estimated cost of 2 for instruction: %ash = sitofp i24 %a to half
+; GFX9-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %ash = sitofp i24 %a to half
; GFX9-SIZE: Cost Model: Found an estimated cost of 2 for instruction: %bsh = sitofp i24 %b to half
; GFX9-SIZE: Cost Model: Found an estimated cost of 9 for instruction: %cuf = uitofp i48 %c to float
-; GFX9-SIZE: Cost Model: Found an estimated cost of 9 for instruction: %duf = uitofp i48 %d to float
+; GFX9-SIZE: Cost Model: Found an estimated cost of 8 for instruction: %duf = uitofp i48 %d to float
; GFX9-SIZE: Cost Model: Found an estimated cost of 15 for instruction: %esh = sitofp i40 %e to half
; GFX9-SIZE: Cost Model: Found an estimated cost of 14 for instruction: %fsf = sitofp i56 %f to float
-; GFX9-SIZE: Cost Model: Found an estimated cost of 14 for instruction: %gsf = sitofp i56 %g to float
-; GFX9-SIZE: Cost Model: Found an estimated cost of 2 for instruction: %hsd = sitofp i24 %h to double
+; GFX9-SIZE: Cost Model: Found an estimated cost of 12 for instruction: %gsf = sitofp i56 %g to float
+; GFX9-SIZE: Cost Model: Found an estimated cost of 3 for instruction: %hsd = sitofp i24 %h to double
;
%a = load i24, ptr addrspace(4) %p, align 4
%ash = sitofp i24 %a to half
>From d05a0a5f83ec58c33dfa6867670376bd56b02e4e Mon Sep 17 00:00:00 2001
From: Dmitry Sidorov <Dmitry.Sidorov at amd.com>
Date: Thu, 1 Oct 2026 00:37:22 +0200
Subject: [PATCH 6/6] update slp-int-to-fp.ll
---
llvm/test/CodeGen/AMDGPU/slp-int-to-fp.ll | 695 ++++++++++------------
1 file changed, 314 insertions(+), 381 deletions(-)
diff --git a/llvm/test/CodeGen/AMDGPU/slp-int-to-fp.ll b/llvm/test/CodeGen/AMDGPU/slp-int-to-fp.ll
index c610efb5af441..dc98aba177d39 100644
--- a/llvm/test/CodeGen/AMDGPU/slp-int-to-fp.ll
+++ b/llvm/test/CodeGen/AMDGPU/slp-int-to-fp.ll
@@ -917,80 +917,73 @@ define void @sitofp_i48_to_half(ptr addrspace(1) noalias %out, ptr addrspace(1)
; GFX900-LABEL: sitofp_i48_to_half:
; GFX900: ; %bb.0:
; GFX900-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
-; GFX900-NEXT: global_load_ushort v5, v[2:3], off offset:4
+; GFX900-NEXT: global_load_sshort v5, v[2:3], off offset:4
; GFX900-NEXT: global_load_dword v6, v[2:3], off offset:24
; GFX900-NEXT: global_load_dword v8, v[2:3], off offset:16
; GFX900-NEXT: global_load_dword v10, v[2:3], off offset:8
; GFX900-NEXT: global_load_dword v4, v[2:3], off
-; GFX900-NEXT: global_load_ushort v11, v[2:3], off offset:12
-; GFX900-NEXT: global_load_ushort v9, v[2:3], off offset:20
-; GFX900-NEXT: global_load_ushort v7, v[2:3], off offset:28
+; GFX900-NEXT: global_load_sshort v11, v[2:3], off offset:12
+; GFX900-NEXT: global_load_sshort v9, v[2:3], off offset:20
+; GFX900-NEXT: global_load_sshort v7, v[2:3], off offset:28
+; GFX900-NEXT: s_waitcnt vmcnt(7)
+; GFX900-NEXT: v_ffbh_i32_e32 v3, v5
+; GFX900-NEXT: v_add_u32_e32 v3, -1, v3
; GFX900-NEXT: s_waitcnt vmcnt(3)
-; GFX900-NEXT: v_lshlrev_b64 v[2:3], 16, v[4:5]
+; GFX900-NEXT: v_xor_b32_e32 v2, v4, v5
; GFX900-NEXT: s_waitcnt vmcnt(2)
-; GFX900-NEXT: v_lshlrev_b64 v[4:5], 16, v[10:11]
+; GFX900-NEXT: v_xor_b32_e32 v12, v10, v11
; GFX900-NEXT: s_waitcnt vmcnt(1)
-; GFX900-NEXT: v_lshlrev_b64 v[8:9], 16, v[8:9]
+; GFX900-NEXT: v_xor_b32_e32 v14, v8, v9
; GFX900-NEXT: s_waitcnt vmcnt(0)
-; GFX900-NEXT: v_lshlrev_b64 v[6:7], 16, v[6:7]
-; GFX900-NEXT: v_ashrrev_i64 v[2:3], 16, v[2:3]
-; GFX900-NEXT: v_ashrrev_i64 v[4:5], 16, v[4:5]
-; GFX900-NEXT: v_ashrrev_i64 v[8:9], 16, v[8:9]
-; GFX900-NEXT: v_ashrrev_i64 v[6:7], 16, v[6:7]
-; GFX900-NEXT: v_xor_b32_e32 v10, v4, v5
-; GFX900-NEXT: v_xor_b32_e32 v12, v2, v3
-; GFX900-NEXT: v_xor_b32_e32 v14, v6, v7
-; GFX900-NEXT: v_xor_b32_e32 v16, v8, v9
-; GFX900-NEXT: v_ffbh_i32_e32 v11, v5
-; GFX900-NEXT: v_ffbh_i32_e32 v13, v3
-; GFX900-NEXT: v_ffbh_i32_e32 v15, v7
-; GFX900-NEXT: v_ffbh_i32_e32 v17, v9
-; GFX900-NEXT: v_ashrrev_i32_e32 v10, 31, v10
+; GFX900-NEXT: v_xor_b32_e32 v16, v6, v7
+; GFX900-NEXT: v_ffbh_i32_e32 v13, v11
+; GFX900-NEXT: v_ffbh_i32_e32 v15, v9
+; GFX900-NEXT: v_ffbh_i32_e32 v17, v7
+; GFX900-NEXT: v_ashrrev_i32_e32 v2, 31, v2
; GFX900-NEXT: v_ashrrev_i32_e32 v12, 31, v12
; GFX900-NEXT: v_ashrrev_i32_e32 v14, 31, v14
; GFX900-NEXT: v_ashrrev_i32_e32 v16, 31, v16
-; GFX900-NEXT: v_add_u32_e32 v11, -1, v11
; GFX900-NEXT: v_add_u32_e32 v13, -1, v13
; GFX900-NEXT: v_add_u32_e32 v15, -1, v15
; GFX900-NEXT: v_add_u32_e32 v17, -1, v17
-; GFX900-NEXT: v_add_u32_e32 v10, 32, v10
+; GFX900-NEXT: v_add_u32_e32 v2, 32, v2
; GFX900-NEXT: v_add_u32_e32 v12, 32, v12
; GFX900-NEXT: v_add_u32_e32 v14, 32, v14
; GFX900-NEXT: v_add_u32_e32 v16, 32, v16
-; GFX900-NEXT: v_min_u32_e32 v10, v11, v10
-; GFX900-NEXT: v_min_u32_e32 v11, v13, v12
-; GFX900-NEXT: v_min_u32_e32 v12, v15, v14
-; GFX900-NEXT: v_min_u32_e32 v13, v17, v16
-; GFX900-NEXT: v_lshlrev_b64 v[4:5], v10, v[4:5]
-; GFX900-NEXT: v_lshlrev_b64 v[2:3], v11, v[2:3]
-; GFX900-NEXT: v_lshlrev_b64 v[6:7], v12, v[6:7]
+; GFX900-NEXT: v_min_u32_e32 v18, v3, v2
+; GFX900-NEXT: v_min_u32_e32 v12, v13, v12
+; GFX900-NEXT: v_min_u32_e32 v13, v15, v14
+; GFX900-NEXT: v_min_u32_e32 v14, v17, v16
+; GFX900-NEXT: v_lshlrev_b64 v[2:3], v18, v[4:5]
+; GFX900-NEXT: v_lshlrev_b64 v[4:5], v12, v[10:11]
; GFX900-NEXT: v_lshlrev_b64 v[8:9], v13, v[8:9]
-; GFX900-NEXT: v_min_u32_e32 v4, 1, v4
+; GFX900-NEXT: v_lshlrev_b64 v[6:7], v14, v[6:7]
; GFX900-NEXT: v_min_u32_e32 v2, 1, v2
-; GFX900-NEXT: v_min_u32_e32 v6, 1, v6
+; GFX900-NEXT: v_min_u32_e32 v4, 1, v4
; GFX900-NEXT: v_min_u32_e32 v8, 1, v8
-; GFX900-NEXT: v_or_b32_e32 v4, v5, v4
+; GFX900-NEXT: v_min_u32_e32 v6, 1, v6
; GFX900-NEXT: v_or_b32_e32 v2, v3, v2
-; GFX900-NEXT: v_or_b32_e32 v3, v7, v6
-; GFX900-NEXT: v_or_b32_e32 v5, v9, v8
-; GFX900-NEXT: v_cvt_f32_i32_e32 v4, v4
+; GFX900-NEXT: v_or_b32_e32 v3, v5, v4
+; GFX900-NEXT: v_or_b32_e32 v4, v9, v8
+; GFX900-NEXT: v_or_b32_e32 v5, v7, v6
; GFX900-NEXT: v_cvt_f32_i32_e32 v2, v2
; GFX900-NEXT: v_cvt_f32_i32_e32 v3, v3
+; GFX900-NEXT: v_cvt_f32_i32_e32 v4, v4
; GFX900-NEXT: v_cvt_f32_i32_e32 v5, v5
-; GFX900-NEXT: v_sub_u32_e32 v10, 32, v10
-; GFX900-NEXT: v_sub_u32_e32 v11, 32, v11
-; GFX900-NEXT: v_sub_u32_e32 v12, 32, v12
-; GFX900-NEXT: v_sub_u32_e32 v13, 32, v13
-; GFX900-NEXT: v_ldexp_f32 v4, v4, v10
-; GFX900-NEXT: v_ldexp_f32 v2, v2, v11
-; GFX900-NEXT: v_ldexp_f32 v3, v3, v12
-; GFX900-NEXT: v_ldexp_f32 v5, v5, v13
+; GFX900-NEXT: v_sub_u32_e32 v15, 32, v18
+; GFX900-NEXT: v_sub_u32_e32 v10, 32, v12
+; GFX900-NEXT: v_sub_u32_e32 v11, 32, v13
+; GFX900-NEXT: v_sub_u32_e32 v12, 32, v14
+; GFX900-NEXT: v_ldexp_f32 v2, v2, v15
+; GFX900-NEXT: v_ldexp_f32 v3, v3, v10
+; GFX900-NEXT: v_ldexp_f32 v4, v4, v11
+; GFX900-NEXT: v_ldexp_f32 v5, v5, v12
+; GFX900-NEXT: v_cvt_f16_f32_e32 v2, v2
; GFX900-NEXT: v_cvt_f16_f32_e32 v4, v4
-; GFX900-NEXT: v_cvt_f16_f32_e32 v3, v3
; GFX900-NEXT: v_cvt_f16_f32_e32 v5, v5
-; GFX900-NEXT: v_cvt_f16_f32_e32 v2, v2
-; GFX900-NEXT: v_pack_b32_f16 v3, v5, v3
-; GFX900-NEXT: v_pack_b32_f16 v2, v2, v4
+; GFX900-NEXT: v_cvt_f16_f32_e32 v6, v3
+; GFX900-NEXT: v_pack_b32_f16 v3, v4, v5
+; GFX900-NEXT: v_pack_b32_f16 v2, v2, v6
; GFX900-NEXT: global_store_dwordx2 v[0:1], v[2:3], off
; GFX900-NEXT: s_waitcnt vmcnt(0)
; GFX900-NEXT: s_setpc_b64 s[30:31]
@@ -998,80 +991,73 @@ define void @sitofp_i48_to_half(ptr addrspace(1) noalias %out, ptr addrspace(1)
; GFX90A-LABEL: sitofp_i48_to_half:
; GFX90A: ; %bb.0:
; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
-; GFX90A-NEXT: global_load_ushort v5, v[2:3], off offset:4
+; GFX90A-NEXT: global_load_sshort v5, v[2:3], off offset:4
; GFX90A-NEXT: global_load_dword v6, v[2:3], off offset:24
; GFX90A-NEXT: global_load_dword v8, v[2:3], off offset:16
; GFX90A-NEXT: global_load_dword v10, v[2:3], off offset:8
; GFX90A-NEXT: global_load_dword v4, v[2:3], off
-; GFX90A-NEXT: global_load_ushort v11, v[2:3], off offset:12
-; GFX90A-NEXT: global_load_ushort v9, v[2:3], off offset:20
-; GFX90A-NEXT: global_load_ushort v7, v[2:3], off offset:28
+; GFX90A-NEXT: global_load_sshort v11, v[2:3], off offset:12
+; GFX90A-NEXT: global_load_sshort v9, v[2:3], off offset:20
+; GFX90A-NEXT: global_load_sshort v7, v[2:3], off offset:28
+; GFX90A-NEXT: s_waitcnt vmcnt(7)
+; GFX90A-NEXT: v_ffbh_i32_e32 v3, v5
+; GFX90A-NEXT: v_add_u32_e32 v3, -1, v3
; GFX90A-NEXT: s_waitcnt vmcnt(3)
-; GFX90A-NEXT: v_lshlrev_b64 v[2:3], 16, v[4:5]
+; GFX90A-NEXT: v_xor_b32_e32 v2, v4, v5
; GFX90A-NEXT: s_waitcnt vmcnt(2)
-; GFX90A-NEXT: v_lshlrev_b64 v[4:5], 16, v[10:11]
+; GFX90A-NEXT: v_xor_b32_e32 v12, v10, v11
; GFX90A-NEXT: s_waitcnt vmcnt(1)
-; GFX90A-NEXT: v_lshlrev_b64 v[8:9], 16, v[8:9]
+; GFX90A-NEXT: v_xor_b32_e32 v14, v8, v9
; GFX90A-NEXT: s_waitcnt vmcnt(0)
-; GFX90A-NEXT: v_lshlrev_b64 v[6:7], 16, v[6:7]
-; GFX90A-NEXT: v_ashrrev_i64 v[2:3], 16, v[2:3]
-; GFX90A-NEXT: v_ashrrev_i64 v[4:5], 16, v[4:5]
-; GFX90A-NEXT: v_ashrrev_i64 v[8:9], 16, v[8:9]
-; GFX90A-NEXT: v_ashrrev_i64 v[6:7], 16, v[6:7]
-; GFX90A-NEXT: v_xor_b32_e32 v10, v6, v7
-; GFX90A-NEXT: v_xor_b32_e32 v12, v8, v9
-; GFX90A-NEXT: v_xor_b32_e32 v14, v4, v5
-; GFX90A-NEXT: v_xor_b32_e32 v16, v2, v3
-; GFX90A-NEXT: v_ffbh_i32_e32 v11, v7
-; GFX90A-NEXT: v_ffbh_i32_e32 v13, v9
-; GFX90A-NEXT: v_ffbh_i32_e32 v15, v5
-; GFX90A-NEXT: v_ffbh_i32_e32 v17, v3
-; GFX90A-NEXT: v_ashrrev_i32_e32 v10, 31, v10
+; GFX90A-NEXT: v_xor_b32_e32 v16, v6, v7
+; GFX90A-NEXT: v_ffbh_i32_e32 v13, v11
+; GFX90A-NEXT: v_ffbh_i32_e32 v15, v9
+; GFX90A-NEXT: v_ffbh_i32_e32 v17, v7
+; GFX90A-NEXT: v_ashrrev_i32_e32 v2, 31, v2
; GFX90A-NEXT: v_ashrrev_i32_e32 v12, 31, v12
; GFX90A-NEXT: v_ashrrev_i32_e32 v14, 31, v14
; GFX90A-NEXT: v_ashrrev_i32_e32 v16, 31, v16
-; GFX90A-NEXT: v_add_u32_e32 v11, -1, v11
; GFX90A-NEXT: v_add_u32_e32 v13, -1, v13
; GFX90A-NEXT: v_add_u32_e32 v15, -1, v15
; GFX90A-NEXT: v_add_u32_e32 v17, -1, v17
-; GFX90A-NEXT: v_add_u32_e32 v10, 32, v10
+; GFX90A-NEXT: v_add_u32_e32 v2, 32, v2
; GFX90A-NEXT: v_add_u32_e32 v12, 32, v12
; GFX90A-NEXT: v_add_u32_e32 v14, 32, v14
; GFX90A-NEXT: v_add_u32_e32 v16, 32, v16
-; GFX90A-NEXT: v_min_u32_e32 v10, v11, v10
-; GFX90A-NEXT: v_min_u32_e32 v11, v13, v12
-; GFX90A-NEXT: v_min_u32_e32 v12, v15, v14
-; GFX90A-NEXT: v_min_u32_e32 v13, v17, v16
-; GFX90A-NEXT: v_lshlrev_b64 v[6:7], v10, v[6:7]
-; GFX90A-NEXT: v_lshlrev_b64 v[8:9], v11, v[8:9]
-; GFX90A-NEXT: v_lshlrev_b64 v[4:5], v12, v[4:5]
-; GFX90A-NEXT: v_lshlrev_b64 v[2:3], v13, v[2:3]
-; GFX90A-NEXT: v_min_u32_e32 v6, 1, v6
-; GFX90A-NEXT: v_min_u32_e32 v8, 1, v8
-; GFX90A-NEXT: v_min_u32_e32 v4, 1, v4
+; GFX90A-NEXT: v_min_u32_e32 v18, v3, v2
+; GFX90A-NEXT: v_min_u32_e32 v12, v13, v12
+; GFX90A-NEXT: v_min_u32_e32 v13, v15, v14
+; GFX90A-NEXT: v_min_u32_e32 v14, v17, v16
+; GFX90A-NEXT: v_lshlrev_b64 v[2:3], v18, v[4:5]
+; GFX90A-NEXT: v_lshlrev_b64 v[4:5], v12, v[10:11]
+; GFX90A-NEXT: v_lshlrev_b64 v[8:9], v13, v[8:9]
+; GFX90A-NEXT: v_lshlrev_b64 v[6:7], v14, v[6:7]
; GFX90A-NEXT: v_min_u32_e32 v2, 1, v2
-; GFX90A-NEXT: v_or_b32_e32 v6, v7, v6
-; GFX90A-NEXT: v_or_b32_e32 v7, v9, v8
-; GFX90A-NEXT: v_or_b32_e32 v4, v5, v4
+; GFX90A-NEXT: v_min_u32_e32 v4, 1, v4
+; GFX90A-NEXT: v_min_u32_e32 v8, 1, v8
+; GFX90A-NEXT: v_min_u32_e32 v6, 1, v6
; GFX90A-NEXT: v_or_b32_e32 v2, v3, v2
-; GFX90A-NEXT: v_cvt_f32_i32_e32 v3, v6
-; GFX90A-NEXT: v_cvt_f32_i32_e32 v5, v7
-; GFX90A-NEXT: v_cvt_f32_i32_e32 v4, v4
+; GFX90A-NEXT: v_or_b32_e32 v3, v5, v4
+; GFX90A-NEXT: v_or_b32_e32 v4, v9, v8
+; GFX90A-NEXT: v_or_b32_e32 v5, v7, v6
; GFX90A-NEXT: v_cvt_f32_i32_e32 v2, v2
-; GFX90A-NEXT: v_sub_u32_e32 v10, 32, v10
-; GFX90A-NEXT: v_sub_u32_e32 v11, 32, v11
-; GFX90A-NEXT: v_sub_u32_e32 v12, 32, v12
-; GFX90A-NEXT: v_sub_u32_e32 v13, 32, v13
+; GFX90A-NEXT: v_cvt_f32_i32_e32 v3, v3
+; GFX90A-NEXT: v_cvt_f32_i32_e32 v4, v4
+; GFX90A-NEXT: v_cvt_f32_i32_e32 v5, v5
+; GFX90A-NEXT: v_sub_u32_e32 v15, 32, v18
+; GFX90A-NEXT: v_sub_u32_e32 v10, 32, v12
+; GFX90A-NEXT: v_sub_u32_e32 v11, 32, v13
+; GFX90A-NEXT: v_sub_u32_e32 v12, 32, v14
+; GFX90A-NEXT: v_ldexp_f32 v2, v2, v15
; GFX90A-NEXT: v_ldexp_f32 v3, v3, v10
-; GFX90A-NEXT: v_ldexp_f32 v5, v5, v11
-; GFX90A-NEXT: v_ldexp_f32 v4, v4, v12
-; GFX90A-NEXT: v_ldexp_f32 v2, v2, v13
-; GFX90A-NEXT: v_cvt_f16_f32_e32 v3, v3
-; GFX90A-NEXT: v_cvt_f16_f32_e32 v5, v5
-; GFX90A-NEXT: v_cvt_f16_f32_e32 v4, v4
+; GFX90A-NEXT: v_ldexp_f32 v4, v4, v11
+; GFX90A-NEXT: v_ldexp_f32 v5, v5, v12
; GFX90A-NEXT: v_cvt_f16_f32_e32 v2, v2
-; GFX90A-NEXT: v_pack_b32_f16 v3, v5, v3
-; GFX90A-NEXT: v_pack_b32_f16 v2, v2, v4
+; GFX90A-NEXT: v_cvt_f16_f32_e32 v4, v4
+; GFX90A-NEXT: v_cvt_f16_f32_e32 v5, v5
+; GFX90A-NEXT: v_cvt_f16_f32_e32 v6, v3
+; GFX90A-NEXT: v_pack_b32_f16 v3, v4, v5
+; GFX90A-NEXT: v_pack_b32_f16 v2, v2, v6
; GFX90A-NEXT: global_store_dwordx2 v[0:1], v[2:3], off
; GFX90A-NEXT: s_waitcnt vmcnt(0)
; GFX90A-NEXT: s_setpc_b64 s[30:31]
@@ -1080,72 +1066,63 @@ define void @sitofp_i48_to_half(ptr addrspace(1) noalias %out, ptr addrspace(1)
; GFX1100: ; %bb.0:
; GFX1100-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX1100-NEXT: s_clause 0x7
-; GFX1100-NEXT: global_load_u16 v5, v[2:3], off offset:12
+; GFX1100-NEXT: global_load_i16 v5, v[2:3], off offset:4
; GFX1100-NEXT: global_load_b32 v6, v[2:3], off offset:24
; GFX1100-NEXT: global_load_b32 v8, v[2:3], off offset:16
-; GFX1100-NEXT: global_load_b32 v4, v[2:3], off offset:8
-; GFX1100-NEXT: global_load_u16 v11, v[2:3], off offset:4
-; GFX1100-NEXT: global_load_b32 v10, v[2:3], off
-; GFX1100-NEXT: global_load_u16 v7, v[2:3], off offset:28
-; GFX1100-NEXT: global_load_u16 v9, v[2:3], off offset:20
-; GFX1100-NEXT: s_waitcnt vmcnt(4)
-; GFX1100-NEXT: v_lshlrev_b64 v[2:3], 16, v[4:5]
+; GFX1100-NEXT: global_load_b32 v10, v[2:3], off offset:8
+; GFX1100-NEXT: global_load_b32 v4, v[2:3], off
+; GFX1100-NEXT: global_load_i16 v11, v[2:3], off offset:12
+; GFX1100-NEXT: global_load_i16 v9, v[2:3], off offset:20
+; GFX1100-NEXT: global_load_i16 v7, v[2:3], off offset:28
+; GFX1100-NEXT: s_waitcnt vmcnt(7)
+; GFX1100-NEXT: v_cls_i32_e32 v3, v5
+; GFX1100-NEXT: s_waitcnt vmcnt(3)
+; GFX1100-NEXT: v_xor_b32_e32 v2, v4, v5
; GFX1100-NEXT: s_waitcnt vmcnt(2)
-; GFX1100-NEXT: v_lshlrev_b64 v[4:5], 16, v[10:11]
+; GFX1100-NEXT: v_xor_b32_e32 v12, v10, v11
; GFX1100-NEXT: s_waitcnt vmcnt(1)
-; GFX1100-NEXT: v_lshlrev_b64 v[6:7], 16, v[6:7]
+; GFX1100-NEXT: v_xor_b32_e32 v14, v8, v9
; GFX1100-NEXT: s_waitcnt vmcnt(0)
-; GFX1100-NEXT: v_lshlrev_b64 v[8:9], 16, v[8:9]
-; GFX1100-NEXT: v_ashrrev_i64 v[2:3], 16, v[2:3]
-; GFX1100-NEXT: v_ashrrev_i64 v[4:5], 16, v[4:5]
-; GFX1100-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
-; GFX1100-NEXT: v_ashrrev_i64 v[6:7], 16, v[6:7]
-; GFX1100-NEXT: v_ashrrev_i64 v[8:9], 16, v[8:9]
-; GFX1100-NEXT: s_delay_alu instid0(VALU_DEP_4)
-; GFX1100-NEXT: v_xor_b32_e32 v10, v2, v3
-; GFX1100-NEXT: v_cls_i32_e32 v11, v3
-; GFX1100-NEXT: v_xor_b32_e32 v12, v4, v5
-; GFX1100-NEXT: v_xor_b32_e32 v14, v6, v7
-; GFX1100-NEXT: v_xor_b32_e32 v16, v8, v9
-; GFX1100-NEXT: v_cls_i32_e32 v13, v5
-; GFX1100-NEXT: v_cls_i32_e32 v15, v7
-; GFX1100-NEXT: v_cls_i32_e32 v17, v9
-; GFX1100-NEXT: v_ashrrev_i32_e32 v10, 31, v10
+; GFX1100-NEXT: v_xor_b32_e32 v16, v6, v7
+; GFX1100-NEXT: v_cls_i32_e32 v13, v11
+; GFX1100-NEXT: v_cls_i32_e32 v15, v9
+; GFX1100-NEXT: v_cls_i32_e32 v17, v7
+; GFX1100-NEXT: v_ashrrev_i32_e32 v2, 31, v2
; GFX1100-NEXT: v_ashrrev_i32_e32 v12, 31, v12
; GFX1100-NEXT: v_ashrrev_i32_e32 v14, 31, v14
; GFX1100-NEXT: v_ashrrev_i32_e32 v16, 31, v16
-; GFX1100-NEXT: v_add_nc_u32_e32 v11, -1, v11
+; GFX1100-NEXT: v_add_nc_u32_e32 v3, -1, v3
; GFX1100-NEXT: v_add_nc_u32_e32 v13, -1, v13
; GFX1100-NEXT: v_add_nc_u32_e32 v15, -1, v15
; GFX1100-NEXT: v_add_nc_u32_e32 v17, -1, v17
-; GFX1100-NEXT: v_add_nc_u32_e32 v10, 32, v10
+; GFX1100-NEXT: v_add_nc_u32_e32 v2, 32, v2
; GFX1100-NEXT: v_add_nc_u32_e32 v12, 32, v12
; GFX1100-NEXT: v_add_nc_u32_e32 v14, 32, v14
; GFX1100-NEXT: v_add_nc_u32_e32 v16, 32, v16
; GFX1100-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
-; GFX1100-NEXT: v_min_u32_e32 v10, v11, v10
-; GFX1100-NEXT: v_min_u32_e32 v11, v13, v12
+; GFX1100-NEXT: v_min_u32_e32 v18, v3, v2
+; GFX1100-NEXT: v_min_u32_e32 v12, v13, v12
; GFX1100-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
-; GFX1100-NEXT: v_min_u32_e32 v12, v15, v14
-; GFX1100-NEXT: v_min_u32_e32 v13, v17, v16
+; GFX1100-NEXT: v_min_u32_e32 v13, v15, v14
+; GFX1100-NEXT: v_min_u32_e32 v14, v17, v16
; GFX1100-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
-; GFX1100-NEXT: v_lshlrev_b64 v[2:3], v10, v[2:3]
-; GFX1100-NEXT: v_lshlrev_b64 v[4:5], v11, v[4:5]
+; GFX1100-NEXT: v_lshlrev_b64 v[2:3], v18, v[4:5]
+; GFX1100-NEXT: v_lshlrev_b64 v[4:5], v12, v[10:11]
; GFX1100-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
-; GFX1100-NEXT: v_lshlrev_b64 v[6:7], v12, v[6:7]
; GFX1100-NEXT: v_lshlrev_b64 v[8:9], v13, v[8:9]
-; GFX1100-NEXT: v_sub_nc_u32_e32 v10, 32, v10
-; GFX1100-NEXT: v_sub_nc_u32_e32 v11, 32, v11
+; GFX1100-NEXT: v_lshlrev_b64 v[6:7], v14, v[6:7]
+; GFX1100-NEXT: v_sub_nc_u32_e32 v10, 32, v18
+; GFX1100-NEXT: v_sub_nc_u32_e32 v11, 32, v12
; GFX1100-NEXT: v_min_u32_e32 v2, 1, v2
; GFX1100-NEXT: v_min_u32_e32 v4, 1, v4
-; GFX1100-NEXT: v_min_u32_e32 v6, 1, v6
; GFX1100-NEXT: v_min_u32_e32 v8, 1, v8
-; GFX1100-NEXT: v_sub_nc_u32_e32 v12, 32, v12
+; GFX1100-NEXT: v_min_u32_e32 v6, 1, v6
+; GFX1100-NEXT: v_sub_nc_u32_e32 v12, 32, v13
; GFX1100-NEXT: v_or_b32_e32 v2, v3, v2
; GFX1100-NEXT: v_or_b32_e32 v3, v5, v4
-; GFX1100-NEXT: v_or_b32_e32 v4, v7, v6
-; GFX1100-NEXT: v_or_b32_e32 v5, v9, v8
-; GFX1100-NEXT: v_sub_nc_u32_e32 v6, 32, v13
+; GFX1100-NEXT: v_or_b32_e32 v4, v9, v8
+; GFX1100-NEXT: v_or_b32_e32 v5, v7, v6
+; GFX1100-NEXT: v_sub_nc_u32_e32 v6, 32, v14
; GFX1100-NEXT: v_cvt_f32_i32_e32 v2, v2
; GFX1100-NEXT: v_cvt_f32_i32_e32 v3, v3
; GFX1100-NEXT: v_cvt_f32_i32_e32 v4, v4
@@ -1157,11 +1134,11 @@ define void @sitofp_i48_to_half(ptr addrspace(1) noalias %out, ptr addrspace(1)
; GFX1100-NEXT: v_ldexp_f32 v4, v4, v12
; GFX1100-NEXT: v_ldexp_f32 v5, v5, v6
; GFX1100-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
-; GFX1100-NEXT: v_cvt_f16_f32_e32 v2.h, v2
-; GFX1100-NEXT: v_cvt_f16_f32_e32 v2.l, v3
+; GFX1100-NEXT: v_cvt_f16_f32_e32 v2.l, v2
+; GFX1100-NEXT: v_cvt_f16_f32_e32 v2.h, v3
; GFX1100-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
-; GFX1100-NEXT: v_cvt_f16_f32_e32 v3.h, v4
-; GFX1100-NEXT: v_cvt_f16_f32_e32 v3.l, v5
+; GFX1100-NEXT: v_cvt_f16_f32_e32 v3.l, v4
+; GFX1100-NEXT: v_cvt_f16_f32_e32 v3.h, v5
; GFX1100-NEXT: global_store_b64 v[0:1], v[2:3], off
; GFX1100-NEXT: s_setpc_b64 s[30:31]
;
@@ -1170,83 +1147,73 @@ define void @sitofp_i48_to_half(ptr addrspace(1) noalias %out, ptr addrspace(1)
; GFX1250-NEXT: s_wait_loadcnt_dscnt 0x0
; GFX1250-NEXT: s_wait_kmcnt 0x0
; GFX1250-NEXT: s_clause 0x7
-; GFX1250-NEXT: global_load_u16 v5, v[2:3], off offset:20
-; GFX1250-NEXT: global_load_u16 v7, v[2:3], off offset:28
+; GFX1250-NEXT: global_load_i16 v5, v[2:3], off offset:4
; GFX1250-NEXT: global_load_b32 v6, v[2:3], off offset:24
-; GFX1250-NEXT: global_load_u16 v9, v[2:3], off offset:12
-; GFX1250-NEXT: global_load_b32 v4, v[2:3], off offset:16
-; GFX1250-NEXT: global_load_u16 v11, v[2:3], off offset:4
-; GFX1250-NEXT: global_load_b32 v8, v[2:3], off offset:8
-; GFX1250-NEXT: global_load_b32 v10, v[2:3], off
-; GFX1250-NEXT: s_wait_loadcnt 0x5
+; GFX1250-NEXT: global_load_b32 v8, v[2:3], off offset:16
+; GFX1250-NEXT: global_load_b32 v10, v[2:3], off offset:8
+; GFX1250-NEXT: global_load_b32 v4, v[2:3], off
+; GFX1250-NEXT: global_load_i16 v11, v[2:3], off offset:12
+; GFX1250-NEXT: global_load_i16 v9, v[2:3], off offset:20
+; GFX1250-NEXT: global_load_i16 v7, v[2:3], off offset:28
+; GFX1250-NEXT: s_wait_loadcnt 0x7
; GFX1250-NEXT: s_wait_xcnt 0x0
-; GFX1250-NEXT: v_lshlrev_b64_e32 v[2:3], 16, v[6:7]
+; GFX1250-NEXT: v_cls_i32_e32 v3, v5
; GFX1250-NEXT: s_wait_loadcnt 0x3
-; GFX1250-NEXT: v_lshlrev_b64_e32 v[4:5], 16, v[4:5]
-; GFX1250-NEXT: s_wait_loadcnt 0x1
-; GFX1250-NEXT: v_lshlrev_b64_e32 v[6:7], 16, v[8:9]
+; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_1)
+; GFX1250-NEXT: v_dual_add_nc_u32 v3, -1, v3 :: v_dual_bitop2_b32 v2, v4, v5 bitop3:0x14
+; GFX1250-NEXT: s_wait_loadcnt 0x2
+; GFX1250-NEXT: v_xor_b32_e32 v12, v10, v11
+; GFX1250-NEXT: v_cls_i32_e32 v13, v11
; GFX1250-NEXT: s_wait_loadcnt 0x0
-; GFX1250-NEXT: v_lshlrev_b64_e32 v[8:9], 16, v[10:11]
-; GFX1250-NEXT: v_ashrrev_i64 v[2:3], 16, v[2:3]
-; GFX1250-NEXT: v_ashrrev_i64 v[4:5], 16, v[4:5]
-; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
-; GFX1250-NEXT: v_ashrrev_i64 v[6:7], 16, v[6:7]
-; GFX1250-NEXT: v_ashrrev_i64 v[8:9], 16, v[8:9]
-; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
-; GFX1250-NEXT: v_cls_i32_e32 v11, v3
-; GFX1250-NEXT: v_xor_b32_e32 v12, v4, v5
-; GFX1250-NEXT: v_xor_b32_e32 v10, v2, v3
-; GFX1250-NEXT: v_cls_i32_e32 v13, v5
-; GFX1250-NEXT: v_xor_b32_e32 v14, v6, v7
-; GFX1250-NEXT: v_dual_add_nc_u32 v11, -1, v11 :: v_dual_bitop2_b32 v16, v8, v9 bitop3:0x14
-; GFX1250-NEXT: v_cls_i32_e32 v15, v7
-; GFX1250-NEXT: v_cls_i32_e32 v17, v9
-; GFX1250-NEXT: v_dual_ashrrev_i32 v12, 31, v12 :: v_dual_ashrrev_i32 v10, 31, v10
+; GFX1250-NEXT: v_dual_ashrrev_i32 v2, 31, v2 :: v_dual_bitop2_b32 v16, v6, v7 bitop3:0x14
+; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_2) | instid1(VALU_DEP_3)
+; GFX1250-NEXT: v_dual_ashrrev_i32 v12, 31, v12 :: v_dual_bitop2_b32 v14, v8, v9 bitop3:0x14
+; GFX1250-NEXT: v_cls_i32_e32 v15, v9
+; GFX1250-NEXT: v_cls_i32_e32 v17, v7
; GFX1250-NEXT: v_dual_add_nc_u32 v13, -1, v13 :: v_dual_ashrrev_i32 v14, 31, v14
-; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_3)
-; GFX1250-NEXT: v_dual_add_nc_u32 v15, -1, v15 :: v_dual_ashrrev_i32 v16, 31, v16
-; GFX1250-NEXT: v_dual_add_nc_u32 v17, -1, v17 :: v_dual_add_nc_u32 v10, 32, v10
; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
-; GFX1250-NEXT: v_dual_add_nc_u32 v12, 32, v12 :: v_dual_add_nc_u32 v14, 32, v14
+; GFX1250-NEXT: v_dual_ashrrev_i32 v16, 31, v16 :: v_dual_add_nc_u32 v15, -1, v15
+; GFX1250-NEXT: v_dual_add_nc_u32 v17, -1, v17 :: v_dual_add_nc_u32 v2, 32, v2
+; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
+; GFX1250-NEXT: v_dual_add_nc_u32 v14, 32, v14 :: v_dual_add_nc_u32 v12, 32, v12
; GFX1250-NEXT: v_add_nc_u32_e32 v16, 32, v16
; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
-; GFX1250-NEXT: v_min_u32_e32 v10, v11, v10
-; GFX1250-NEXT: v_min_u32_e32 v11, v13, v12
+; GFX1250-NEXT: v_min_u32_e32 v18, v3, v2
+; GFX1250-NEXT: v_min_u32_e32 v14, v15, v14
; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
-; GFX1250-NEXT: v_min_u32_e32 v12, v15, v14
-; GFX1250-NEXT: v_min_u32_e32 v13, v17, v16
+; GFX1250-NEXT: v_min_u32_e32 v12, v13, v12
+; GFX1250-NEXT: v_min_u32_e32 v15, v17, v16
; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
-; GFX1250-NEXT: v_lshlrev_b64_e32 v[2:3], v10, v[2:3]
-; GFX1250-NEXT: v_lshlrev_b64_e32 v[4:5], v11, v[4:5]
+; GFX1250-NEXT: v_lshlrev_b64_e32 v[2:3], v18, v[4:5]
+; GFX1250-NEXT: v_lshlrev_b64_e32 v[4:5], v14, v[8:9]
; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
-; GFX1250-NEXT: v_lshlrev_b64_e32 v[6:7], v12, v[6:7]
-; GFX1250-NEXT: v_lshlrev_b64_e32 v[8:9], v13, v[8:9]
-; GFX1250-NEXT: v_dual_sub_nc_u32 v10, 32, v10 :: v_dual_sub_nc_u32 v11, 32, v11
+; GFX1250-NEXT: v_lshlrev_b64_e32 v[8:9], v12, v[10:11]
+; GFX1250-NEXT: v_lshlrev_b64_e32 v[6:7], v15, v[6:7]
+; GFX1250-NEXT: v_dual_sub_nc_u32 v10, 32, v18 :: v_dual_sub_nc_u32 v11, 32, v12
; GFX1250-NEXT: v_min_u32_e32 v2, 1, v2
; GFX1250-NEXT: v_min_u32_e32 v4, 1, v4
-; GFX1250-NEXT: v_min_u32_e32 v6, 1, v6
; GFX1250-NEXT: v_min_u32_e32 v8, 1, v8
-; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
-; GFX1250-NEXT: v_dual_sub_nc_u32 v12, 32, v12 :: v_dual_bitop2_b32 v2, v3, v2 bitop3:0x54
+; GFX1250-NEXT: v_min_u32_e32 v6, 1, v6
+; GFX1250-NEXT: v_sub_nc_u32_e32 v12, 32, v14
+; GFX1250-NEXT: v_or_b32_e32 v2, v3, v2
; GFX1250-NEXT: v_or_b32_e32 v3, v5, v4
-; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
-; GFX1250-NEXT: v_or_b32_e32 v4, v7, v6
-; GFX1250-NEXT: v_dual_sub_nc_u32 v6, 32, v13 :: v_dual_bitop2_b32 v5, v9, v8 bitop3:0x54
+; GFX1250-NEXT: v_or_b32_e32 v5, v9, v8
+; GFX1250-NEXT: v_dual_sub_nc_u32 v6, 32, v15 :: v_dual_bitop2_b32 v4, v7, v6 bitop3:0x54
; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
; GFX1250-NEXT: v_cvt_f32_i32_e32 v2, v2
; GFX1250-NEXT: v_cvt_f32_i32_e32 v3, v3
; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
-; GFX1250-NEXT: v_cvt_f32_i32_e32 v4, v4
; GFX1250-NEXT: v_cvt_f32_i32_e32 v5, v5
+; GFX1250-NEXT: v_cvt_f32_i32_e32 v4, v4
; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
; GFX1250-NEXT: v_ldexp_f32 v2, v2, v10
-; GFX1250-NEXT: v_ldexp_f32 v3, v3, v11
+; GFX1250-NEXT: v_ldexp_f32 v3, v3, v12
; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
-; GFX1250-NEXT: v_ldexp_f32 v4, v4, v12
-; GFX1250-NEXT: v_ldexp_f32 v5, v5, v6
-; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
-; GFX1250-NEXT: v_cvt_pk_f16_f32 v3, v3, v2
-; GFX1250-NEXT: v_cvt_pk_f16_f32 v2, v5, v4
+; GFX1250-NEXT: v_ldexp_f32 v5, v5, v11
+; GFX1250-NEXT: v_ldexp_f32 v4, v4, v6
+; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
+; GFX1250-NEXT: v_cvt_pk_f16_f32 v2, v2, v5
+; GFX1250-NEXT: v_cvt_pk_f16_f32 v3, v3, v4
; GFX1250-NEXT: global_store_b64 v[0:1], v[2:3], off
; GFX1250-NEXT: s_set_pc_i64 s[30:31]
%x0 = load i48, ptr addrspace(1) %in, align 8
@@ -1274,77 +1241,74 @@ define void @uitofp_i56_to_half(ptr addrspace(1) noalias %out, ptr addrspace(1)
; GFX900-LABEL: uitofp_i56_to_half:
; GFX900: ; %bb.0:
; GFX900-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
+; GFX900-NEXT: v_mov_b32_e32 v5, 0
; GFX900-NEXT: v_mov_b32_e32 v7, 0
-; GFX900-NEXT: v_mov_b32_e32 v9, 0
-; GFX900-NEXT: global_load_ubyte_d16_hi v7, v[2:3], off offset:6
+; GFX900-NEXT: global_load_ubyte_d16_hi v5, v[2:3], off offset:6
; GFX900-NEXT: s_nop 0
-; GFX900-NEXT: global_load_ubyte_d16_hi v9, v[2:3], off offset:14
+; GFX900-NEXT: global_load_ubyte_d16_hi v7, v[2:3], off offset:14
; GFX900-NEXT: s_nop 0
-; GFX900-NEXT: global_load_ushort v11, v[2:3], off offset:20
+; GFX900-NEXT: global_load_ushort v12, v[2:3], off offset:20
; GFX900-NEXT: global_load_dword v4, v[2:3], off offset:16
-; GFX900-NEXT: global_load_ushort v12, v[2:3], off offset:12
+; GFX900-NEXT: global_load_ushort v13, v[2:3], off offset:12
; GFX900-NEXT: global_load_dword v6, v[2:3], off offset:8
-; GFX900-NEXT: global_load_ushort v13, v[2:3], off offset:4
-; GFX900-NEXT: v_mov_b32_e32 v5, 0
+; GFX900-NEXT: global_load_ushort v9, v[2:3], off offset:4
+; GFX900-NEXT: v_mov_b32_e32 v11, 0
; GFX900-NEXT: v_mov_b32_e32 v14, 0
; GFX900-NEXT: global_load_ubyte_d16_hi v14, v[2:3], off offset:22
; GFX900-NEXT: s_nop 0
-; GFX900-NEXT: global_load_ubyte_d16_hi v5, v[2:3], off offset:30
+; GFX900-NEXT: global_load_ubyte_d16_hi v11, v[2:3], off offset:30
; GFX900-NEXT: s_nop 0
; GFX900-NEXT: global_load_ushort v15, v[2:3], off offset:28
; GFX900-NEXT: global_load_dword v8, v[2:3], off
; GFX900-NEXT: global_load_dword v10, v[2:3], off offset:24
; GFX900-NEXT: s_waitcnt vmcnt(7)
-; GFX900-NEXT: v_or_b32_e32 v3, v12, v9
+; GFX900-NEXT: v_or_b32_e32 v7, v13, v7
+; GFX900-NEXT: v_ffbh_u32_e32 v3, v7
+; GFX900-NEXT: s_waitcnt vmcnt(5)
+; GFX900-NEXT: v_or_b32_e32 v9, v9, v5
; GFX900-NEXT: s_waitcnt vmcnt(4)
-; GFX900-NEXT: v_or_b32_e32 v11, v11, v14
-; GFX900-NEXT: v_or_b32_e32 v2, v13, v7
+; GFX900-NEXT: v_or_b32_e32 v5, v12, v14
; GFX900-NEXT: s_waitcnt vmcnt(2)
-; GFX900-NEXT: v_or_b32_e32 v12, v15, v5
-; GFX900-NEXT: v_and_b32_e32 v9, 0xffffff, v2
-; GFX900-NEXT: v_and_b32_e32 v7, 0xffffff, v3
-; GFX900-NEXT: v_and_b32_e32 v5, 0xffffff, v11
-; GFX900-NEXT: v_and_b32_e32 v11, 0xffffff, v12
-; GFX900-NEXT: v_ffbh_u32_e32 v2, v7
-; GFX900-NEXT: v_ffbh_u32_e32 v3, v9
-; GFX900-NEXT: v_ffbh_u32_e32 v12, v11
-; GFX900-NEXT: v_ffbh_u32_e32 v13, v5
+; GFX900-NEXT: v_or_b32_e32 v11, v15, v11
+; GFX900-NEXT: v_ffbh_u32_e32 v2, v9
+; GFX900-NEXT: v_ffbh_u32_e32 v12, v5
+; GFX900-NEXT: v_ffbh_u32_e32 v13, v11
; GFX900-NEXT: v_min_u32_e32 v14, 32, v2
; GFX900-NEXT: v_min_u32_e32 v15, 32, v3
; GFX900-NEXT: v_min_u32_e32 v12, 32, v12
; GFX900-NEXT: v_min_u32_e32 v13, 32, v13
-; GFX900-NEXT: v_lshlrev_b64 v[2:3], v14, v[6:7]
; GFX900-NEXT: s_waitcnt vmcnt(1)
-; GFX900-NEXT: v_lshlrev_b64 v[6:7], v15, v[8:9]
+; GFX900-NEXT: v_lshlrev_b64 v[2:3], v14, v[8:9]
+; GFX900-NEXT: v_lshlrev_b64 v[6:7], v15, v[6:7]
+; GFX900-NEXT: v_lshlrev_b64 v[4:5], v12, v[4:5]
; GFX900-NEXT: s_waitcnt vmcnt(0)
-; GFX900-NEXT: v_lshlrev_b64 v[8:9], v12, v[10:11]
-; GFX900-NEXT: v_lshlrev_b64 v[4:5], v13, v[4:5]
+; GFX900-NEXT: v_lshlrev_b64 v[8:9], v13, v[10:11]
; GFX900-NEXT: v_min_u32_e32 v2, 1, v2
; GFX900-NEXT: v_min_u32_e32 v6, 1, v6
-; GFX900-NEXT: v_min_u32_e32 v8, 1, v8
; GFX900-NEXT: v_min_u32_e32 v4, 1, v4
+; GFX900-NEXT: v_min_u32_e32 v8, 1, v8
; GFX900-NEXT: v_or_b32_e32 v2, v3, v2
; GFX900-NEXT: v_or_b32_e32 v3, v7, v6
-; GFX900-NEXT: v_or_b32_e32 v6, v9, v8
; GFX900-NEXT: v_or_b32_e32 v4, v5, v4
+; GFX900-NEXT: v_or_b32_e32 v5, v9, v8
; GFX900-NEXT: v_cvt_f32_u32_e32 v2, v2
; GFX900-NEXT: v_cvt_f32_u32_e32 v3, v3
-; GFX900-NEXT: v_cvt_f32_u32_e32 v5, v6
; GFX900-NEXT: v_cvt_f32_u32_e32 v4, v4
+; GFX900-NEXT: v_cvt_f32_u32_e32 v5, v5
; GFX900-NEXT: v_sub_u32_e32 v14, 32, v14
; GFX900-NEXT: v_sub_u32_e32 v15, 32, v15
-; GFX900-NEXT: v_sub_u32_e32 v10, 32, v12
-; GFX900-NEXT: v_sub_u32_e32 v11, 32, v13
+; GFX900-NEXT: v_sub_u32_e32 v12, 32, v12
+; GFX900-NEXT: v_sub_u32_e32 v10, 32, v13
; GFX900-NEXT: v_ldexp_f32 v2, v2, v14
; GFX900-NEXT: v_ldexp_f32 v3, v3, v15
+; GFX900-NEXT: v_ldexp_f32 v4, v4, v12
; GFX900-NEXT: v_ldexp_f32 v5, v5, v10
-; GFX900-NEXT: v_ldexp_f32 v4, v4, v11
; GFX900-NEXT: v_cvt_f16_f32_e32 v2, v2
-; GFX900-NEXT: v_cvt_f16_f32_e32 v5, v5
; GFX900-NEXT: v_cvt_f16_f32_e32 v4, v4
+; GFX900-NEXT: v_cvt_f16_f32_e32 v5, v5
; GFX900-NEXT: v_cvt_f16_f32_e32 v6, v3
; GFX900-NEXT: v_pack_b32_f16 v3, v4, v5
-; GFX900-NEXT: v_pack_b32_f16 v2, v6, v2
+; GFX900-NEXT: v_pack_b32_f16 v2, v2, v6
; GFX900-NEXT: global_store_dwordx2 v[0:1], v[2:3], off
; GFX900-NEXT: s_waitcnt vmcnt(0)
; GFX900-NEXT: s_setpc_b64 s[30:31]
@@ -1354,73 +1318,64 @@ define void @uitofp_i56_to_half(ptr addrspace(1) noalias %out, ptr addrspace(1)
; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX90A-NEXT: global_load_ushort v5, v[2:3], off offset:4
; GFX90A-NEXT: global_load_ubyte v7, v[2:3], off offset:6
-; GFX90A-NEXT: global_load_ushort v9, v[2:3], off offset:12
-; GFX90A-NEXT: global_load_ubyte v11, v[2:3], off offset:14
-; GFX90A-NEXT: global_load_ushort v12, v[2:3], off offset:20
-; GFX90A-NEXT: global_load_ubyte v13, v[2:3], off offset:22
-; GFX90A-NEXT: global_load_ushort v14, v[2:3], off offset:28
-; GFX90A-NEXT: global_load_ubyte v15, v[2:3], off offset:30
-; GFX90A-NEXT: global_load_dword v10, v[2:3], off offset:24
-; GFX90A-NEXT: global_load_dword v8, v[2:3], off offset:16
+; GFX90A-NEXT: global_load_ushort v11, v[2:3], off offset:12
+; GFX90A-NEXT: global_load_ubyte v12, v[2:3], off offset:14
+; GFX90A-NEXT: global_load_ushort v13, v[2:3], off offset:20
+; GFX90A-NEXT: global_load_ubyte v14, v[2:3], off offset:22
+; GFX90A-NEXT: global_load_ushort v15, v[2:3], off offset:28
+; GFX90A-NEXT: global_load_ubyte v16, v[2:3], off offset:30
+; GFX90A-NEXT: global_load_dword v4, v[2:3], off offset:16
; GFX90A-NEXT: global_load_dword v6, v[2:3], off offset:8
-; GFX90A-NEXT: global_load_dword v4, v[2:3], off
+; GFX90A-NEXT: global_load_dword v8, v[2:3], off
+; GFX90A-NEXT: global_load_dword v10, v[2:3], off offset:24
; GFX90A-NEXT: s_waitcnt vmcnt(10)
-; GFX90A-NEXT: v_lshl_or_b32 v2, v7, 16, v5
-; GFX90A-NEXT: v_and_b32_e32 v5, 0xffffff, v2
+; GFX90A-NEXT: v_lshl_or_b32 v9, v7, 16, v5
+; GFX90A-NEXT: v_ffbh_u32_e32 v2, v9
; GFX90A-NEXT: s_waitcnt vmcnt(8)
-; GFX90A-NEXT: v_lshl_or_b32 v3, v11, 16, v9
-; GFX90A-NEXT: v_and_b32_e32 v7, 0xffffff, v3
+; GFX90A-NEXT: v_lshl_or_b32 v7, v12, 16, v11
+; GFX90A-NEXT: v_ffbh_u32_e32 v3, v7
; GFX90A-NEXT: s_waitcnt vmcnt(6)
-; GFX90A-NEXT: v_lshl_or_b32 v9, v13, 16, v12
-; GFX90A-NEXT: v_and_b32_e32 v9, 0xffffff, v9
+; GFX90A-NEXT: v_lshl_or_b32 v5, v14, 16, v13
+; GFX90A-NEXT: v_ffbh_u32_e32 v12, v5
; GFX90A-NEXT: s_waitcnt vmcnt(4)
-; GFX90A-NEXT: v_lshl_or_b32 v11, v15, 16, v14
-; GFX90A-NEXT: v_and_b32_e32 v11, 0xffffff, v11
-; GFX90A-NEXT: v_ffbh_u32_e32 v2, v11
-; GFX90A-NEXT: v_ffbh_u32_e32 v3, v9
-; GFX90A-NEXT: v_ffbh_u32_e32 v12, v7
-; GFX90A-NEXT: v_ffbh_u32_e32 v13, v5
+; GFX90A-NEXT: v_lshl_or_b32 v11, v16, 16, v15
+; GFX90A-NEXT: v_ffbh_u32_e32 v13, v11
; GFX90A-NEXT: v_min_u32_e32 v14, 32, v2
; GFX90A-NEXT: v_min_u32_e32 v15, 32, v3
; GFX90A-NEXT: v_min_u32_e32 v12, 32, v12
; GFX90A-NEXT: v_min_u32_e32 v13, 32, v13
-; GFX90A-NEXT: s_waitcnt vmcnt(3)
-; GFX90A-NEXT: v_lshlrev_b64 v[2:3], v14, v[10:11]
-; GFX90A-NEXT: s_waitcnt vmcnt(2)
-; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
-; GFX90A-NEXT: v_swap_b32 v0, v15
-; GFX90A-NEXT: v_lshlrev_b64 v[8:9], v0, v[8:9]
-; GFX90A-NEXT: v_swap_b32 v15, v0
; GFX90A-NEXT: s_waitcnt vmcnt(1)
-; GFX90A-NEXT: v_lshlrev_b64 v[6:7], v12, v[6:7]
+; GFX90A-NEXT: v_lshlrev_b64 v[2:3], v14, v[8:9]
+; GFX90A-NEXT: v_lshlrev_b64 v[6:7], v15, v[6:7]
+; GFX90A-NEXT: v_lshlrev_b64 v[4:5], v12, v[4:5]
; GFX90A-NEXT: s_waitcnt vmcnt(0)
-; GFX90A-NEXT: v_lshlrev_b64 v[4:5], v13, v[4:5]
+; GFX90A-NEXT: v_lshlrev_b64 v[8:9], v13, v[10:11]
; GFX90A-NEXT: v_min_u32_e32 v2, 1, v2
-; GFX90A-NEXT: v_min_u32_e32 v8, 1, v8
; GFX90A-NEXT: v_min_u32_e32 v6, 1, v6
; GFX90A-NEXT: v_min_u32_e32 v4, 1, v4
+; GFX90A-NEXT: v_min_u32_e32 v8, 1, v8
; GFX90A-NEXT: v_or_b32_e32 v2, v3, v2
-; GFX90A-NEXT: v_or_b32_e32 v3, v9, v8
-; GFX90A-NEXT: v_or_b32_e32 v6, v7, v6
+; GFX90A-NEXT: v_or_b32_e32 v3, v7, v6
; GFX90A-NEXT: v_or_b32_e32 v4, v5, v4
+; GFX90A-NEXT: v_or_b32_e32 v5, v9, v8
; GFX90A-NEXT: v_cvt_f32_u32_e32 v2, v2
; GFX90A-NEXT: v_cvt_f32_u32_e32 v3, v3
-; GFX90A-NEXT: v_cvt_f32_u32_e32 v5, v6
; GFX90A-NEXT: v_cvt_f32_u32_e32 v4, v4
-; GFX90A-NEXT: v_sub_u32_e32 v10, 32, v14
-; GFX90A-NEXT: v_sub_u32_e32 v11, 32, v15
+; GFX90A-NEXT: v_cvt_f32_u32_e32 v5, v5
+; GFX90A-NEXT: v_sub_u32_e32 v14, 32, v14
+; GFX90A-NEXT: v_sub_u32_e32 v15, 32, v15
; GFX90A-NEXT: v_sub_u32_e32 v12, 32, v12
-; GFX90A-NEXT: v_sub_u32_e32 v13, 32, v13
-; GFX90A-NEXT: v_ldexp_f32 v2, v2, v10
-; GFX90A-NEXT: v_ldexp_f32 v3, v3, v11
-; GFX90A-NEXT: v_ldexp_f32 v5, v5, v12
-; GFX90A-NEXT: v_ldexp_f32 v4, v4, v13
+; GFX90A-NEXT: v_sub_u32_e32 v10, 32, v13
+; GFX90A-NEXT: v_ldexp_f32 v2, v2, v14
+; GFX90A-NEXT: v_ldexp_f32 v3, v3, v15
+; GFX90A-NEXT: v_ldexp_f32 v4, v4, v12
+; GFX90A-NEXT: v_ldexp_f32 v5, v5, v10
; GFX90A-NEXT: v_cvt_f16_f32_e32 v2, v2
-; GFX90A-NEXT: v_cvt_f16_f32_e32 v3, v3
-; GFX90A-NEXT: v_cvt_f16_f32_e32 v5, v5
; GFX90A-NEXT: v_cvt_f16_f32_e32 v4, v4
-; GFX90A-NEXT: v_pack_b32_f16 v3, v3, v2
-; GFX90A-NEXT: v_pack_b32_f16 v2, v4, v5
+; GFX90A-NEXT: v_cvt_f16_f32_e32 v5, v5
+; GFX90A-NEXT: v_cvt_f16_f32_e32 v6, v3
+; GFX90A-NEXT: v_pack_b32_f16 v3, v4, v5
+; GFX90A-NEXT: v_pack_b32_f16 v2, v2, v6
; GFX90A-NEXT: global_store_dwordx2 v[0:1], v[2:3], off
; GFX90A-NEXT: s_waitcnt vmcnt(0)
; GFX90A-NEXT: s_setpc_b64 s[30:31]
@@ -1428,85 +1383,78 @@ define void @uitofp_i56_to_half(ptr addrspace(1) noalias %out, ptr addrspace(1)
; GFX1100-LABEL: uitofp_i56_to_half:
; GFX1100: ; %bb.0:
; GFX1100-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
-; GFX1100-NEXT: v_mov_b16_e32 v5.l, 0
+; GFX1100-NEXT: v_mov_b16_e32 v10.l, 0
; GFX1100-NEXT: s_delay_alu instid0(VALU_DEP_1)
-; GFX1100-NEXT: v_mov_b32_e32 v7, v5
-; GFX1100-NEXT: v_mov_b32_e32 v9, v5
-; GFX1100-NEXT: v_mov_b32_e32 v10, v5
+; GFX1100-NEXT: v_mov_b32_e32 v5, v10
+; GFX1100-NEXT: v_mov_b32_e32 v7, v10
+; GFX1100-NEXT: v_mov_b32_e32 v11, v10
; GFX1100-NEXT: s_clause 0xb
-; GFX1100-NEXT: global_load_d16_hi_u8 v5, v[2:3], off offset:30
-; GFX1100-NEXT: global_load_u16 v11, v[2:3], off offset:28
-; GFX1100-NEXT: global_load_d16_hi_u8 v7, v[2:3], off offset:6
-; GFX1100-NEXT: global_load_d16_hi_u8 v9, v[2:3], off offset:14
; GFX1100-NEXT: global_load_u16 v12, v[2:3], off offset:20
+; GFX1100-NEXT: global_load_d16_hi_u8 v5, v[2:3], off offset:6
+; GFX1100-NEXT: global_load_d16_hi_u8 v7, v[2:3], off offset:14
; GFX1100-NEXT: global_load_b32 v4, v[2:3], off offset:16
; GFX1100-NEXT: global_load_u16 v13, v[2:3], off offset:12
; GFX1100-NEXT: global_load_b32 v6, v[2:3], off offset:8
-; GFX1100-NEXT: global_load_u16 v14, v[2:3], off offset:4
-; GFX1100-NEXT: global_load_d16_hi_u8 v10, v[2:3], off offset:22
-; GFX1100-NEXT: global_load_b32 v8, v[2:3], off offset:24
-; GFX1100-NEXT: global_load_b32 v2, v[2:3], off
-; GFX1100-NEXT: s_waitcnt vmcnt(10)
-; GFX1100-NEXT: v_or_b32_e32 v3, v11, v5
+; GFX1100-NEXT: global_load_u16 v9, v[2:3], off offset:4
+; GFX1100-NEXT: global_load_d16_hi_u8 v11, v[2:3], off offset:22
+; GFX1100-NEXT: global_load_d16_hi_u8 v10, v[2:3], off offset:30
+; GFX1100-NEXT: global_load_u16 v14, v[2:3], off offset:28
+; GFX1100-NEXT: global_load_b32 v8, v[2:3], off
+; GFX1100-NEXT: global_load_b32 v2, v[2:3], off offset:24
+; GFX1100-NEXT: s_waitcnt vmcnt(7)
+; GFX1100-NEXT: v_or_b32_e32 v7, v13, v7
; GFX1100-NEXT: s_waitcnt vmcnt(5)
-; GFX1100-NEXT: v_or_b32_e32 v5, v13, v9
-; GFX1100-NEXT: s_delay_alu instid0(VALU_DEP_2)
-; GFX1100-NEXT: v_and_b32_e32 v9, 0xffffff, v3
-; GFX1100-NEXT: s_waitcnt vmcnt(3)
-; GFX1100-NEXT: v_or_b32_e32 v11, v14, v7
+; GFX1100-NEXT: v_or_b32_e32 v9, v9, v5
+; GFX1100-NEXT: s_waitcnt vmcnt(4)
+; GFX1100-NEXT: v_or_b32_e32 v5, v12, v11
; GFX1100-NEXT: s_waitcnt vmcnt(2)
-; GFX1100-NEXT: v_or_b32_e32 v10, v12, v10
-; GFX1100-NEXT: v_and_b32_e32 v7, 0xffffff, v5
-; GFX1100-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
-; GFX1100-NEXT: v_and_b32_e32 v3, 0xffffff, v11
-; GFX1100-NEXT: v_and_b32_e32 v5, 0xffffff, v10
+; GFX1100-NEXT: v_or_b32_e32 v3, v14, v10
+; GFX1100-NEXT: v_clz_i32_u32_e32 v11, v7
; GFX1100-NEXT: v_clz_i32_u32_e32 v10, v9
+; GFX1100-NEXT: v_clz_i32_u32_e32 v12, v5
; GFX1100-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
-; GFX1100-NEXT: v_clz_i32_u32_e32 v11, v7
-; GFX1100-NEXT: v_clz_i32_u32_e32 v12, v3
+; GFX1100-NEXT: v_clz_i32_u32_e32 v13, v3
+; GFX1100-NEXT: v_min_u32_e32 v11, 32, v11
; GFX1100-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
-; GFX1100-NEXT: v_clz_i32_u32_e32 v13, v5
; GFX1100-NEXT: v_min_u32_e32 v10, 32, v10
-; GFX1100-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
-; GFX1100-NEXT: v_min_u32_e32 v11, 32, v11
; GFX1100-NEXT: v_min_u32_e32 v12, 32, v12
-; GFX1100-NEXT: s_delay_alu instid0(VALU_DEP_4)
+; GFX1100-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
; GFX1100-NEXT: v_min_u32_e32 v13, 32, v13
+; GFX1100-NEXT: v_lshlrev_b64 v[6:7], v11, v[6:7]
; GFX1100-NEXT: s_waitcnt vmcnt(1)
; GFX1100-NEXT: v_lshlrev_b64 v[8:9], v10, v[8:9]
-; GFX1100-NEXT: v_lshlrev_b64 v[6:7], v11, v[6:7]
+; GFX1100-NEXT: v_lshlrev_b64 v[4:5], v12, v[4:5]
; GFX1100-NEXT: v_sub_nc_u32_e32 v10, 32, v10
; GFX1100-NEXT: s_waitcnt vmcnt(0)
-; GFX1100-NEXT: v_lshlrev_b64 v[2:3], v12, v[2:3]
-; GFX1100-NEXT: v_lshlrev_b64 v[4:5], v13, v[4:5]
-; GFX1100-NEXT: v_sub_nc_u32_e32 v11, 32, v11
-; GFX1100-NEXT: v_min_u32_e32 v8, 1, v8
+; GFX1100-NEXT: v_lshlrev_b64 v[2:3], v13, v[2:3]
+; GFX1100-NEXT: v_sub_nc_u32_e32 v13, 32, v13
; GFX1100-NEXT: v_min_u32_e32 v6, 1, v6
-; GFX1100-NEXT: v_sub_nc_u32_e32 v12, 32, v12
-; GFX1100-NEXT: v_min_u32_e32 v2, 1, v2
+; GFX1100-NEXT: v_min_u32_e32 v8, 1, v8
; GFX1100-NEXT: v_min_u32_e32 v4, 1, v4
-; GFX1100-NEXT: v_or_b32_e32 v8, v9, v8
+; GFX1100-NEXT: v_sub_nc_u32_e32 v11, 32, v11
+; GFX1100-NEXT: v_min_u32_e32 v2, 1, v2
; GFX1100-NEXT: v_or_b32_e32 v6, v7, v6
-; GFX1100-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
+; GFX1100-NEXT: v_or_b32_e32 v8, v9, v8
+; GFX1100-NEXT: v_or_b32_e32 v4, v5, v4
+; GFX1100-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(SKIP_1) | instid1(VALU_DEP_4)
; GFX1100-NEXT: v_or_b32_e32 v2, v3, v2
-; GFX1100-NEXT: v_or_b32_e32 v3, v5, v4
-; GFX1100-NEXT: v_sub_nc_u32_e32 v4, 32, v13
+; GFX1100-NEXT: v_sub_nc_u32_e32 v3, 32, v12
; GFX1100-NEXT: v_cvt_f32_u32_e32 v5, v8
; GFX1100-NEXT: v_cvt_f32_u32_e32 v6, v6
+; GFX1100-NEXT: v_cvt_f32_u32_e32 v4, v4
; GFX1100-NEXT: v_cvt_f32_u32_e32 v2, v2
-; GFX1100-NEXT: v_cvt_f32_u32_e32 v3, v3
; GFX1100-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
; GFX1100-NEXT: v_ldexp_f32 v5, v5, v10
; GFX1100-NEXT: v_ldexp_f32 v6, v6, v11
; GFX1100-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
-; GFX1100-NEXT: v_ldexp_f32 v7, v2, v12
-; GFX1100-NEXT: v_ldexp_f32 v4, v3, v4
+; GFX1100-NEXT: v_ldexp_f32 v3, v4, v3
+; GFX1100-NEXT: v_ldexp_f32 v4, v2, v13
; GFX1100-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
-; GFX1100-NEXT: v_cvt_f16_f32_e32 v3.h, v5
+; GFX1100-NEXT: v_cvt_f16_f32_e32 v2.l, v5
; GFX1100-NEXT: v_cvt_f16_f32_e32 v2.h, v6
; GFX1100-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
-; GFX1100-NEXT: v_cvt_f16_f32_e32 v2.l, v7
-; GFX1100-NEXT: v_cvt_f16_f32_e32 v3.l, v4
+; GFX1100-NEXT: v_cvt_f16_f32_e32 v3.l, v3
+; GFX1100-NEXT: v_cvt_f16_f32_e32 v3.h, v4
; GFX1100-NEXT: global_store_b64 v[0:1], v[2:3], off
; GFX1100-NEXT: s_setpc_b64 s[30:31]
;
@@ -1515,83 +1463,68 @@ define void @uitofp_i56_to_half(ptr addrspace(1) noalias %out, ptr addrspace(1)
; GFX1250-NEXT: s_wait_loadcnt_dscnt 0x0
; GFX1250-NEXT: s_wait_kmcnt 0x0
; GFX1250-NEXT: s_clause 0xb
-; GFX1250-NEXT: global_load_u8 v5, v[2:3], off offset:30
-; GFX1250-NEXT: global_load_u8 v7, v[2:3], off offset:22
-; GFX1250-NEXT: global_load_u8 v9, v[2:3], off offset:14
-; GFX1250-NEXT: global_load_u8 v11, v[2:3], off offset:6
+; GFX1250-NEXT: global_load_u8 v5, v[2:3], off offset:22
+; GFX1250-NEXT: global_load_u8 v11, v[2:3], off offset:30
; GFX1250-NEXT: global_load_u16 v12, v[2:3], off offset:28
-; GFX1250-NEXT: global_load_u16 v13, v[2:3], off offset:20
-; GFX1250-NEXT: global_load_u16 v14, v[2:3], off offset:12
-; GFX1250-NEXT: global_load_u16 v15, v[2:3], off offset:4
-; GFX1250-NEXT: global_load_b32 v4, v[2:3], off offset:24
+; GFX1250-NEXT: global_load_u8 v7, v[2:3], off offset:6
+; GFX1250-NEXT: global_load_b32 v4, v[2:3], off offset:8
+; GFX1250-NEXT: global_load_u16 v9, v[2:3], off offset:4
+; GFX1250-NEXT: global_load_u8 v13, v[2:3], off offset:14
+; GFX1250-NEXT: global_load_u16 v14, v[2:3], off offset:20
; GFX1250-NEXT: global_load_b32 v6, v[2:3], off offset:16
-; GFX1250-NEXT: global_load_b32 v8, v[2:3], off offset:8
-; GFX1250-NEXT: global_load_b32 v10, v[2:3], off
-; GFX1250-NEXT: s_wait_loadcnt 0xb
-; GFX1250-NEXT: s_wait_xcnt 0x0
-; GFX1250-NEXT: v_mov_b16_e32 v2.l, v5.l
-; GFX1250-NEXT: s_wait_loadcnt 0xa
-; GFX1250-NEXT: v_mov_b16_e32 v3.l, v7.l
+; GFX1250-NEXT: global_load_u16 v15, v[2:3], off offset:12
+; GFX1250-NEXT: global_load_b32 v8, v[2:3], off
+; GFX1250-NEXT: global_load_b32 v10, v[2:3], off offset:24
; GFX1250-NEXT: s_wait_loadcnt 0x9
-; GFX1250-NEXT: v_mov_b16_e32 v5.l, v9.l
-; GFX1250-NEXT: s_wait_loadcnt 0x8
-; GFX1250-NEXT: v_mov_b16_e32 v7.l, v11.l
-; GFX1250-NEXT: v_dual_lshlrev_b32 v2, 16, v2 :: v_dual_lshlrev_b32 v3, 16, v3
-; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
-; GFX1250-NEXT: v_dual_lshlrev_b32 v9, 16, v5 :: v_dual_lshlrev_b32 v11, 16, v7
-; GFX1250-NEXT: s_wait_loadcnt 0x7
-; GFX1250-NEXT: v_bitop3_b32 v5, v12, 0xffffff, v2 bitop3:0xc8
+; GFX1250-NEXT: v_lshl_or_b32 v11, v11, 16, v12
; GFX1250-NEXT: s_wait_loadcnt 0x6
-; GFX1250-NEXT: v_bitop3_b32 v7, v13, 0xffffff, v3 bitop3:0xc8
-; GFX1250-NEXT: s_wait_loadcnt 0x5
-; GFX1250-NEXT: v_bitop3_b32 v9, v14, 0xffffff, v9 bitop3:0xc8
+; GFX1250-NEXT: v_lshl_or_b32 v9, v7, 16, v9
; GFX1250-NEXT: s_wait_loadcnt 0x4
-; GFX1250-NEXT: v_bitop3_b32 v11, v15, 0xffffff, v11 bitop3:0xc8
-; GFX1250-NEXT: v_clz_i32_u32_e32 v2, v5
+; GFX1250-NEXT: v_lshl_or_b32 v7, v5, 16, v14
+; GFX1250-NEXT: v_clz_i32_u32_e32 v12, v11
+; GFX1250-NEXT: s_wait_loadcnt 0x2
+; GFX1250-NEXT: v_lshl_or_b32 v5, v13, 16, v15
+; GFX1250-NEXT: s_wait_xcnt 0x0
+; GFX1250-NEXT: v_clz_i32_u32_e32 v2, v9
; GFX1250-NEXT: v_clz_i32_u32_e32 v3, v7
-; GFX1250-NEXT: v_clz_i32_u32_e32 v12, v9
+; GFX1250-NEXT: v_min_u32_e32 v12, 32, v12
+; GFX1250-NEXT: v_clz_i32_u32_e32 v13, v5
; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
-; GFX1250-NEXT: v_clz_i32_u32_e32 v13, v11
; GFX1250-NEXT: v_min_u32_e32 v14, 32, v2
-; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
; GFX1250-NEXT: v_min_u32_e32 v15, 32, v3
-; GFX1250-NEXT: v_min_u32_e32 v12, 32, v12
-; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_4)
+; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_3)
; GFX1250-NEXT: v_min_u32_e32 v13, 32, v13
-; GFX1250-NEXT: s_wait_loadcnt 0x3
-; GFX1250-NEXT: v_lshlrev_b64_e32 v[2:3], v14, v[4:5]
-; GFX1250-NEXT: s_wait_loadcnt 0x2
-; GFX1250-NEXT: v_lshlrev_b64_e32 v[4:5], v15, v[6:7]
; GFX1250-NEXT: s_wait_loadcnt 0x1
-; GFX1250-NEXT: v_lshlrev_b64_e32 v[6:7], v12, v[8:9]
+; GFX1250-NEXT: v_lshlrev_b64_e32 v[2:3], v14, v[8:9]
; GFX1250-NEXT: s_wait_loadcnt 0x0
-; GFX1250-NEXT: v_lshlrev_b64_e32 v[8:9], v13, v[10:11]
-; GFX1250-NEXT: v_dual_sub_nc_u32 v10, 32, v14 :: v_dual_sub_nc_u32 v11, 32, v15
+; GFX1250-NEXT: v_lshlrev_b64_e32 v[8:9], v12, v[10:11]
+; GFX1250-NEXT: v_lshlrev_b64_e32 v[6:7], v15, v[6:7]
+; GFX1250-NEXT: v_dual_sub_nc_u32 v10, 32, v14 :: v_dual_sub_nc_u32 v11, 32, v13
+; GFX1250-NEXT: v_lshlrev_b64_e32 v[4:5], v13, v[4:5]
; GFX1250-NEXT: v_min_u32_e32 v2, 1, v2
-; GFX1250-NEXT: v_min_u32_e32 v4, 1, v4
-; GFX1250-NEXT: v_min_u32_e32 v6, 1, v6
; GFX1250-NEXT: v_min_u32_e32 v8, 1, v8
-; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
-; GFX1250-NEXT: v_dual_sub_nc_u32 v12, 32, v12 :: v_dual_bitop2_b32 v2, v3, v2 bitop3:0x54
-; GFX1250-NEXT: v_or_b32_e32 v3, v5, v4
-; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
-; GFX1250-NEXT: v_or_b32_e32 v4, v7, v6
-; GFX1250-NEXT: v_dual_sub_nc_u32 v6, 32, v13 :: v_dual_bitop2_b32 v5, v9, v8 bitop3:0x54
+; GFX1250-NEXT: v_min_u32_e32 v6, 1, v6
+; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_3)
+; GFX1250-NEXT: v_dual_sub_nc_u32 v13, 32, v15 :: v_dual_bitop2_b32 v2, v3, v2 bitop3:0x54
+; GFX1250-NEXT: v_min_u32_e32 v4, 1, v4
+; GFX1250-NEXT: v_or_b32_e32 v3, v7, v6
+; GFX1250-NEXT: v_or_b32_e32 v6, v9, v8
; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
; GFX1250-NEXT: v_cvt_f32_u32_e32 v2, v2
+; GFX1250-NEXT: v_or_b32_e32 v4, v5, v4
+; GFX1250-NEXT: v_sub_nc_u32_e32 v5, 32, v12
; GFX1250-NEXT: v_cvt_f32_u32_e32 v3, v3
-; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
-; GFX1250-NEXT: v_cvt_f32_u32_e32 v4, v4
-; GFX1250-NEXT: v_cvt_f32_u32_e32 v5, v5
-; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
+; GFX1250-NEXT: v_cvt_f32_u32_e32 v6, v6
; GFX1250-NEXT: v_ldexp_f32 v2, v2, v10
-; GFX1250-NEXT: v_ldexp_f32 v3, v3, v11
+; GFX1250-NEXT: v_cvt_f32_u32_e32 v4, v4
; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
-; GFX1250-NEXT: v_ldexp_f32 v4, v4, v12
-; GFX1250-NEXT: v_ldexp_f32 v5, v5, v6
+; GFX1250-NEXT: v_ldexp_f32 v3, v3, v13
+; GFX1250-NEXT: v_ldexp_f32 v5, v6, v5
; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
-; GFX1250-NEXT: v_cvt_pk_f16_f32 v3, v3, v2
-; GFX1250-NEXT: v_cvt_pk_f16_f32 v2, v5, v4
+; GFX1250-NEXT: v_ldexp_f32 v4, v4, v11
+; GFX1250-NEXT: v_cvt_pk_f16_f32 v3, v3, v5
+; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_2)
+; GFX1250-NEXT: v_cvt_pk_f16_f32 v2, v2, v4
; GFX1250-NEXT: global_store_b64 v[0:1], v[2:3], off
; GFX1250-NEXT: s_set_pc_i64 s[30:31]
%x0 = load i56, ptr addrspace(1) %in, align 8
More information about the llvm-commits
mailing list