annotate llvm/test/CodeGen/AMDGPU/llvm.amdgcn.struct.tbuffer.store.ll @ 206:f17a3b42b08b

Added tag before-12 for changeset b7591485f4cd
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 07 Jun 2021 21:25:57 +0900
parents 1d019706d866
children 2e18cbf3894f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 ;RUN: llc < %s -march=amdgcn -mcpu=verde -verify-machineinstrs | FileCheck -check-prefixes=GCN,VERDE,PREGFX10 %s
anatofuz
parents:
diff changeset
2 ;RUN: llc < %s -march=amdgcn -mcpu=tonga -verify-machineinstrs | FileCheck -check-prefixes=GCN,PREGFX10 %s
anatofuz
parents:
diff changeset
3 ;RUN: llc < %s -march=amdgcn -mcpu=gfx1010 -verify-machineinstrs | FileCheck -check-prefixes=GCN,GFX10 %s
anatofuz
parents:
diff changeset
4
anatofuz
parents:
diff changeset
5 ; GCN-LABEL: {{^}}tbuffer_store:
anatofuz
parents:
diff changeset
6 ; GCN: v_mov_b32_e32 [[ZEROREG:v[0-9]+]], 0
anatofuz
parents:
diff changeset
7 ; PREGFX10: tbuffer_store_format_xyzw v[0:3], [[ZEROREG]], s[0:3], dfmt:12, nfmt:2, 0 idxen
anatofuz
parents:
diff changeset
8 ; PREGFX10: tbuffer_store_format_xyzw v[4:7], [[ZEROREG]], s[0:3], dfmt:13, nfmt:3, 0 idxen glc
anatofuz
parents:
diff changeset
9 ; PREGFX10: tbuffer_store_format_xyzw v[8:11], [[ZEROREG]], s[0:3], dfmt:14, nfmt:4, 0 idxen slc
anatofuz
parents:
diff changeset
10 ; PREGFX10: tbuffer_store_format_xyzw v[8:11], [[ZEROREG]], s[0:3], dfmt:14, nfmt:4, 0 idxen glc
anatofuz
parents:
diff changeset
11 ; GFX10: tbuffer_store_format_xyzw v[0:3], [[ZEROREG]], s[0:3], format:44, 0 idxen
anatofuz
parents:
diff changeset
12 ; GFX10: tbuffer_store_format_xyzw v[4:7], [[ZEROREG]], s[0:3], format:61, 0 idxen glc
anatofuz
parents:
diff changeset
13 ; GFX10: tbuffer_store_format_xyzw v[8:11], [[ZEROREG]], s[0:3], format:78, 0 idxen slc
anatofuz
parents:
diff changeset
14 ; GFX10: tbuffer_store_format_xyzw v[8:11], [[ZEROREG]], s[0:3], format:78, 0 idxen glc dlc
anatofuz
parents:
diff changeset
15 define amdgpu_ps void @tbuffer_store(<4 x i32> inreg, <4 x float>, <4 x float>, <4 x float>) {
anatofuz
parents:
diff changeset
16 main_body:
anatofuz
parents:
diff changeset
17 %in1 = bitcast <4 x float> %1 to <4 x i32>
anatofuz
parents:
diff changeset
18 %in2 = bitcast <4 x float> %2 to <4 x i32>
anatofuz
parents:
diff changeset
19 %in3 = bitcast <4 x float> %3 to <4 x i32>
anatofuz
parents:
diff changeset
20 call void @llvm.amdgcn.struct.tbuffer.store.v4i32(<4 x i32> %in1, <4 x i32> %0, i32 0, i32 0, i32 0, i32 44, i32 0)
anatofuz
parents:
diff changeset
21 call void @llvm.amdgcn.struct.tbuffer.store.v4i32(<4 x i32> %in2, <4 x i32> %0, i32 0, i32 0, i32 0, i32 61, i32 1)
anatofuz
parents:
diff changeset
22 call void @llvm.amdgcn.struct.tbuffer.store.v4i32(<4 x i32> %in3, <4 x i32> %0, i32 0, i32 0, i32 0, i32 78, i32 2)
anatofuz
parents:
diff changeset
23 call void @llvm.amdgcn.struct.tbuffer.store.v4f32(<4 x float> %3, <4 x i32> %0, i32 0, i32 0, i32 0, i32 78, i32 5)
anatofuz
parents:
diff changeset
24 ret void
anatofuz
parents:
diff changeset
25 }
anatofuz
parents:
diff changeset
26
anatofuz
parents:
diff changeset
27 ; GCN-LABEL: {{^}}tbuffer_store_immoffs:
anatofuz
parents:
diff changeset
28 ; GCN: v_mov_b32_e32 [[ZEROREG:v[0-9]+]], 0
anatofuz
parents:
diff changeset
29 ; PREGFX10: tbuffer_store_format_xyzw v[0:3], [[ZEROREG]], s[0:3], dfmt:5, nfmt:7, 0 idxen offset:42
anatofuz
parents:
diff changeset
30 ; GFX10: tbuffer_store_format_xyzw v[0:3], [[ZEROREG]], s[0:3], format:117, 0 idxen offset:42
anatofuz
parents:
diff changeset
31 define amdgpu_ps void @tbuffer_store_immoffs(<4 x i32> inreg, <4 x float>) {
anatofuz
parents:
diff changeset
32 main_body:
anatofuz
parents:
diff changeset
33 %in1 = bitcast <4 x float> %1 to <4 x i32>
anatofuz
parents:
diff changeset
34 call void @llvm.amdgcn.struct.tbuffer.store.v4i32(<4 x i32> %in1, <4 x i32> %0, i32 0, i32 42, i32 0, i32 117, i32 0)
anatofuz
parents:
diff changeset
35 ret void
anatofuz
parents:
diff changeset
36 }
anatofuz
parents:
diff changeset
37
anatofuz
parents:
diff changeset
38 ; GCN-LABEL: {{^}}tbuffer_store_scalar_and_imm_offs:
anatofuz
parents:
diff changeset
39 ; GCN: v_mov_b32_e32 [[ZEROREG:v[0-9]+]], 0
anatofuz
parents:
diff changeset
40 ; PREGFX10: tbuffer_store_format_xyzw v[0:3], [[ZEROREG]], s[0:3], dfmt:5, nfmt:7, {{s[0-9]+}} idxen offset:42
anatofuz
parents:
diff changeset
41 ; GFX10: tbuffer_store_format_xyzw v[0:3], [[ZEROREG]], s[0:3], format:117, {{s[0-9]+}} idxen offset:42
anatofuz
parents:
diff changeset
42 define amdgpu_ps void @tbuffer_store_scalar_and_imm_offs(<4 x i32> inreg, <4 x float> %vdata, i32 inreg %soffset) {
anatofuz
parents:
diff changeset
43 main_body:
anatofuz
parents:
diff changeset
44 %in1 = bitcast <4 x float> %vdata to <4 x i32>
anatofuz
parents:
diff changeset
45 call void @llvm.amdgcn.struct.tbuffer.store.v4i32(<4 x i32> %in1, <4 x i32> %0, i32 0, i32 42, i32 %soffset, i32 117, i32 0)
anatofuz
parents:
diff changeset
46 ret void
anatofuz
parents:
diff changeset
47 }
anatofuz
parents:
diff changeset
48
anatofuz
parents:
diff changeset
49 ; GCN-LABEL: {{^}}buffer_store_idx:
anatofuz
parents:
diff changeset
50 ; PREGFX10: tbuffer_store_format_xyzw v[0:3], v4, s[0:3], dfmt:15, nfmt:2, 0 idxen
anatofuz
parents:
diff changeset
51 ; GFX10: tbuffer_store_format_xyzw v[0:3], v4, s[0:3], format:47, 0 idxen
anatofuz
parents:
diff changeset
52 define amdgpu_ps void @buffer_store_idx(<4 x i32> inreg, <4 x float> %vdata, i32 %vindex) {
anatofuz
parents:
diff changeset
53 main_body:
anatofuz
parents:
diff changeset
54 %in1 = bitcast <4 x float> %vdata to <4 x i32>
anatofuz
parents:
diff changeset
55 call void @llvm.amdgcn.struct.tbuffer.store.v4i32(<4 x i32> %in1, <4 x i32> %0, i32 %vindex, i32 0, i32 0, i32 47, i32 0)
anatofuz
parents:
diff changeset
56 ret void
anatofuz
parents:
diff changeset
57 }
anatofuz
parents:
diff changeset
58
anatofuz
parents:
diff changeset
59 ; GCN-LABEL: {{^}}buffer_store_ofs:
anatofuz
parents:
diff changeset
60 ; PREGFX10: tbuffer_store_format_xyzw v[0:3], {{v\[[0-9]+:[0-9]+\]}}, s[0:3], dfmt:3, nfmt:7, 0 idxen offen
anatofuz
parents:
diff changeset
61 ; GFX10: tbuffer_store_format_xyzw v[0:3], {{v\[[0-9]+:[0-9]+\]}}, s[0:3], format:115, 0 idxen offen
anatofuz
parents:
diff changeset
62 define amdgpu_ps void @buffer_store_ofs(<4 x i32> inreg, <4 x float> %vdata, i32 %voffset) {
anatofuz
parents:
diff changeset
63 main_body:
anatofuz
parents:
diff changeset
64 %in1 = bitcast <4 x float> %vdata to <4 x i32>
anatofuz
parents:
diff changeset
65 call void @llvm.amdgcn.struct.tbuffer.store.v4i32(<4 x i32> %in1, <4 x i32> %0, i32 0, i32 %voffset, i32 0, i32 115, i32 0)
anatofuz
parents:
diff changeset
66 ret void
anatofuz
parents:
diff changeset
67 }
anatofuz
parents:
diff changeset
68
anatofuz
parents:
diff changeset
69 ; GCN-LABEL: {{^}}buffer_store_both:
anatofuz
parents:
diff changeset
70 ; PREGFX10: tbuffer_store_format_xyzw v[0:3], v[4:5], s[0:3], dfmt:6, nfmt:4, 0 idxen offen
anatofuz
parents:
diff changeset
71 ; GFX10: tbuffer_store_format_xyzw v[0:3], v[4:5], s[0:3], format:70, 0 idxen offen
anatofuz
parents:
diff changeset
72 define amdgpu_ps void @buffer_store_both(<4 x i32> inreg, <4 x float> %vdata, i32 %vindex, i32 %voffset) {
anatofuz
parents:
diff changeset
73 main_body:
anatofuz
parents:
diff changeset
74 %in1 = bitcast <4 x float> %vdata to <4 x i32>
anatofuz
parents:
diff changeset
75 call void @llvm.amdgcn.struct.tbuffer.store.v4i32(<4 x i32> %in1, <4 x i32> %0, i32 %vindex, i32 %voffset, i32 0, i32 70, i32 0)
anatofuz
parents:
diff changeset
76 ret void
anatofuz
parents:
diff changeset
77 }
anatofuz
parents:
diff changeset
78
anatofuz
parents:
diff changeset
79 ; Ideally, the register allocator would avoid the wait here
anatofuz
parents:
diff changeset
80 ;
anatofuz
parents:
diff changeset
81 ; GCN-LABEL: {{^}}buffer_store_wait:
anatofuz
parents:
diff changeset
82 ; PREGFX10: tbuffer_store_format_xyzw v[0:3], v4, s[0:3], dfmt:15, nfmt:3, 0 idxen
anatofuz
parents:
diff changeset
83 ; GFX10: tbuffer_store_format_xyzw v[0:3], v4, s[0:3], format:63, 0 idxen
anatofuz
parents:
diff changeset
84 ; VERDE: s_waitcnt expcnt(0)
anatofuz
parents:
diff changeset
85 ; GCN: buffer_load_format_xyzw v[0:3], v5, s[0:3], 0 idxen
anatofuz
parents:
diff changeset
86 ; GCN: s_waitcnt vmcnt(0)
anatofuz
parents:
diff changeset
87 ; PREGFX10: tbuffer_store_format_xyzw v[0:3], v6, s[0:3], dfmt:14, nfmt:2, 0 idxen
anatofuz
parents:
diff changeset
88 ; GFX10: tbuffer_store_format_xyzw v[0:3], v6, s[0:3], format:46, 0 idxen
anatofuz
parents:
diff changeset
89 define amdgpu_ps void @buffer_store_wait(<4 x i32> inreg, <4 x float> %vdata, i32 %vindex.1, i32 %vindex.2, i32 %vindex.3) {
anatofuz
parents:
diff changeset
90 main_body:
anatofuz
parents:
diff changeset
91 %in1 = bitcast <4 x float> %vdata to <4 x i32>
anatofuz
parents:
diff changeset
92 call void @llvm.amdgcn.struct.tbuffer.store.v4i32(<4 x i32> %in1, <4 x i32> %0, i32 %vindex.1, i32 0, i32 0, i32 63, i32 0)
anatofuz
parents:
diff changeset
93 %data = call <4 x float> @llvm.amdgcn.buffer.load.format.v4f32(<4 x i32> %0, i32 %vindex.2, i32 0, i1 0, i1 0)
anatofuz
parents:
diff changeset
94 %data.i = bitcast <4 x float> %data to <4 x i32>
anatofuz
parents:
diff changeset
95 call void @llvm.amdgcn.struct.tbuffer.store.v4i32(<4 x i32> %data.i, <4 x i32> %0, i32 %vindex.3, i32 0, i32 0, i32 46, i32 0)
anatofuz
parents:
diff changeset
96 ret void
anatofuz
parents:
diff changeset
97 }
anatofuz
parents:
diff changeset
98
anatofuz
parents:
diff changeset
99 ; GCN-LABEL: {{^}}buffer_store_x1:
anatofuz
parents:
diff changeset
100 ; PREGFX10: tbuffer_store_format_x v0, v1, s[0:3], dfmt:13, nfmt:7, 0 idxen
anatofuz
parents:
diff changeset
101 ; GFX10: tbuffer_store_format_x v0, v1, s[0:3], format:125, 0 idxen
anatofuz
parents:
diff changeset
102 define amdgpu_ps void @buffer_store_x1(<4 x i32> inreg %rsrc, float %data, i32 %vindex) {
anatofuz
parents:
diff changeset
103 main_body:
anatofuz
parents:
diff changeset
104 %data.i = bitcast float %data to i32
anatofuz
parents:
diff changeset
105 call void @llvm.amdgcn.struct.tbuffer.store.i32(i32 %data.i, <4 x i32> %rsrc, i32 %vindex, i32 0, i32 0, i32 125, i32 0)
anatofuz
parents:
diff changeset
106 ret void
anatofuz
parents:
diff changeset
107 }
anatofuz
parents:
diff changeset
108
anatofuz
parents:
diff changeset
109 ; GCN-LABEL: {{^}}buffer_store_x2:
anatofuz
parents:
diff changeset
110 ; PREGFX10: tbuffer_store_format_xy v[0:1], v2, s[0:3], dfmt:1, nfmt:2, 0 idxen
anatofuz
parents:
diff changeset
111 ; GFX10: tbuffer_store_format_xy v[0:1], v2, s[0:3], format:33, 0 idxen
anatofuz
parents:
diff changeset
112 define amdgpu_ps void @buffer_store_x2(<4 x i32> inreg %rsrc, <2 x float> %data, i32 %vindex) {
anatofuz
parents:
diff changeset
113 main_body:
anatofuz
parents:
diff changeset
114 %data.i = bitcast <2 x float> %data to <2 x i32>
anatofuz
parents:
diff changeset
115 call void @llvm.amdgcn.struct.tbuffer.store.v2i32(<2 x i32> %data.i, <4 x i32> %rsrc, i32 %vindex, i32 0, i32 0, i32 33, i32 0)
anatofuz
parents:
diff changeset
116 ret void
anatofuz
parents:
diff changeset
117 }
anatofuz
parents:
diff changeset
118
anatofuz
parents:
diff changeset
119 declare void @llvm.amdgcn.struct.tbuffer.store.i32(i32, <4 x i32>, i32, i32, i32, i32, i32) #0
anatofuz
parents:
diff changeset
120 declare void @llvm.amdgcn.struct.tbuffer.store.v2i32(<2 x i32>, <4 x i32>, i32, i32, i32, i32, i32) #0
anatofuz
parents:
diff changeset
121 declare void @llvm.amdgcn.struct.tbuffer.store.v4i32(<4 x i32>, <4 x i32>, i32, i32, i32, i32, i32) #0
anatofuz
parents:
diff changeset
122 declare void @llvm.amdgcn.struct.tbuffer.store.v4f32(<4 x float>, <4 x i32>, i32, i32, i32, i32, i32) #0
anatofuz
parents:
diff changeset
123 declare <4 x float> @llvm.amdgcn.buffer.load.format.v4f32(<4 x i32>, i32, i32, i1, i1) #1
anatofuz
parents:
diff changeset
124
anatofuz
parents:
diff changeset
125 attributes #0 = { nounwind }
anatofuz
parents:
diff changeset
126 attributes #1 = { nounwind readonly }
anatofuz
parents:
diff changeset
127
anatofuz
parents:
diff changeset
128