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
34 ; GFX11-NEXT: s_endpgm
35 call void @llvm.amdgcn.raw.ptr.buffer.store.bf16(bfloat %data, ptr addrspace(8) %rsrc, i32 %offset, i32 0, i32 0)
39 define amdgpu_ps void @buffer_store_v2bf16(ptr addrspace(8) inreg %rsrc, <2 x bfloat> %data, i32 %offset) {
40 ; GFX7-LABEL: buffer_store_v2bf16:
42 ; GFX7-NEXT: v_mul_f32_e32 v1, 1.0, v1
43 ; GFX7-NEXT: v_lshrrev_b32_e32 v1, 16, v1
44 ; GFX7-NEXT: v_mul_f32_e32 v0, 1.0, v0
45 ; GFX7-NEXT: v_alignbit_b32 v0, v1, v0, 16
46 ; GFX7-NEXT: buffer_store_dword v0, v2, s[0:3], 0 offen
49 ; GFX8-LABEL: buffer_store_v2bf16:
51 ; GFX8-NEXT: buffer_store_dword v0, v1, s[0:3], 0 offen
54 ; GFX9-LABEL: buffer_store_v2bf16:
56 ; GFX9-NEXT: buffer_store_dword v0, v1, s[0:3], 0 offen
59 ; GFX10-LABEL: buffer_store_v2bf16:
61 ; GFX10-NEXT: buffer_store_dword v0, v1, s[0:3], 0 offen
62 ; GFX10-NEXT: s_endpgm
64 ; GFX11-LABEL: buffer_store_v2bf16:
66 ; GFX11-NEXT: buffer_store_b32 v0, v1, s[0:3], 0 offen
67 ; GFX11-NEXT: s_endpgm
68 call void @llvm.amdgcn.raw.ptr.buffer.store.v2bf16(<2 x bfloat> %data, ptr addrspace(8) %rsrc, i32 %offset, i32 0, i32 0)
72 define amdgpu_ps void @buffer_store_v4bf16(ptr addrspace(8) inreg %rsrc, <4 x bfloat> %data, i32 %offset) #0 {
73 ; GFX7-LABEL: buffer_store_v4bf16:
75 ; GFX7-NEXT: v_mul_f32_e32 v3, 1.0, v3
76 ; GFX7-NEXT: v_mul_f32_e32 v1, 1.0, v1
77 ; GFX7-NEXT: v_lshrrev_b32_e32 v3, 16, v3
78 ; GFX7-NEXT: v_mul_f32_e32 v2, 1.0, v2
79 ; GFX7-NEXT: v_lshrrev_b32_e32 v1, 16, v1
80 ; GFX7-NEXT: v_mul_f32_e32 v0, 1.0, v0
81 ; GFX7-NEXT: v_alignbit_b32 v2, v3, v2, 16
82 ; GFX7-NEXT: v_alignbit_b32 v1, v1, v0, 16
83 ; GFX7-NEXT: buffer_store_dwordx2 v[1:2], v4, s[0:3], 0 offen
86 ; GFX8-LABEL: buffer_store_v4bf16:
88 ; GFX8-NEXT: buffer_store_dwordx2 v[0:1], v2, s[0:3], 0 offen
91 ; GFX9-LABEL: buffer_store_v4bf16:
93 ; GFX9-NEXT: buffer_store_dwordx2 v[0:1], v2, s[0:3], 0 offen
96 ; GFX10-LABEL: buffer_store_v4bf16:
98 ; GFX10-NEXT: buffer_store_dwordx2 v[0:1], v2, s[0:3], 0 offen
99 ; GFX10-NEXT: s_endpgm
101 ; GFX11-LABEL: buffer_store_v4bf16:
103 ; GFX11-NEXT: buffer_store_b64 v[0:1], v2, s[0:3], 0 offen
104 ; GFX11-NEXT: s_endpgm
105 call void @llvm.amdgcn.raw.ptr.buffer.store.v4bf16(<4 x bfloat> %data, ptr addrspace(8) %rsrc, i32 %offset, i32 0, i32 0)
110 ; define amdgpu_ps void @buffer_store_v6bf16(ptr addrspace(8) inreg %rsrc, <6 x bfloat> %data, i32 %offset) #0 {
111 ; call void @llvm.amdgcn.raw.ptr.buffer.store.v6bf16(<6 x bfloat> %data, ptr addrspace(8) %rsrc, i32 %offset, i32 0, i32 0)
115 define amdgpu_ps void @buffer_store_v8bf16(ptr addrspace(8) inreg %rsrc, <8 x bfloat> %data, i32 %offset) #0 {
116 ; GFX7-LABEL: buffer_store_v8bf16:
118 ; GFX7-NEXT: v_mul_f32_e32 v7, 1.0, v7
119 ; GFX7-NEXT: v_mul_f32_e32 v5, 1.0, v5
120 ; GFX7-NEXT: v_mul_f32_e32 v3, 1.0, v3
121 ; GFX7-NEXT: v_mul_f32_e32 v1, 1.0, v1
122 ; GFX7-NEXT: v_lshrrev_b32_e32 v7, 16, v7
123 ; GFX7-NEXT: v_mul_f32_e32 v6, 1.0, v6
124 ; GFX7-NEXT: v_lshrrev_b32_e32 v5, 16, v5
125 ; GFX7-NEXT: v_mul_f32_e32 v4, 1.0, v4
126 ; GFX7-NEXT: v_lshrrev_b32_e32 v3, 16, v3
127 ; GFX7-NEXT: v_mul_f32_e32 v2, 1.0, v2
128 ; GFX7-NEXT: v_lshrrev_b32_e32 v1, 16, v1
129 ; GFX7-NEXT: v_mul_f32_e32 v0, 1.0, v0
130 ; GFX7-NEXT: v_alignbit_b32 v6, v7, v6, 16
131 ; GFX7-NEXT: v_alignbit_b32 v5, v5, v4, 16
132 ; GFX7-NEXT: v_alignbit_b32 v4, v3, v2, 16
133 ; GFX7-NEXT: v_alignbit_b32 v3, v1, v0, 16
134 ; GFX7-NEXT: buffer_store_dwordx4 v[3:6], v8, s[0:3], 0 offen
135 ; GFX7-NEXT: s_endpgm
137 ; GFX8-LABEL: buffer_store_v8bf16:
139 ; GFX8-NEXT: buffer_store_dwordx4 v[0:3], v4, s[0:3], 0 offen
140 ; GFX8-NEXT: s_endpgm
142 ; GFX9-LABEL: buffer_store_v8bf16:
144 ; GFX9-NEXT: buffer_store_dwordx4 v[0:3], v4, s[0:3], 0 offen
145 ; GFX9-NEXT: s_endpgm
147 ; GFX10-LABEL: buffer_store_v8bf16:
149 ; GFX10-NEXT: buffer_store_dwordx4 v[0:3], v4, s[0:3], 0 offen
150 ; GFX10-NEXT: s_endpgm
152 ; GFX11-LABEL: buffer_store_v8bf16:
154 ; GFX11-NEXT: buffer_store_b128 v[0:3], v4, s[0:3], 0 offen
155 ; GFX11-NEXT: s_endpgm
156 call void @llvm.amdgcn.raw.ptr.buffer.store.v8bf16(<8 x bfloat> %data, ptr addrspace(8) %rsrc, i32 %offset, i32 0, i32 0)