Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1053,10 +1053,11 @@ AMDGPULegalizerInfo::AMDGPULegalizerInfo(const GCNSubtarget &ST_,
}

auto &FPTruncActions = getActionDefinitionsBuilder(G_FPTRUNC);
if (ST.hasCvtPkF16F32Inst())
FPTruncActions.legalFor(
{{S32, S64}, {S16, S32}, {V2S16, V2S32}, {V2S16, V2S64}});
else
if (ST.hasCvtPkF16F32Inst()) {
FPTruncActions.legalFor({{S32, S64}, {S16, S32}, {V2S16, V2S32}});
if (TM.Options.UnsafeFPMath)
FPTruncActions.legalFor({V2S16, V2S64});
} else
FPTruncActions.legalFor({{S32, S64}, {S16, S32}});
FPTruncActions.scalarize(0).lower();

Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/AMDGPU/SIISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,7 @@ SITargetLowering::SITargetLowering(const TargetMachine &TM,
setOperationAction(ISD::BUILD_VECTOR, MVT::v2bf16, Legal);
}

if (Subtarget->hasCvtPkF16F32Inst()) {
if (Subtarget->hasCvtPkF16F32Inst() && TM.Options.UnsafeFPMath) {
setOperationAction(ISD::FP_ROUND, MVT::v2f16, Legal);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It disables it not just from v2f64, but also from v2f32, right? How is that lowered then?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It disables it not just from v2f64, but also from v2f32, right? How is that lowered then?
We have a pattern to generate v_cvt_pk_f16_f32:

def : GCNPat<(v2f16 (fpround v2f32:$src)),

Even though we also have a pattern for v2f64->v2f16, but we will do splitting the vector and then Custom lowering of f64 ->f16 first.

def : GCNPat<(v2f16 (fpround v2f64:$src)),

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But the pattern shall not work for operation which is not legal.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But the pattern shall not work for operation which is not legal.

my observation is that, if we do not Expand/Custom/Promote, the pattern will be picked up, no matter you specify Legal or not. So it doesn't matter whether you specify Legal or not, pattern for v2f32->v2f16 wil always be picked up.

This is similar to f32 -> f16, even though we did not specify Legal, v_cvt_f16_f32 will still be selected.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default is Legal?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Legal is default:
https://llvm.org/docs/WritingAnLLVMBackend.html#legal

The reason we need to explicitly specify Legal sometimes is because we need to specify different Actions based on different hardware features.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am still learning. I think even though we specify Custom lowering but actually doing nothing, like:
if (SrcVT. != MVT::f64)
return Op; // f32 is legal for fp_round
This is essentially "Legal", which means either there is a native instruction, or a pattern to match to native instructions. The compiler will throw an error if there is nothing to select.

}

Expand Down
199 changes: 199 additions & 0 deletions llvm/test/CodeGen/AMDGPU/fptrunc.v2f16.fpmath.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test belongs in the existing fptrunc.f16.ll test

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test belongs in the existing fptrunc.f16.ll test

The existing fptrunc.f16.ll only checks when unsafe fpmath is set. This patch actually fixes the codegen when unsafe fpmath is not set for v2f16 only. Maybe we should not include scalar and wider in this file?

; RUN: llc -mtriple=amdgcn -mcpu=gfx950 -global-isel=0 < %s | FileCheck -check-prefixes=GFX950,GFX950-SAFE-SDAG %s
; RUN: llc -mtriple=amdgcn -mcpu=gfx950 -global-isel=1 < %s | FileCheck -check-prefixes=GFX950,GFX950-SAFE-GISEL %s
; RUN: llc -mtriple=amdgcn -mcpu=gfx950 -global-isel=0 -enable-unsafe-fp-math < %s | FileCheck -check-prefixes=GFX950,GFX950-UNSAFE %s
; RUN: llc -mtriple=amdgcn -mcpu=gfx950 -global-isel=1 -enable-unsafe-fp-math < %s | FileCheck -check-prefixes=GFX950,GFX950-UNSAFE %s

define amdgpu_ps <2 x half> @v_test_cvt_v2f32_v2f16(<2 x float> %src) {
Copy link
Contributor

@arsenm arsenm Apr 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need the shader conventions. Also test the scalar case and wider vector s

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need the shader conventions. Also test the scalar case and wider vector s

Removed the shade conventions, and added tests for other types.

; GFX950-LABEL: v_test_cvt_v2f32_v2f16:
; GFX950: ; %bb.0:
; GFX950-NEXT: v_cvt_pk_f16_f32 v0, v0, v1
; GFX950-NEXT: ; return to shader part epilog
%res = fptrunc <2 x float> %src to <2 x half>
ret <2 x half> %res
}

define amdgpu_ps <2 x half> @v_test_cvt_v2f64_v2f16(<2 x double> %src) {
; GFX950-SAFE-SDAG-LABEL: v_test_cvt_v2f64_v2f16:
; GFX950-SAFE-SDAG: ; %bb.0:
; GFX950-SAFE-SDAG-NEXT: s_movk_i32 s0, 0x1ff
; GFX950-SAFE-SDAG-NEXT: v_and_or_b32 v0, v1, s0, v0
; GFX950-SAFE-SDAG-NEXT: v_cmp_ne_u32_e32 vcc, 0, v0
; GFX950-SAFE-SDAG-NEXT: v_lshrrev_b32_e32 v4, 8, v1
; GFX950-SAFE-SDAG-NEXT: s_movk_i32 s1, 0xffe
; GFX950-SAFE-SDAG-NEXT: v_cndmask_b32_e64 v0, 0, 1, vcc
; GFX950-SAFE-SDAG-NEXT: v_bfe_u32 v5, v1, 20, 11
; GFX950-SAFE-SDAG-NEXT: v_and_or_b32 v0, v4, s1, v0
; GFX950-SAFE-SDAG-NEXT: v_sub_u32_e32 v6, 0x3f1, v5
; GFX950-SAFE-SDAG-NEXT: v_or_b32_e32 v4, 0x1000, v0
; GFX950-SAFE-SDAG-NEXT: v_med3_i32 v6, v6, 0, 13
; GFX950-SAFE-SDAG-NEXT: v_lshrrev_b32_e32 v7, v6, v4
; GFX950-SAFE-SDAG-NEXT: v_lshlrev_b32_e32 v6, v6, v7
; GFX950-SAFE-SDAG-NEXT: v_cmp_ne_u32_e32 vcc, v6, v4
; GFX950-SAFE-SDAG-NEXT: v_add_u32_e32 v5, 0xfffffc10, v5
; GFX950-SAFE-SDAG-NEXT: v_lshl_or_b32 v6, v5, 12, v0
; GFX950-SAFE-SDAG-NEXT: v_cndmask_b32_e64 v4, 0, 1, vcc
; GFX950-SAFE-SDAG-NEXT: v_or_b32_e32 v4, v7, v4
; GFX950-SAFE-SDAG-NEXT: v_cmp_gt_i32_e32 vcc, 1, v5
; GFX950-SAFE-SDAG-NEXT: s_movk_i32 s2, 0x40f
; GFX950-SAFE-SDAG-NEXT: v_lshrrev_b32_e32 v1, 16, v1
; GFX950-SAFE-SDAG-NEXT: v_cndmask_b32_e32 v4, v6, v4, vcc
; GFX950-SAFE-SDAG-NEXT: v_and_b32_e32 v6, 7, v4
; GFX950-SAFE-SDAG-NEXT: v_cmp_lt_i32_e32 vcc, 5, v6
; GFX950-SAFE-SDAG-NEXT: v_lshrrev_b32_e32 v4, 2, v4
; GFX950-SAFE-SDAG-NEXT: s_mov_b32 s3, 0x8000
; GFX950-SAFE-SDAG-NEXT: v_cndmask_b32_e64 v7, 0, 1, vcc
; GFX950-SAFE-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, 3, v6
; GFX950-SAFE-SDAG-NEXT: s_nop 1
; GFX950-SAFE-SDAG-NEXT: v_cndmask_b32_e64 v6, 0, 1, vcc
; GFX950-SAFE-SDAG-NEXT: v_or_b32_e32 v6, v6, v7
; GFX950-SAFE-SDAG-NEXT: v_add_u32_e32 v4, v4, v6
; GFX950-SAFE-SDAG-NEXT: v_mov_b32_e32 v6, 0x7c00
; GFX950-SAFE-SDAG-NEXT: v_cmp_gt_i32_e32 vcc, 31, v5
; GFX950-SAFE-SDAG-NEXT: v_mov_b32_e32 v7, 0x7e00
; GFX950-SAFE-SDAG-NEXT: s_nop 0
; GFX950-SAFE-SDAG-NEXT: v_cndmask_b32_e32 v4, v6, v4, vcc
; GFX950-SAFE-SDAG-NEXT: v_cmp_ne_u32_e32 vcc, 0, v0
; GFX950-SAFE-SDAG-NEXT: s_nop 1
; GFX950-SAFE-SDAG-NEXT: v_cndmask_b32_e32 v0, v6, v7, vcc
; GFX950-SAFE-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, s2, v5
; GFX950-SAFE-SDAG-NEXT: s_nop 1
; GFX950-SAFE-SDAG-NEXT: v_cndmask_b32_e32 v0, v4, v0, vcc
; GFX950-SAFE-SDAG-NEXT: v_and_or_b32 v0, v1, s3, v0
; GFX950-SAFE-SDAG-NEXT: v_and_or_b32 v1, v3, s0, v2
; GFX950-SAFE-SDAG-NEXT: v_cmp_ne_u32_e32 vcc, 0, v1
; GFX950-SAFE-SDAG-NEXT: v_lshrrev_b32_e32 v2, 8, v3
; GFX950-SAFE-SDAG-NEXT: v_bfe_u32 v4, v3, 20, 11
; GFX950-SAFE-SDAG-NEXT: v_cndmask_b32_e64 v1, 0, 1, vcc
; GFX950-SAFE-SDAG-NEXT: v_and_or_b32 v1, v2, s1, v1
; GFX950-SAFE-SDAG-NEXT: v_sub_u32_e32 v5, 0x3f1, v4
; GFX950-SAFE-SDAG-NEXT: v_or_b32_e32 v2, 0x1000, v1
; GFX950-SAFE-SDAG-NEXT: v_med3_i32 v5, v5, 0, 13
; GFX950-SAFE-SDAG-NEXT: v_lshrrev_b32_e32 v8, v5, v2
; GFX950-SAFE-SDAG-NEXT: v_lshlrev_b32_e32 v5, v5, v8
; GFX950-SAFE-SDAG-NEXT: v_cmp_ne_u32_e32 vcc, v5, v2
; GFX950-SAFE-SDAG-NEXT: v_add_u32_e32 v4, 0xfffffc10, v4
; GFX950-SAFE-SDAG-NEXT: v_lshl_or_b32 v5, v4, 12, v1
; GFX950-SAFE-SDAG-NEXT: v_cndmask_b32_e64 v2, 0, 1, vcc
; GFX950-SAFE-SDAG-NEXT: v_or_b32_e32 v2, v8, v2
; GFX950-SAFE-SDAG-NEXT: v_cmp_gt_i32_e32 vcc, 1, v4
; GFX950-SAFE-SDAG-NEXT: s_mov_b32 s0, 0x5040100
; GFX950-SAFE-SDAG-NEXT: s_nop 0
; GFX950-SAFE-SDAG-NEXT: v_cndmask_b32_e32 v2, v5, v2, vcc
; GFX950-SAFE-SDAG-NEXT: v_and_b32_e32 v5, 7, v2
; GFX950-SAFE-SDAG-NEXT: v_cmp_lt_i32_e32 vcc, 5, v5
; GFX950-SAFE-SDAG-NEXT: v_lshrrev_b32_e32 v2, 2, v2
; GFX950-SAFE-SDAG-NEXT: s_nop 0
; GFX950-SAFE-SDAG-NEXT: v_cndmask_b32_e64 v8, 0, 1, vcc
; GFX950-SAFE-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, 3, v5
; GFX950-SAFE-SDAG-NEXT: s_nop 1
; GFX950-SAFE-SDAG-NEXT: v_cndmask_b32_e64 v5, 0, 1, vcc
; GFX950-SAFE-SDAG-NEXT: v_or_b32_e32 v5, v5, v8
; GFX950-SAFE-SDAG-NEXT: v_add_u32_e32 v2, v2, v5
; GFX950-SAFE-SDAG-NEXT: v_cmp_gt_i32_e32 vcc, 31, v4
; GFX950-SAFE-SDAG-NEXT: s_nop 1
; GFX950-SAFE-SDAG-NEXT: v_cndmask_b32_e32 v2, v6, v2, vcc
; GFX950-SAFE-SDAG-NEXT: v_cmp_ne_u32_e32 vcc, 0, v1
; GFX950-SAFE-SDAG-NEXT: s_nop 1
; GFX950-SAFE-SDAG-NEXT: v_cndmask_b32_e32 v1, v6, v7, vcc
; GFX950-SAFE-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, s2, v4
; GFX950-SAFE-SDAG-NEXT: s_nop 1
; GFX950-SAFE-SDAG-NEXT: v_cndmask_b32_e32 v1, v2, v1, vcc
; GFX950-SAFE-SDAG-NEXT: v_lshrrev_b32_e32 v2, 16, v3
; GFX950-SAFE-SDAG-NEXT: v_and_or_b32 v1, v2, s3, v1
; GFX950-SAFE-SDAG-NEXT: v_perm_b32 v0, v1, v0, s0
; GFX950-SAFE-SDAG-NEXT: ; return to shader part epilog
;
; GFX950-SAFE-GISEL-LABEL: v_test_cvt_v2f64_v2f16:
; GFX950-SAFE-GISEL: ; %bb.0:
; GFX950-SAFE-GISEL-NEXT: v_mov_b32_e32 v7, 0x1ff
; GFX950-SAFE-GISEL-NEXT: v_and_or_b32 v0, v1, v7, v0
; GFX950-SAFE-GISEL-NEXT: v_bfe_u32 v4, v1, 20, 11
; GFX950-SAFE-GISEL-NEXT: v_cmp_ne_u32_e32 vcc, 0, v0
; GFX950-SAFE-GISEL-NEXT: v_add_u32_e32 v4, 0xfffffc10, v4
; GFX950-SAFE-GISEL-NEXT: v_lshrrev_b32_e32 v5, 8, v1
; GFX950-SAFE-GISEL-NEXT: v_mov_b32_e32 v6, 0xffe
; GFX950-SAFE-GISEL-NEXT: v_cndmask_b32_e64 v0, 0, 1, vcc
; GFX950-SAFE-GISEL-NEXT: v_and_or_b32 v0, v5, v6, v0
; GFX950-SAFE-GISEL-NEXT: v_sub_u32_e32 v10, 1, v4
; GFX950-SAFE-GISEL-NEXT: v_cmp_ne_u32_e32 vcc, 0, v0
; GFX950-SAFE-GISEL-NEXT: v_lshl_or_b32 v9, v4, 12, v0
; GFX950-SAFE-GISEL-NEXT: v_med3_i32 v10, v10, 0, 13
; GFX950-SAFE-GISEL-NEXT: v_or_b32_e32 v0, 0x1000, v0
; GFX950-SAFE-GISEL-NEXT: v_lshrrev_b32_e32 v11, v10, v0
; GFX950-SAFE-GISEL-NEXT: v_lshlrev_b32_e32 v10, v10, v11
; GFX950-SAFE-GISEL-NEXT: v_cndmask_b32_e64 v5, 0, 1, vcc
; GFX950-SAFE-GISEL-NEXT: v_cmp_ne_u32_e32 vcc, v10, v0
; GFX950-SAFE-GISEL-NEXT: v_mov_b32_e32 v8, 0x7c00
; GFX950-SAFE-GISEL-NEXT: v_lshl_or_b32 v5, v5, 9, v8
; GFX950-SAFE-GISEL-NEXT: v_cndmask_b32_e64 v0, 0, 1, vcc
; GFX950-SAFE-GISEL-NEXT: v_or_b32_e32 v0, v11, v0
; GFX950-SAFE-GISEL-NEXT: v_cmp_gt_i32_e32 vcc, 1, v4
; GFX950-SAFE-GISEL-NEXT: v_lshrrev_b32_e32 v1, 16, v1
; GFX950-SAFE-GISEL-NEXT: v_and_or_b32 v2, v3, v7, v2
; GFX950-SAFE-GISEL-NEXT: v_cndmask_b32_e32 v0, v9, v0, vcc
; GFX950-SAFE-GISEL-NEXT: v_and_b32_e32 v9, 7, v0
; GFX950-SAFE-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, 3, v9
; GFX950-SAFE-GISEL-NEXT: v_cmp_lt_i32_e64 s[0:1], 5, v9
; GFX950-SAFE-GISEL-NEXT: s_or_b64 s[0:1], vcc, s[0:1]
; GFX950-SAFE-GISEL-NEXT: v_lshrrev_b32_e32 v0, 2, v0
; GFX950-SAFE-GISEL-NEXT: v_cndmask_b32_e64 v9, 0, 1, s[0:1]
; GFX950-SAFE-GISEL-NEXT: v_add_u32_e32 v0, v0, v9
; GFX950-SAFE-GISEL-NEXT: v_cmp_lt_i32_e32 vcc, 30, v4
; GFX950-SAFE-GISEL-NEXT: v_mov_b32_e32 v9, 0x40f
; GFX950-SAFE-GISEL-NEXT: s_nop 0
; GFX950-SAFE-GISEL-NEXT: v_cndmask_b32_e32 v0, v0, v8, vcc
; GFX950-SAFE-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v4, v9
; GFX950-SAFE-GISEL-NEXT: v_mov_b32_e32 v4, 0x8000
; GFX950-SAFE-GISEL-NEXT: s_nop 0
; GFX950-SAFE-GISEL-NEXT: v_cndmask_b32_e32 v0, v0, v5, vcc
; GFX950-SAFE-GISEL-NEXT: v_and_or_b32 v0, v1, v4, v0
; GFX950-SAFE-GISEL-NEXT: v_bfe_u32 v1, v3, 20, 11
; GFX950-SAFE-GISEL-NEXT: v_cmp_ne_u32_e32 vcc, 0, v2
; GFX950-SAFE-GISEL-NEXT: v_add_u32_e32 v1, 0xfffffc10, v1
; GFX950-SAFE-GISEL-NEXT: v_lshrrev_b32_e32 v5, 8, v3
; GFX950-SAFE-GISEL-NEXT: v_cndmask_b32_e64 v2, 0, 1, vcc
; GFX950-SAFE-GISEL-NEXT: v_and_or_b32 v2, v5, v6, v2
; GFX950-SAFE-GISEL-NEXT: v_sub_u32_e32 v7, 1, v1
; GFX950-SAFE-GISEL-NEXT: v_cmp_ne_u32_e32 vcc, 0, v2
; GFX950-SAFE-GISEL-NEXT: v_lshl_or_b32 v6, v1, 12, v2
; GFX950-SAFE-GISEL-NEXT: v_med3_i32 v7, v7, 0, 13
; GFX950-SAFE-GISEL-NEXT: v_or_b32_e32 v2, 0x1000, v2
; GFX950-SAFE-GISEL-NEXT: v_lshrrev_b32_e32 v10, v7, v2
; GFX950-SAFE-GISEL-NEXT: v_lshlrev_b32_e32 v7, v7, v10
; GFX950-SAFE-GISEL-NEXT: v_cndmask_b32_e64 v5, 0, 1, vcc
; GFX950-SAFE-GISEL-NEXT: v_cmp_ne_u32_e32 vcc, v7, v2
; GFX950-SAFE-GISEL-NEXT: v_lshl_or_b32 v5, v5, 9, v8
; GFX950-SAFE-GISEL-NEXT: v_and_b32_e32 v0, 0xffff, v0
; GFX950-SAFE-GISEL-NEXT: v_cndmask_b32_e64 v2, 0, 1, vcc
; GFX950-SAFE-GISEL-NEXT: v_or_b32_e32 v2, v10, v2
; GFX950-SAFE-GISEL-NEXT: v_cmp_gt_i32_e32 vcc, 1, v1
; GFX950-SAFE-GISEL-NEXT: s_nop 1
; GFX950-SAFE-GISEL-NEXT: v_cndmask_b32_e32 v2, v6, v2, vcc
; GFX950-SAFE-GISEL-NEXT: v_and_b32_e32 v6, 7, v2
; GFX950-SAFE-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, 3, v6
; GFX950-SAFE-GISEL-NEXT: v_cmp_lt_i32_e64 s[0:1], 5, v6
; GFX950-SAFE-GISEL-NEXT: s_or_b64 s[0:1], vcc, s[0:1]
; GFX950-SAFE-GISEL-NEXT: v_lshrrev_b32_e32 v2, 2, v2
; GFX950-SAFE-GISEL-NEXT: v_cndmask_b32_e64 v6, 0, 1, s[0:1]
; GFX950-SAFE-GISEL-NEXT: v_add_u32_e32 v2, v2, v6
; GFX950-SAFE-GISEL-NEXT: v_cmp_lt_i32_e32 vcc, 30, v1
; GFX950-SAFE-GISEL-NEXT: s_nop 1
; GFX950-SAFE-GISEL-NEXT: v_cndmask_b32_e32 v2, v2, v8, vcc
; GFX950-SAFE-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v1, v9
; GFX950-SAFE-GISEL-NEXT: s_nop 1
; GFX950-SAFE-GISEL-NEXT: v_cndmask_b32_e32 v1, v2, v5, vcc
; GFX950-SAFE-GISEL-NEXT: v_lshrrev_b32_e32 v2, 16, v3
; GFX950-SAFE-GISEL-NEXT: v_and_or_b32 v1, v2, v4, v1
; GFX950-SAFE-GISEL-NEXT: v_lshl_or_b32 v0, v1, 16, v0
; GFX950-SAFE-GISEL-NEXT: ; return to shader part epilog
;
; GFX950-UNSAFE-LABEL: v_test_cvt_v2f64_v2f16:
; GFX950-UNSAFE: ; %bb.0:
; GFX950-UNSAFE-NEXT: v_cvt_f32_f64_e32 v2, v[2:3]
; GFX950-UNSAFE-NEXT: v_cvt_f32_f64_e32 v0, v[0:1]
; GFX950-UNSAFE-NEXT: v_cvt_pk_f16_f32 v0, v0, v2
; GFX950-UNSAFE-NEXT: ; return to shader part epilog
%res = fptrunc <2 x double> %src to <2 x half>
ret <2 x half> %res
}