1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
2 ; RUN: llc -mtriple=amdgcn -mcpu=hawaii < %s | FileCheck --check-prefix=GFX7 %s
3 ; RUN: llc -mtriple=amdgcn -mcpu=tonga < %s | FileCheck --check-prefix=GFX8 %s
4 ; RUN: llc -mtriple=amdgcn -mcpu=gfx900 < %s | FileCheck --check-prefix=GFX9 %s
5 ; RUN: llc -mtriple=amdgcn -mcpu=gfx1010 < %s | FileCheck --check-prefix=GFX10 %s
6 ; RUN: llc -mtriple=amdgcn -mcpu=gfx1100 -amdgpu-enable-delay-alu=0 < %s | FileCheck --check-prefixes=GFX11 %s
8 define amdgpu_ps void @buffer_store_bf16(ptr addrspace(8) inreg %rsrc, bfloat %data, i32 %offset) {
9 ; GFX7-LABEL: buffer_store_bf16:
11 ; GFX7-NEXT: v_mul_f32_e32 v0, 1.0, v0
12 ; GFX7-NEXT: v_lshrrev_b32_e32 v0, 16, v0
13 ; GFX7-NEXT: buffer_store_short v0, v1, s[0:3], 0 offen
16 ; GFX8-LABEL: buffer_store_bf16:
18 ; GFX8-NEXT: buffer_store_short v0, v1, s[0:3], 0 offen
21 ; GFX9-LABEL: buffer_store_bf16:
23 ; GFX9-NEXT: buffer_store_short v0, v1, s[0:3], 0 offen
26 ; GFX10-LABEL: buffer_store_bf16:
28 ; GFX10-NEXT: buffer_store_short v0, v1, s[0:3], 0 offen
29 ; GFX10-NEXT: s_endpgm
31 ; GFX11-LABEL: buffer_store_bf16:
33 ; GFX11-NEXT: buffer_store_b16 v0, v1, s[0:3], 0 offen
35 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
36 ; GFX11-NEXT: s_endpgm
37 call void @llvm.amdgcn.raw.ptr.buffer.store.bf16(bfloat %data, ptr addrspace(8) %rsrc, i32 %offset, i32 0, i32 0)
41 define amdgpu_ps void @buffer_store_v2bf16(ptr addrspace(8) inreg %rsrc, <2 x bfloat> %data, i32 %offset) {
42 ; GFX7-LABEL: buffer_store_v2bf16:
44 ; GFX7-NEXT: v_mul_f32_e32 v1, 1.0, v1
45 ; GFX7-NEXT: v_lshrrev_b32_e32 v1, 16, v1
46 ; GFX7-NEXT: v_mul_f32_e32 v0, 1.0, v0
47 ; GFX7-NEXT: v_alignbit_b32 v0, v1, v0, 16
48 ; GFX7-NEXT: buffer_store_dword v0, v2, s[0:3], 0 offen
51 ; GFX8-LABEL: buffer_store_v2bf16:
53 ; GFX8-NEXT: buffer_store_dword v0, v1, s[0:3], 0 offen
56 ; GFX9-LABEL: buffer_store_v2bf16:
58 ; GFX9-NEXT: buffer_store_dword v0, v1, s[0:3], 0 offen
61 ; GFX10-LABEL: buffer_store_v2bf16:
63 ; GFX10-NEXT: buffer_store_dword v0, v1, s[0:3], 0 offen
64 ; GFX10-NEXT: s_endpgm
66 ; GFX11-LABEL: buffer_store_v2bf16:
68 ; GFX11-NEXT: buffer_store_b32 v0, v1, s[0:3], 0 offen
70 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
71 ; GFX11-NEXT: s_endpgm
72 call void @llvm.amdgcn.raw.ptr.buffer.store.v2bf16(<2 x bfloat> %data, ptr addrspace(8) %rsrc, i32 %offset, i32 0, i32 0)
76 define amdgpu_ps void @buffer_store_v4bf16(ptr addrspace(8) inreg %rsrc, <4 x bfloat> %data, i32 %offset) #0 {
77 ; GFX7-LABEL: buffer_store_v4bf16:
79 ; GFX7-NEXT: v_mul_f32_e32 v3, 1.0, v3
80 ; GFX7-NEXT: v_mul_f32_e32 v1, 1.0, v1
81 ; GFX7-NEXT: v_lshrrev_b32_e32 v3, 16, v3
82 ; GFX7-NEXT: v_mul_f32_e32 v2, 1.0, v2
83 ; GFX7-NEXT: v_lshrrev_b32_e32 v1, 16, v1
84 ; GFX7-NEXT: v_mul_f32_e32 v0, 1.0, v0
85 ; GFX7-NEXT: v_alignbit_b32 v2, v3, v2, 16
86 ; GFX7-NEXT: v_alignbit_b32 v1, v1, v0, 16
87 ; GFX7-NEXT: buffer_store_dwordx2 v[1:2], v4, s[0:3], 0 offen
90 ; GFX8-LABEL: buffer_store_v4bf16:
92 ; GFX8-NEXT: buffer_store_dwordx2 v[0:1], v2, s[0:3], 0 offen
95 ; GFX9-LABEL: buffer_store_v4bf16:
97 ; GFX9-NEXT: buffer_store_dwordx2 v[0:1], v2, s[0:3], 0 offen
100 ; GFX10-LABEL: buffer_store_v4bf16:
102 ; GFX10-NEXT: buffer_store_dwordx2 v[0:1], v2, s[0:3], 0 offen
103 ; GFX10-NEXT: s_endpgm
105 ; GFX11-LABEL: buffer_store_v4bf16:
107 ; GFX11-NEXT: buffer_store_b64 v[0:1], v2, s[0:3], 0 offen
108 ; GFX11-NEXT: s_nop 0
109 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
110 ; GFX11-NEXT: s_endpgm
111 call void @llvm.amdgcn.raw.ptr.buffer.store.v4bf16(<4 x bfloat> %data, ptr addrspace(8) %rsrc, i32 %offset, i32 0, i32 0)
116 ; define amdgpu_ps void @buffer_store_v6bf16(ptr addrspace(8) inreg %rsrc, <6 x bfloat> %data, i32 %offset) #0 {
117 ; call void @llvm.amdgcn.raw.ptr.buffer.store.v6bf16(<6 x bfloat> %data, ptr addrspace(8) %rsrc, i32 %offset, i32 0, i32 0)
121 define amdgpu_ps void @buffer_store_v8bf16(ptr addrspace(8) inreg %rsrc, <8 x bfloat> %data, i32 %offset) #0 {
122 ; GFX7-LABEL: buffer_store_v8bf16:
124 ; GFX7-NEXT: v_mul_f32_e32 v7, 1.0, v7
125 ; GFX7-NEXT: v_mul_f32_e32 v5, 1.0, v5
126 ; GFX7-NEXT: v_mul_f32_e32 v3, 1.0, v3
127 ; GFX7-NEXT: v_mul_f32_e32 v1, 1.0, v1
128 ; GFX7-NEXT: v_lshrrev_b32_e32 v7, 16, v7
129 ; GFX7-NEXT: v_mul_f32_e32 v6, 1.0, v6
130 ; GFX7-NEXT: v_lshrrev_b32_e32 v5, 16, v5
131 ; GFX7-NEXT: v_mul_f32_e32 v4, 1.0, v4
132 ; GFX7-NEXT: v_lshrrev_b32_e32 v3, 16, v3
133 ; GFX7-NEXT: v_mul_f32_e32 v2, 1.0, v2
134 ; GFX7-NEXT: v_lshrrev_b32_e32 v1, 16, v1
135 ; GFX7-NEXT: v_mul_f32_e32 v0, 1.0, v0
136 ; GFX7-NEXT: v_alignbit_b32 v6, v7, v6, 16
137 ; GFX7-NEXT: v_alignbit_b32 v5, v5, v4, 16
138 ; GFX7-NEXT: v_alignbit_b32 v4, v3, v2, 16
139 ; GFX7-NEXT: v_alignbit_b32 v3, v1, v0, 16
140 ; GFX7-NEXT: buffer_store_dwordx4 v[3:6], v8, s[0:3], 0 offen
141 ; GFX7-NEXT: s_endpgm
143 ; GFX8-LABEL: buffer_store_v8bf16:
145 ; GFX8-NEXT: buffer_store_dwordx4 v[0:3], v4, s[0:3], 0 offen
146 ; GFX8-NEXT: s_endpgm
148 ; GFX9-LABEL: buffer_store_v8bf16:
150 ; GFX9-NEXT: buffer_store_dwordx4 v[0:3], v4, s[0:3], 0 offen
151 ; GFX9-NEXT: s_endpgm
153 ; GFX10-LABEL: buffer_store_v8bf16:
155 ; GFX10-NEXT: buffer_store_dwordx4 v[0:3], v4, s[0:3], 0 offen
156 ; GFX10-NEXT: s_endpgm
158 ; GFX11-LABEL: buffer_store_v8bf16:
160 ; GFX11-NEXT: buffer_store_b128 v[0:3], v4, s[0:3], 0 offen
161 ; GFX11-NEXT: s_nop 0
162 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
163 ; GFX11-NEXT: s_endpgm
164 call void @llvm.amdgcn.raw.ptr.buffer.store.v8bf16(<8 x bfloat> %data, ptr addrspace(8) %rsrc, i32 %offset, i32 0, i32 0)