1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2 ; RUN: llc -march=amdgcn -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX6 %s
3 ; RUN: llc -march=amdgcn -mcpu=tonga -mattr=-flat-for-global -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX8 %s
4 ; RUN: llc -march=amdgcn -mcpu=gfx1100 -mattr=-flat-for-global -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX11 %s
6 declare double @llvm.convert.from.fp16.f64(i16) nounwind readnone
8 define amdgpu_kernel void @test_convert_fp16_to_fp64(ptr addrspace(1) noalias %out, ptr addrspace(1) noalias %in) nounwind {
9 ; GFX6-LABEL: test_convert_fp16_to_fp64:
11 ; GFX6-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9
12 ; GFX6-NEXT: s_mov_b32 s7, 0xf000
13 ; GFX6-NEXT: s_mov_b32 s6, -1
14 ; GFX6-NEXT: s_mov_b32 s10, s6
15 ; GFX6-NEXT: s_mov_b32 s11, s7
16 ; GFX6-NEXT: s_waitcnt lgkmcnt(0)
17 ; GFX6-NEXT: s_mov_b32 s8, s2
18 ; GFX6-NEXT: s_mov_b32 s9, s3
19 ; GFX6-NEXT: buffer_load_ushort v0, off, s[8:11], 0
20 ; GFX6-NEXT: s_mov_b32 s4, s0
21 ; GFX6-NEXT: s_mov_b32 s5, s1
22 ; GFX6-NEXT: s_waitcnt vmcnt(0)
23 ; GFX6-NEXT: v_cvt_f32_f16_e32 v0, v0
24 ; GFX6-NEXT: v_cvt_f64_f32_e32 v[0:1], v0
25 ; GFX6-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0
28 ; GFX8-LABEL: test_convert_fp16_to_fp64:
30 ; GFX8-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
31 ; GFX8-NEXT: s_mov_b32 s7, 0xf000
32 ; GFX8-NEXT: s_mov_b32 s6, -1
33 ; GFX8-NEXT: s_mov_b32 s10, s6
34 ; GFX8-NEXT: s_mov_b32 s11, s7
35 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
36 ; GFX8-NEXT: s_mov_b32 s8, s2
37 ; GFX8-NEXT: s_mov_b32 s9, s3
38 ; GFX8-NEXT: buffer_load_ushort v0, off, s[8:11], 0
39 ; GFX8-NEXT: s_mov_b32 s4, s0
40 ; GFX8-NEXT: s_mov_b32 s5, s1
41 ; GFX8-NEXT: s_waitcnt vmcnt(0)
42 ; GFX8-NEXT: v_cvt_f32_f16_e32 v0, v0
43 ; GFX8-NEXT: v_cvt_f64_f32_e32 v[0:1], v0
44 ; GFX8-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0
47 ; GFX11-LABEL: test_convert_fp16_to_fp64:
49 ; GFX11-NEXT: s_load_b128 s[0:3], s[0:1], 0x24
50 ; GFX11-NEXT: s_mov_b32 s6, -1
51 ; GFX11-NEXT: s_mov_b32 s7, 0x31016000
52 ; GFX11-NEXT: s_mov_b32 s10, s6
53 ; GFX11-NEXT: s_mov_b32 s11, s7
54 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
55 ; GFX11-NEXT: s_mov_b32 s8, s2
56 ; GFX11-NEXT: s_mov_b32 s9, s3
57 ; GFX11-NEXT: s_mov_b32 s4, s0
58 ; GFX11-NEXT: buffer_load_u16 v0, off, s[8:11], 0
59 ; GFX11-NEXT: s_mov_b32 s5, s1
60 ; GFX11-NEXT: s_waitcnt vmcnt(0)
61 ; GFX11-NEXT: v_cvt_f32_f16_e32 v0, v0
62 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
63 ; GFX11-NEXT: v_cvt_f64_f32_e32 v[0:1], v0
64 ; GFX11-NEXT: buffer_store_b64 v[0:1], off, s[4:7], 0
66 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
67 ; GFX11-NEXT: s_endpgm
68 %val = load i16, ptr addrspace(1) %in, align 2
69 %cvt = call double @llvm.convert.from.fp16.f64(i16 %val) nounwind readnone
70 store double %cvt, ptr addrspace(1) %out, align 4