1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -global-isel -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx900 -verify-machineinstrs < %s | FileCheck -check-prefix=GFX9 %s
3 ; RUN: llc -global-isel -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx1010 -verify-machineinstrs < %s | FileCheck -check-prefix=GFX10 %s
4 ; RUN: llc -global-isel -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx1100 -verify-machineinstrs < %s | FileCheck -check-prefix=GFX10 %s
6 define amdgpu_ps <4 x float> @getresinfo_1d(<8 x i32> inreg %rsrc, i16 %mip) {
7 ; GFX9-LABEL: getresinfo_1d:
8 ; GFX9: ; %bb.0: ; %main_body
9 ; GFX9-NEXT: s_mov_b32 s0, s2
10 ; GFX9-NEXT: s_mov_b32 s1, s3
11 ; GFX9-NEXT: s_mov_b32 s2, s4
12 ; GFX9-NEXT: s_mov_b32 s3, s5
13 ; GFX9-NEXT: s_mov_b32 s4, s6
14 ; GFX9-NEXT: s_mov_b32 s5, s7
15 ; GFX9-NEXT: s_mov_b32 s6, s8
16 ; GFX9-NEXT: s_mov_b32 s7, s9
17 ; GFX9-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm a16
18 ; GFX9-NEXT: s_waitcnt vmcnt(0)
19 ; GFX9-NEXT: ; return to shader part epilog
21 ; GFX10-LABEL: getresinfo_1d:
22 ; GFX10: ; %bb.0: ; %main_body
23 ; GFX10-NEXT: s_mov_b32 s0, s2
24 ; GFX10-NEXT: s_mov_b32 s1, s3
25 ; GFX10-NEXT: s_mov_b32 s2, s4
26 ; GFX10-NEXT: s_mov_b32 s3, s5
27 ; GFX10-NEXT: s_mov_b32 s4, s6
28 ; GFX10-NEXT: s_mov_b32 s5, s7
29 ; GFX10-NEXT: s_mov_b32 s6, s8
30 ; GFX10-NEXT: s_mov_b32 s7, s9
31 ; GFX10-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm a16
32 ; GFX10-NEXT: s_waitcnt vmcnt(0)
33 ; GFX10-NEXT: ; return to shader part epilog
35 %v = call <4 x float> @llvm.amdgcn.image.getresinfo.1d.v4f32.i16(i32 15, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
39 define amdgpu_ps <4 x float> @getresinfo_2d(<8 x i32> inreg %rsrc, i16 %mip) {
40 ; GFX9-LABEL: getresinfo_2d:
41 ; GFX9: ; %bb.0: ; %main_body
42 ; GFX9-NEXT: s_mov_b32 s0, s2
43 ; GFX9-NEXT: s_mov_b32 s1, s3
44 ; GFX9-NEXT: s_mov_b32 s2, s4
45 ; GFX9-NEXT: s_mov_b32 s3, s5
46 ; GFX9-NEXT: s_mov_b32 s4, s6
47 ; GFX9-NEXT: s_mov_b32 s5, s7
48 ; GFX9-NEXT: s_mov_b32 s6, s8
49 ; GFX9-NEXT: s_mov_b32 s7, s9
50 ; GFX9-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm a16
51 ; GFX9-NEXT: s_waitcnt vmcnt(0)
52 ; GFX9-NEXT: ; return to shader part epilog
54 ; GFX10-LABEL: getresinfo_2d:
55 ; GFX10: ; %bb.0: ; %main_body
56 ; GFX10-NEXT: s_mov_b32 s0, s2
57 ; GFX10-NEXT: s_mov_b32 s1, s3
58 ; GFX10-NEXT: s_mov_b32 s2, s4
59 ; GFX10-NEXT: s_mov_b32 s3, s5
60 ; GFX10-NEXT: s_mov_b32 s4, s6
61 ; GFX10-NEXT: s_mov_b32 s5, s7
62 ; GFX10-NEXT: s_mov_b32 s6, s8
63 ; GFX10-NEXT: s_mov_b32 s7, s9
64 ; GFX10-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D unorm a16
65 ; GFX10-NEXT: s_waitcnt vmcnt(0)
66 ; GFX10-NEXT: ; return to shader part epilog
68 %v = call <4 x float> @llvm.amdgcn.image.getresinfo.2d.v4f32.i16(i32 15, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
72 define amdgpu_ps <4 x float> @getresinfo_3d(<8 x i32> inreg %rsrc, i16 %mip) {
73 ; GFX9-LABEL: getresinfo_3d:
74 ; GFX9: ; %bb.0: ; %main_body
75 ; GFX9-NEXT: s_mov_b32 s0, s2
76 ; GFX9-NEXT: s_mov_b32 s1, s3
77 ; GFX9-NEXT: s_mov_b32 s2, s4
78 ; GFX9-NEXT: s_mov_b32 s3, s5
79 ; GFX9-NEXT: s_mov_b32 s4, s6
80 ; GFX9-NEXT: s_mov_b32 s5, s7
81 ; GFX9-NEXT: s_mov_b32 s6, s8
82 ; GFX9-NEXT: s_mov_b32 s7, s9
83 ; GFX9-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm a16
84 ; GFX9-NEXT: s_waitcnt vmcnt(0)
85 ; GFX9-NEXT: ; return to shader part epilog
87 ; GFX10-LABEL: getresinfo_3d:
88 ; GFX10: ; %bb.0: ; %main_body
89 ; GFX10-NEXT: s_mov_b32 s0, s2
90 ; GFX10-NEXT: s_mov_b32 s1, s3
91 ; GFX10-NEXT: s_mov_b32 s2, s4
92 ; GFX10-NEXT: s_mov_b32 s3, s5
93 ; GFX10-NEXT: s_mov_b32 s4, s6
94 ; GFX10-NEXT: s_mov_b32 s5, s7
95 ; GFX10-NEXT: s_mov_b32 s6, s8
96 ; GFX10-NEXT: s_mov_b32 s7, s9
97 ; GFX10-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_3D unorm a16
98 ; GFX10-NEXT: s_waitcnt vmcnt(0)
99 ; GFX10-NEXT: ; return to shader part epilog
101 %v = call <4 x float> @llvm.amdgcn.image.getresinfo.3d.v4f32.i16(i32 15, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
105 define amdgpu_ps <4 x float> @getresinfo_cube(<8 x i32> inreg %rsrc, i16 %mip) {
106 ; GFX9-LABEL: getresinfo_cube:
107 ; GFX9: ; %bb.0: ; %main_body
108 ; GFX9-NEXT: s_mov_b32 s0, s2
109 ; GFX9-NEXT: s_mov_b32 s1, s3
110 ; GFX9-NEXT: s_mov_b32 s2, s4
111 ; GFX9-NEXT: s_mov_b32 s3, s5
112 ; GFX9-NEXT: s_mov_b32 s4, s6
113 ; GFX9-NEXT: s_mov_b32 s5, s7
114 ; GFX9-NEXT: s_mov_b32 s6, s8
115 ; GFX9-NEXT: s_mov_b32 s7, s9
116 ; GFX9-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm a16 da
117 ; GFX9-NEXT: s_waitcnt vmcnt(0)
118 ; GFX9-NEXT: ; return to shader part epilog
120 ; GFX10-LABEL: getresinfo_cube:
121 ; GFX10: ; %bb.0: ; %main_body
122 ; GFX10-NEXT: s_mov_b32 s0, s2
123 ; GFX10-NEXT: s_mov_b32 s1, s3
124 ; GFX10-NEXT: s_mov_b32 s2, s4
125 ; GFX10-NEXT: s_mov_b32 s3, s5
126 ; GFX10-NEXT: s_mov_b32 s4, s6
127 ; GFX10-NEXT: s_mov_b32 s5, s7
128 ; GFX10-NEXT: s_mov_b32 s6, s8
129 ; GFX10-NEXT: s_mov_b32 s7, s9
130 ; GFX10-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_CUBE unorm a16
131 ; GFX10-NEXT: s_waitcnt vmcnt(0)
132 ; GFX10-NEXT: ; return to shader part epilog
134 %v = call <4 x float> @llvm.amdgcn.image.getresinfo.cube.v4f32.i16(i32 15, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
138 define amdgpu_ps <4 x float> @getresinfo_1darray(<8 x i32> inreg %rsrc, i16 %mip) {
139 ; GFX9-LABEL: getresinfo_1darray:
140 ; GFX9: ; %bb.0: ; %main_body
141 ; GFX9-NEXT: s_mov_b32 s0, s2
142 ; GFX9-NEXT: s_mov_b32 s1, s3
143 ; GFX9-NEXT: s_mov_b32 s2, s4
144 ; GFX9-NEXT: s_mov_b32 s3, s5
145 ; GFX9-NEXT: s_mov_b32 s4, s6
146 ; GFX9-NEXT: s_mov_b32 s5, s7
147 ; GFX9-NEXT: s_mov_b32 s6, s8
148 ; GFX9-NEXT: s_mov_b32 s7, s9
149 ; GFX9-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm a16 da
150 ; GFX9-NEXT: s_waitcnt vmcnt(0)
151 ; GFX9-NEXT: ; return to shader part epilog
153 ; GFX10-LABEL: getresinfo_1darray:
154 ; GFX10: ; %bb.0: ; %main_body
155 ; GFX10-NEXT: s_mov_b32 s0, s2
156 ; GFX10-NEXT: s_mov_b32 s1, s3
157 ; GFX10-NEXT: s_mov_b32 s2, s4
158 ; GFX10-NEXT: s_mov_b32 s3, s5
159 ; GFX10-NEXT: s_mov_b32 s4, s6
160 ; GFX10-NEXT: s_mov_b32 s5, s7
161 ; GFX10-NEXT: s_mov_b32 s6, s8
162 ; GFX10-NEXT: s_mov_b32 s7, s9
163 ; GFX10-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D_ARRAY unorm a16
164 ; GFX10-NEXT: s_waitcnt vmcnt(0)
165 ; GFX10-NEXT: ; return to shader part epilog
167 %v = call <4 x float> @llvm.amdgcn.image.getresinfo.1darray.v4f32.i16(i32 15, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
171 define amdgpu_ps <4 x float> @getresinfo_2darray(<8 x i32> inreg %rsrc, i16 %mip) {
172 ; GFX9-LABEL: getresinfo_2darray:
173 ; GFX9: ; %bb.0: ; %main_body
174 ; GFX9-NEXT: s_mov_b32 s0, s2
175 ; GFX9-NEXT: s_mov_b32 s1, s3
176 ; GFX9-NEXT: s_mov_b32 s2, s4
177 ; GFX9-NEXT: s_mov_b32 s3, s5
178 ; GFX9-NEXT: s_mov_b32 s4, s6
179 ; GFX9-NEXT: s_mov_b32 s5, s7
180 ; GFX9-NEXT: s_mov_b32 s6, s8
181 ; GFX9-NEXT: s_mov_b32 s7, s9
182 ; GFX9-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm a16 da
183 ; GFX9-NEXT: s_waitcnt vmcnt(0)
184 ; GFX9-NEXT: ; return to shader part epilog
186 ; GFX10-LABEL: getresinfo_2darray:
187 ; GFX10: ; %bb.0: ; %main_body
188 ; GFX10-NEXT: s_mov_b32 s0, s2
189 ; GFX10-NEXT: s_mov_b32 s1, s3
190 ; GFX10-NEXT: s_mov_b32 s2, s4
191 ; GFX10-NEXT: s_mov_b32 s3, s5
192 ; GFX10-NEXT: s_mov_b32 s4, s6
193 ; GFX10-NEXT: s_mov_b32 s5, s7
194 ; GFX10-NEXT: s_mov_b32 s6, s8
195 ; GFX10-NEXT: s_mov_b32 s7, s9
196 ; GFX10-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_ARRAY unorm a16
197 ; GFX10-NEXT: s_waitcnt vmcnt(0)
198 ; GFX10-NEXT: ; return to shader part epilog
200 %v = call <4 x float> @llvm.amdgcn.image.getresinfo.2darray.v4f32.i16(i32 15, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
204 define amdgpu_ps <4 x float> @getresinfo_2dmsaa(<8 x i32> inreg %rsrc, i16 %mip) {
205 ; GFX9-LABEL: getresinfo_2dmsaa:
206 ; GFX9: ; %bb.0: ; %main_body
207 ; GFX9-NEXT: s_mov_b32 s0, s2
208 ; GFX9-NEXT: s_mov_b32 s1, s3
209 ; GFX9-NEXT: s_mov_b32 s2, s4
210 ; GFX9-NEXT: s_mov_b32 s3, s5
211 ; GFX9-NEXT: s_mov_b32 s4, s6
212 ; GFX9-NEXT: s_mov_b32 s5, s7
213 ; GFX9-NEXT: s_mov_b32 s6, s8
214 ; GFX9-NEXT: s_mov_b32 s7, s9
215 ; GFX9-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm a16
216 ; GFX9-NEXT: s_waitcnt vmcnt(0)
217 ; GFX9-NEXT: ; return to shader part epilog
219 ; GFX10-LABEL: getresinfo_2dmsaa:
220 ; GFX10: ; %bb.0: ; %main_body
221 ; GFX10-NEXT: s_mov_b32 s0, s2
222 ; GFX10-NEXT: s_mov_b32 s1, s3
223 ; GFX10-NEXT: s_mov_b32 s2, s4
224 ; GFX10-NEXT: s_mov_b32 s3, s5
225 ; GFX10-NEXT: s_mov_b32 s4, s6
226 ; GFX10-NEXT: s_mov_b32 s5, s7
227 ; GFX10-NEXT: s_mov_b32 s6, s8
228 ; GFX10-NEXT: s_mov_b32 s7, s9
229 ; GFX10-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_MSAA unorm a16
230 ; GFX10-NEXT: s_waitcnt vmcnt(0)
231 ; GFX10-NEXT: ; return to shader part epilog
233 %v = call <4 x float> @llvm.amdgcn.image.getresinfo.2dmsaa.v4f32.i16(i32 15, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
237 define amdgpu_ps <4 x float> @getresinfo_2darraymsaa(<8 x i32> inreg %rsrc, i16 %mip) {
238 ; GFX9-LABEL: getresinfo_2darraymsaa:
239 ; GFX9: ; %bb.0: ; %main_body
240 ; GFX9-NEXT: s_mov_b32 s0, s2
241 ; GFX9-NEXT: s_mov_b32 s1, s3
242 ; GFX9-NEXT: s_mov_b32 s2, s4
243 ; GFX9-NEXT: s_mov_b32 s3, s5
244 ; GFX9-NEXT: s_mov_b32 s4, s6
245 ; GFX9-NEXT: s_mov_b32 s5, s7
246 ; GFX9-NEXT: s_mov_b32 s6, s8
247 ; GFX9-NEXT: s_mov_b32 s7, s9
248 ; GFX9-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm a16 da
249 ; GFX9-NEXT: s_waitcnt vmcnt(0)
250 ; GFX9-NEXT: ; return to shader part epilog
252 ; GFX10-LABEL: getresinfo_2darraymsaa:
253 ; GFX10: ; %bb.0: ; %main_body
254 ; GFX10-NEXT: s_mov_b32 s0, s2
255 ; GFX10-NEXT: s_mov_b32 s1, s3
256 ; GFX10-NEXT: s_mov_b32 s2, s4
257 ; GFX10-NEXT: s_mov_b32 s3, s5
258 ; GFX10-NEXT: s_mov_b32 s4, s6
259 ; GFX10-NEXT: s_mov_b32 s5, s7
260 ; GFX10-NEXT: s_mov_b32 s6, s8
261 ; GFX10-NEXT: s_mov_b32 s7, s9
262 ; GFX10-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_MSAA_ARRAY unorm a16
263 ; GFX10-NEXT: s_waitcnt vmcnt(0)
264 ; GFX10-NEXT: ; return to shader part epilog
266 %v = call <4 x float> @llvm.amdgcn.image.getresinfo.2darraymsaa.v4f32.i16(i32 15, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
270 define amdgpu_ps <4 x float> @getresinfo_dmask0(<8 x i32> inreg %rsrc, <4 x float> %vdata, i16 %mip) {
271 ; GFX9-LABEL: getresinfo_dmask0:
272 ; GFX9: ; %bb.0: ; %main_body
273 ; GFX9-NEXT: ; return to shader part epilog
275 ; GFX10-LABEL: getresinfo_dmask0:
276 ; GFX10: ; %bb.0: ; %main_body
277 ; GFX10-NEXT: ; return to shader part epilog
279 %r = call <4 x float> @llvm.amdgcn.image.getresinfo.1d.v4f32.i16(i32 0, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
283 declare <4 x float> @llvm.amdgcn.image.getresinfo.1d.v4f32.i16(i32 immarg, i16, <8 x i32>, i32 immarg, i32 immarg) #1
284 declare <4 x float> @llvm.amdgcn.image.getresinfo.2d.v4f32.i16(i32 immarg, i16, <8 x i32>, i32 immarg, i32 immarg) #1
285 declare <4 x float> @llvm.amdgcn.image.getresinfo.3d.v4f32.i16(i32 immarg, i16, <8 x i32>, i32 immarg, i32 immarg) #1
286 declare <4 x float> @llvm.amdgcn.image.getresinfo.cube.v4f32.i16(i32 immarg, i16, <8 x i32>, i32 immarg, i32 immarg) #1
287 declare <4 x float> @llvm.amdgcn.image.getresinfo.1darray.v4f32.i16(i32 immarg, i16, <8 x i32>, i32 immarg, i32 immarg) #1
288 declare <4 x float> @llvm.amdgcn.image.getresinfo.2darray.v4f32.i16(i32 immarg, i16, <8 x i32>, i32 immarg, i32 immarg) #1
289 declare <4 x float> @llvm.amdgcn.image.getresinfo.2dmsaa.v4f32.i16(i32 immarg, i16, <8 x i32>, i32 immarg, i32 immarg) #1
290 declare <4 x float> @llvm.amdgcn.image.getresinfo.2darraymsaa.v4f32.i16(i32 immarg, i16, <8 x i32>, i32 immarg, i32 immarg) #1
292 attributes #0 = { nounwind }
293 attributes #1 = { nounwind readnone }