blob: 96f0210825c643d9acc274cc7eca8025d45a3249 [file] [log] [blame]
Neil Henning63718b22018-10-31 10:34:48 +00001; RUN: llc -march=amdgcn -mcpu=gfx900 -verify-machineinstrs < %s | FileCheck -check-prefixes=GCN %s
2
3; GCN-LABEL: {{^}}load_1d:
4; GCN: image_load v[0:3], v0, s[0:7] dmask:0xf unorm a16
5define amdgpu_ps <4 x float> @load_1d(<8 x i32> inreg %rsrc, <2 x i16> %coords) {
6main_body:
7 %s = extractelement <2 x i16> %coords, i32 0
8 %v = call <4 x float> @llvm.amdgcn.image.load.1d.v4f32.i16(i32 15, i16 %s, <8 x i32> %rsrc, i32 0, i32 0)
9 ret <4 x float> %v
10}
11
12; GCN-LABEL: {{^}}load_2d:
13; GCN: image_load v[0:3], v0, s[0:7] dmask:0xf unorm a16
14define amdgpu_ps <4 x float> @load_2d(<8 x i32> inreg %rsrc, <2 x i16> %coords) {
15main_body:
16 %s = extractelement <2 x i16> %coords, i32 0
17 %t = extractelement <2 x i16> %coords, i32 1
18 %v = call <4 x float> @llvm.amdgcn.image.load.2d.v4f32.i16(i32 15, i16 %s, i16 %t, <8 x i32> %rsrc, i32 0, i32 0)
19 ret <4 x float> %v
20}
21
22; GCN-LABEL: {{^}}load_3d:
23; GCN: image_load v[0:3], v[0:1], s[0:7] dmask:0xf unorm a16
24define amdgpu_ps <4 x float> @load_3d(<8 x i32> inreg %rsrc, <2 x i16> %coords_lo, <2 x i16> %coords_hi) {
25main_body:
26 %s = extractelement <2 x i16> %coords_lo, i32 0
27 %t = extractelement <2 x i16> %coords_lo, i32 1
28 %r = extractelement <2 x i16> %coords_hi, i32 0
29 %v = call <4 x float> @llvm.amdgcn.image.load.3d.v4f32.i16(i32 15, i16 %s, i16 %t, i16 %r, <8 x i32> %rsrc, i32 0, i32 0)
30 ret <4 x float> %v
31}
32
33; GCN-LABEL: {{^}}load_cube:
34; GCN: image_load v[0:3], v[0:1], s[0:7] dmask:0xf unorm a16 da{{$}}
35define amdgpu_ps <4 x float> @load_cube(<8 x i32> inreg %rsrc, <2 x i16> %coords_lo, <2 x i16> %coords_hi) {
36main_body:
37 %s = extractelement <2 x i16> %coords_lo, i32 0
38 %t = extractelement <2 x i16> %coords_lo, i32 1
39 %slice = extractelement <2 x i16> %coords_hi, i32 0
40 %v = call <4 x float> @llvm.amdgcn.image.load.cube.v4f32.i16(i32 15, i16 %s, i16 %t, i16 %slice, <8 x i32> %rsrc, i32 0, i32 0)
41 ret <4 x float> %v
42}
43
44; GCN-LABEL: {{^}}load_1darray:
45; GCN: image_load v[0:3], v0, s[0:7] dmask:0xf unorm a16 da{{$}}
46define amdgpu_ps <4 x float> @load_1darray(<8 x i32> inreg %rsrc, <2 x i16> %coords) {
47main_body:
48 %s = extractelement <2 x i16> %coords, i32 0
49 %slice = extractelement <2 x i16> %coords, i32 1
50 %v = call <4 x float> @llvm.amdgcn.image.load.1darray.v4f32.i16(i32 15, i16 %s, i16 %slice, <8 x i32> %rsrc, i32 0, i32 0)
51 ret <4 x float> %v
52}
53
54; GCN-LABEL: {{^}}load_2darray:
55; GCN: image_load v[0:3], v[0:1], s[0:7] dmask:0xf unorm a16 da{{$}}
56define amdgpu_ps <4 x float> @load_2darray(<8 x i32> inreg %rsrc, <2 x i16> %coords_lo, <2 x i16> %coords_hi) {
57main_body:
58 %s = extractelement <2 x i16> %coords_lo, i32 0
59 %t = extractelement <2 x i16> %coords_lo, i32 1
60 %slice = extractelement <2 x i16> %coords_hi, i32 0
61 %v = call <4 x float> @llvm.amdgcn.image.load.2darray.v4f32.i16(i32 15, i16 %s, i16 %t, i16 %slice, <8 x i32> %rsrc, i32 0, i32 0)
62 ret <4 x float> %v
63}
64
65; GCN-LABEL: {{^}}load_2dmsaa:
66; GCN: image_load v[0:3], v[0:1], s[0:7] dmask:0xf unorm a16
67define amdgpu_ps <4 x float> @load_2dmsaa(<8 x i32> inreg %rsrc, <2 x i16> %coords_lo, <2 x i16> %coords_hi) {
68main_body:
69 %s = extractelement <2 x i16> %coords_lo, i32 0
70 %t = extractelement <2 x i16> %coords_lo, i32 1
71 %fragid = extractelement <2 x i16> %coords_hi, i32 0
72 %v = call <4 x float> @llvm.amdgcn.image.load.2dmsaa.v4f32.i16(i32 15, i16 %s, i16 %t, i16 %fragid, <8 x i32> %rsrc, i32 0, i32 0)
73 ret <4 x float> %v
74}
75
76; GCN-LABEL: {{^}}load_2darraymsaa:
77; GCN: image_load v[0:3], v[0:1], s[0:7] dmask:0xf unorm a16 da{{$}}
78define amdgpu_ps <4 x float> @load_2darraymsaa(<8 x i32> inreg %rsrc, <2 x i16> %coords_lo, <2 x i16> %coords_hi) {
79main_body:
80 %s = extractelement <2 x i16> %coords_lo, i32 0
81 %t = extractelement <2 x i16> %coords_lo, i32 1
82 %slice = extractelement <2 x i16> %coords_hi, i32 0
83 %fragid = extractelement <2 x i16> %coords_hi, i32 1
84 %v = call <4 x float> @llvm.amdgcn.image.load.2darraymsaa.v4f32.i16(i32 15, i16 %s, i16 %t, i16 %slice, i16 %fragid, <8 x i32> %rsrc, i32 0, i32 0)
85 ret <4 x float> %v
86}
87
88; GCN-LABEL: {{^}}load_mip_1d:
89; GCN: image_load_mip v[0:3], v0, s[0:7] dmask:0xf unorm a16
90define amdgpu_ps <4 x float> @load_mip_1d(<8 x i32> inreg %rsrc, <2 x i16> %coords) {
91main_body:
92 %s = extractelement <2 x i16> %coords, i32 0
93 %mip = extractelement <2 x i16> %coords, i32 1
94 %v = call <4 x float> @llvm.amdgcn.image.load.mip.1d.v4f32.i16(i32 15, i16 %s, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
95 ret <4 x float> %v
96}
97
98; GCN-LABEL: {{^}}load_mip_2d:
99; GCN: image_load_mip v[0:3], v[0:1], s[0:7] dmask:0xf unorm a16
100define amdgpu_ps <4 x float> @load_mip_2d(<8 x i32> inreg %rsrc, <2 x i16> %coords_lo, <2 x i16> %coords_hi) {
101main_body:
102 %s = extractelement <2 x i16> %coords_lo, i32 0
103 %t = extractelement <2 x i16> %coords_lo, i32 1
104 %mip = extractelement <2 x i16> %coords_hi, i32 0
105 %v = call <4 x float> @llvm.amdgcn.image.load.mip.2d.v4f32.i16(i32 15, i16 %s, i16 %t, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
106 ret <4 x float> %v
107}
108
109; GCN-LABEL: {{^}}load_mip_3d:
110; GCN: image_load_mip v[0:3], v[0:1], s[0:7] dmask:0xf unorm a16
111define amdgpu_ps <4 x float> @load_mip_3d(<8 x i32> inreg %rsrc, <2 x i16> %coords_lo, <2 x i16> %coords_hi) {
112main_body:
113 %s = extractelement <2 x i16> %coords_lo, i32 0
114 %t = extractelement <2 x i16> %coords_lo, i32 1
115 %r = extractelement <2 x i16> %coords_hi, i32 0
116 %mip = extractelement <2 x i16> %coords_hi, i32 1
117 %v = call <4 x float> @llvm.amdgcn.image.load.mip.3d.v4f32.i16(i32 15, i16 %s, i16 %t, i16 %r, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
118 ret <4 x float> %v
119}
120
121; GCN-LABEL: {{^}}load_mip_cube:
122; GCN: image_load_mip v[0:3], v[0:1], s[0:7] dmask:0xf unorm a16 da{{$}}
123define amdgpu_ps <4 x float> @load_mip_cube(<8 x i32> inreg %rsrc, <2 x i16> %coords_lo, <2 x i16> %coords_hi) {
124main_body:
125 %s = extractelement <2 x i16> %coords_lo, i32 0
126 %t = extractelement <2 x i16> %coords_lo, i32 1
127 %slice = extractelement <2 x i16> %coords_hi, i32 0
128 %mip = extractelement <2 x i16> %coords_hi, i32 1
129 %v = call <4 x float> @llvm.amdgcn.image.load.mip.cube.v4f32.i16(i32 15, i16 %s, i16 %t, i16 %slice, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
130 ret <4 x float> %v
131}
132
133; GCN-LABEL: {{^}}load_mip_1darray:
134; GCN: image_load_mip v[0:3], v[0:1], s[0:7] dmask:0xf unorm a16 da{{$}}
135define amdgpu_ps <4 x float> @load_mip_1darray(<8 x i32> inreg %rsrc, <2 x i16> %coords_lo, <2 x i16> %coords_hi) {
136main_body:
137 %s = extractelement <2 x i16> %coords_lo, i32 0
138 %slice = extractelement <2 x i16> %coords_lo, i32 1
139 %mip = extractelement <2 x i16> %coords_hi, i32 0
140 %v = call <4 x float> @llvm.amdgcn.image.load.mip.1darray.v4f32.i16(i32 15, i16 %s, i16 %slice, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
141 ret <4 x float> %v
142}
143
144; GCN-LABEL: {{^}}load_mip_2darray:
145; GCN: image_load_mip v[0:3], v[0:1], s[0:7] dmask:0xf unorm a16 da{{$}}
146define amdgpu_ps <4 x float> @load_mip_2darray(<8 x i32> inreg %rsrc, <2 x i16> %coords_lo, <2 x i16> %coords_hi) {
147main_body:
148 %s = extractelement <2 x i16> %coords_lo, i32 0
149 %t = extractelement <2 x i16> %coords_lo, i32 1
150 %slice = extractelement <2 x i16> %coords_hi, i32 0
151 %mip = extractelement <2 x i16> %coords_hi, i32 1
152 %v = call <4 x float> @llvm.amdgcn.image.load.mip.2darray.v4f32.i16(i32 15, i16 %s, i16 %t, i16 %slice, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
153 ret <4 x float> %v
154}
155
156; GCN-LABEL: {{^}}store_1d:
157; GCN: image_store v[0:3], v4, s[0:7] dmask:0xf unorm a16
158define amdgpu_ps void @store_1d(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords) {
159main_body:
160 %s = extractelement <2 x i16> %coords, i32 0
161 call void @llvm.amdgcn.image.store.1d.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, <8 x i32> %rsrc, i32 0, i32 0)
162 ret void
163}
164
165; GCN-LABEL: {{^}}store_2d:
166; GCN: image_store v[0:3], v4, s[0:7] dmask:0xf unorm a16
167define amdgpu_ps void @store_2d(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords) {
168main_body:
169 %s = extractelement <2 x i16> %coords, i32 0
170 %t = extractelement <2 x i16> %coords, i32 1
171 call void @llvm.amdgcn.image.store.2d.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, i16 %t, <8 x i32> %rsrc, i32 0, i32 0)
172 ret void
173}
174
175; GCN-LABEL: {{^}}store_3d:
176; GCN: image_store v[0:3], v[4:5], s[0:7] dmask:0xf unorm a16
177define amdgpu_ps void @store_3d(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords_lo, <2 x i16> %coords_hi) {
178main_body:
179 %s = extractelement <2 x i16> %coords_lo, i32 0
180 %t = extractelement <2 x i16> %coords_lo, i32 1
181 %r = extractelement <2 x i16> %coords_hi, i32 0
182 call void @llvm.amdgcn.image.store.3d.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, i16 %t, i16 %r, <8 x i32> %rsrc, i32 0, i32 0)
183 ret void
184}
185
186; GCN-LABEL: {{^}}store_cube:
187; GCN: image_store v[0:3], v[4:5], s[0:7] dmask:0xf unorm a16 da{{$}}
188define amdgpu_ps void @store_cube(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords_lo, <2 x i16> %coords_hi) {
189main_body:
190 %s = extractelement <2 x i16> %coords_lo, i32 0
191 %t = extractelement <2 x i16> %coords_lo, i32 1
192 %slice = extractelement <2 x i16> %coords_hi, i32 0
193 call void @llvm.amdgcn.image.store.cube.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, i16 %t, i16 %slice, <8 x i32> %rsrc, i32 0, i32 0)
194 ret void
195}
196
197; GCN-LABEL: {{^}}store_1darray:
198; GCN: image_store v[0:3], v4, s[0:7] dmask:0xf unorm a16 da{{$}}
199define amdgpu_ps void @store_1darray(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords) {
200main_body:
201 %s = extractelement <2 x i16> %coords, i32 0
202 %slice = extractelement <2 x i16> %coords, i32 1
203 call void @llvm.amdgcn.image.store.1darray.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, i16 %slice, <8 x i32> %rsrc, i32 0, i32 0)
204 ret void
205}
206
207; GCN-LABEL: {{^}}store_2darray:
208; GCN: image_store v[0:3], v[4:5], s[0:7] dmask:0xf unorm a16 da{{$}}
209define amdgpu_ps void @store_2darray(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords_lo, <2 x i16> %coords_hi) {
210main_body:
211 %s = extractelement <2 x i16> %coords_lo, i32 0
212 %t = extractelement <2 x i16> %coords_lo, i32 1
213 %slice = extractelement <2 x i16> %coords_hi, i32 0
214 call void @llvm.amdgcn.image.store.2darray.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, i16 %t, i16 %slice, <8 x i32> %rsrc, i32 0, i32 0)
215 ret void
216}
217
218; GCN-LABEL: {{^}}store_2dmsaa:
219; GCN: image_store v[0:3], v[4:5], s[0:7] dmask:0xf unorm a16
220define amdgpu_ps void @store_2dmsaa(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords_lo, <2 x i16> %coords_hi) {
221main_body:
222 %s = extractelement <2 x i16> %coords_lo, i32 0
223 %t = extractelement <2 x i16> %coords_lo, i32 1
224 %fragid = extractelement <2 x i16> %coords_hi, i32 0
225 call void @llvm.amdgcn.image.store.2dmsaa.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, i16 %t, i16 %fragid, <8 x i32> %rsrc, i32 0, i32 0)
226 ret void
227}
228
229; GCN-LABEL: {{^}}store_2darraymsaa:
230; GCN: image_store v[0:3], v[4:5], s[0:7] dmask:0xf unorm a16 da{{$}}
231define amdgpu_ps void @store_2darraymsaa(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords_lo, <2 x i16> %coords_hi) {
232main_body:
233 %s = extractelement <2 x i16> %coords_lo, i32 0
234 %t = extractelement <2 x i16> %coords_lo, i32 1
235 %slice = extractelement <2 x i16> %coords_hi, i32 0
236 %fragid = extractelement <2 x i16> %coords_hi, i32 1
237 call void @llvm.amdgcn.image.store.2darraymsaa.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, i16 %t, i16 %slice, i16 %fragid, <8 x i32> %rsrc, i32 0, i32 0)
238 ret void
239}
240
241; GCN-LABEL: {{^}}store_mip_1d:
242; GCN: image_store_mip v[0:3], v4, s[0:7] dmask:0xf unorm a16
243define amdgpu_ps void @store_mip_1d(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords) {
244main_body:
245 %s = extractelement <2 x i16> %coords, i32 0
246 %mip = extractelement <2 x i16> %coords, i32 1
247 call void @llvm.amdgcn.image.store.mip.1d.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
248 ret void
249}
250
251; GCN-LABEL: {{^}}store_mip_2d:
252; GCN: image_store_mip v[0:3], v[4:5], s[0:7] dmask:0xf unorm a16
253define amdgpu_ps void @store_mip_2d(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords_lo, <2 x i16> %coords_hi) {
254main_body:
255 %s = extractelement <2 x i16> %coords_lo, i32 0
256 %t = extractelement <2 x i16> %coords_lo, i32 1
257 %mip = extractelement <2 x i16> %coords_hi, i32 0
258 call void @llvm.amdgcn.image.store.mip.2d.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, i16 %t, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
259 ret void
260}
261
262; GCN-LABEL: {{^}}store_mip_3d:
263; GCN: image_store_mip v[0:3], v[4:5], s[0:7] dmask:0xf unorm a16
264define amdgpu_ps void @store_mip_3d(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords_lo, <2 x i16> %coords_hi) {
265main_body:
266 %s = extractelement <2 x i16> %coords_lo, i32 0
267 %t = extractelement <2 x i16> %coords_lo, i32 1
268 %r = extractelement <2 x i16> %coords_hi, i32 0
269 %mip = extractelement <2 x i16> %coords_hi, i32 1
270 call void @llvm.amdgcn.image.store.mip.3d.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, i16 %t, i16 %r, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
271 ret void
272}
273
274; GCN-LABEL: {{^}}store_mip_cube:
275; GCN: image_store_mip v[0:3], v[4:5], s[0:7] dmask:0xf unorm a16 da{{$}}
276define amdgpu_ps void @store_mip_cube(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords_lo, <2 x i16> %coords_hi) {
277main_body:
278 %s = extractelement <2 x i16> %coords_lo, i32 0
279 %t = extractelement <2 x i16> %coords_lo, i32 1
280 %slice = extractelement <2 x i16> %coords_hi, i32 0
281 %mip = extractelement <2 x i16> %coords_hi, i32 1
282 call void @llvm.amdgcn.image.store.mip.cube.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, i16 %t, i16 %slice, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
283 ret void
284}
285
286; GCN-LABEL: {{^}}store_mip_1darray:
287; GCN: image_store_mip v[0:3], v[4:5], s[0:7] dmask:0xf unorm a16 da{{$}}
288define amdgpu_ps void @store_mip_1darray(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords_lo, <2 x i16> %coords_hi) {
289main_body:
290 %s = extractelement <2 x i16> %coords_lo, i32 0
291 %slice = extractelement <2 x i16> %coords_lo, i32 1
292 %mip = extractelement <2 x i16> %coords_hi, i32 0
293 call void @llvm.amdgcn.image.store.mip.1darray.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, i16 %slice, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
294 ret void
295}
296
297; GCN-LABEL: {{^}}store_mip_2darray:
298; GCN: image_store_mip v[0:3], v[4:5], s[0:7] dmask:0xf unorm a16 da{{$}}
299define amdgpu_ps void @store_mip_2darray(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords_lo, <2 x i16> %coords_hi) {
300main_body:
301 %s = extractelement <2 x i16> %coords_lo, i32 0
302 %t = extractelement <2 x i16> %coords_lo, i32 1
303 %slice = extractelement <2 x i16> %coords_hi, i32 0
304 %mip = extractelement <2 x i16> %coords_hi, i32 1
305 call void @llvm.amdgcn.image.store.mip.2darray.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, i16 %t, i16 %slice, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
306 ret void
307}
308
309; GCN-LABEL: {{^}}getresinfo_1d:
310; GCN: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm a16
311define amdgpu_ps <4 x float> @getresinfo_1d(<8 x i32> inreg %rsrc, <2 x i16> %coords) {
312main_body:
313 %mip = extractelement <2 x i16> %coords, i32 0
314 %v = call <4 x float> @llvm.amdgcn.image.getresinfo.1d.v4f32.i16(i32 15, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
315 ret <4 x float> %v
316}
317
318; GCN-LABEL: {{^}}getresinfo_2d:
319; GCN: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm a16
320define amdgpu_ps <4 x float> @getresinfo_2d(<8 x i32> inreg %rsrc, <2 x i16> %coords) {
321main_body:
322 %mip = extractelement <2 x i16> %coords, i32 0
323 %v = call <4 x float> @llvm.amdgcn.image.getresinfo.2d.v4f32.i16(i32 15, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
324 ret <4 x float> %v
325}
326
327; GCN-LABEL: {{^}}getresinfo_3d:
328; GCN: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm a16
329define amdgpu_ps <4 x float> @getresinfo_3d(<8 x i32> inreg %rsrc, <2 x i16> %coords) {
330main_body:
331 %mip = extractelement <2 x i16> %coords, i32 0
332 %v = call <4 x float> @llvm.amdgcn.image.getresinfo.3d.v4f32.i16(i32 15, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
333 ret <4 x float> %v
334}
335
336; GCN-LABEL: {{^}}getresinfo_cube:
337; GCN: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm a16 da{{$}}
338define amdgpu_ps <4 x float> @getresinfo_cube(<8 x i32> inreg %rsrc, <2 x i16> %coords) {
339main_body:
340 %mip = extractelement <2 x i16> %coords, i32 0
341 %v = call <4 x float> @llvm.amdgcn.image.getresinfo.cube.v4f32.i16(i32 15, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
342 ret <4 x float> %v
343}
344
345; GCN-LABEL: {{^}}getresinfo_1darray:
346; GCN: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm a16 da{{$}}
347define amdgpu_ps <4 x float> @getresinfo_1darray(<8 x i32> inreg %rsrc, <2 x i16> %coords) {
348main_body:
349 %mip = extractelement <2 x i16> %coords, i32 0
350 %v = call <4 x float> @llvm.amdgcn.image.getresinfo.1darray.v4f32.i16(i32 15, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
351 ret <4 x float> %v
352}
353
354; GCN-LABEL: {{^}}getresinfo_2darray:
355; GCN: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm a16 da{{$}}
356define amdgpu_ps <4 x float> @getresinfo_2darray(<8 x i32> inreg %rsrc, <2 x i16> %coords) {
357main_body:
358 %mip = extractelement <2 x i16> %coords, i32 0
359 %v = call <4 x float> @llvm.amdgcn.image.getresinfo.2darray.v4f32.i16(i32 15, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
360 ret <4 x float> %v
361}
362
363; GCN-LABEL: {{^}}getresinfo_2dmsaa:
364; GCN: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm a16
365define amdgpu_ps <4 x float> @getresinfo_2dmsaa(<8 x i32> inreg %rsrc, <2 x i16> %coords) {
366main_body:
367 %mip = extractelement <2 x i16> %coords, i32 0
368 %v = call <4 x float> @llvm.amdgcn.image.getresinfo.2dmsaa.v4f32.i16(i32 15, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
369 ret <4 x float> %v
370}
371
372; GCN-LABEL: {{^}}getresinfo_2darraymsaa:
373; GCN: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm a16 da{{$}}
374define amdgpu_ps <4 x float> @getresinfo_2darraymsaa(<8 x i32> inreg %rsrc, <2 x i16> %coords) {
375main_body:
376 %mip = extractelement <2 x i16> %coords, i32 0
377 %v = call <4 x float> @llvm.amdgcn.image.getresinfo.2darraymsaa.v4f32.i16(i32 15, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
378 ret <4 x float> %v
379}
380
381; GCN-LABEL: {{^}}load_1d_V1:
382; GCN: image_load v0, v0, s[0:7] dmask:0x8 unorm a16
383define amdgpu_ps float @load_1d_V1(<8 x i32> inreg %rsrc, <2 x i16> %coords) {
384main_body:
385 %s = extractelement <2 x i16> %coords, i32 0
386 %v = call float @llvm.amdgcn.image.load.1d.f32.i16(i32 8, i16 %s, <8 x i32> %rsrc, i32 0, i32 0)
387 ret float %v
388}
389
390; GCN-LABEL: {{^}}load_1d_V2:
391; GCN: image_load v[0:1], v0, s[0:7] dmask:0x9 unorm a16
392define amdgpu_ps <2 x float> @load_1d_V2(<8 x i32> inreg %rsrc, <2 x i16> %coords) {
393main_body:
394 %s = extractelement <2 x i16> %coords, i32 0
395 %v = call <2 x float> @llvm.amdgcn.image.load.1d.v2f32.i16(i32 9, i16 %s, <8 x i32> %rsrc, i32 0, i32 0)
396 ret <2 x float> %v
397}
398
399; GCN-LABEL: {{^}}store_1d_V1:
400; GCN: image_store v0, v1, s[0:7] dmask:0x2 unorm a16
401define amdgpu_ps void @store_1d_V1(<8 x i32> inreg %rsrc, float %vdata, <2 x i16> %coords) {
402main_body:
403 %s = extractelement <2 x i16> %coords, i32 0
404 call void @llvm.amdgcn.image.store.1d.f32.i16(float %vdata, i32 2, i16 %s, <8 x i32> %rsrc, i32 0, i32 0)
405 ret void
406}
407
408; GCN-LABEL: {{^}}store_1d_V2:
409; GCN: image_store v[0:1], v2, s[0:7] dmask:0xc unorm a16
410define amdgpu_ps void @store_1d_V2(<8 x i32> inreg %rsrc, <2 x float> %vdata, <2 x i16> %coords) {
411main_body:
412 %s = extractelement <2 x i16> %coords, i32 0
413 call void @llvm.amdgcn.image.store.1d.v2f32.i16(<2 x float> %vdata, i32 12, i16 %s, <8 x i32> %rsrc, i32 0, i32 0)
414 ret void
415}
416
417; GCN-LABEL: {{^}}load_1d_glc:
418; GCN: image_load v[0:3], v0, s[0:7] dmask:0xf unorm glc a16{{$}}
419define amdgpu_ps <4 x float> @load_1d_glc(<8 x i32> inreg %rsrc, <2 x i16> %coords) {
420main_body:
421 %s = extractelement <2 x i16> %coords, i32 0
422 %v = call <4 x float> @llvm.amdgcn.image.load.1d.v4f32.i16(i32 15, i16 %s, <8 x i32> %rsrc, i32 0, i32 1)
423 ret <4 x float> %v
424}
425
426; GCN-LABEL: {{^}}load_1d_slc:
427; GCN: image_load v[0:3], v0, s[0:7] dmask:0xf unorm slc a16{{$}}
428define amdgpu_ps <4 x float> @load_1d_slc(<8 x i32> inreg %rsrc, <2 x i16> %coords) {
429main_body:
430 %s = extractelement <2 x i16> %coords, i32 0
431 %v = call <4 x float> @llvm.amdgcn.image.load.1d.v4f32.i16(i32 15, i16 %s, <8 x i32> %rsrc, i32 0, i32 2)
432 ret <4 x float> %v
433}
434
435; GCN-LABEL: {{^}}load_1d_glc_slc:
436; GCN: image_load v[0:3], v0, s[0:7] dmask:0xf unorm glc slc a16{{$}}
437define amdgpu_ps <4 x float> @load_1d_glc_slc(<8 x i32> inreg %rsrc, <2 x i16> %coords) {
438main_body:
439 %s = extractelement <2 x i16> %coords, i32 0
440 %v = call <4 x float> @llvm.amdgcn.image.load.1d.v4f32.i16(i32 15, i16 %s, <8 x i32> %rsrc, i32 0, i32 3)
441 ret <4 x float> %v
442}
443
444; GCN-LABEL: {{^}}store_1d_glc:
445; GCN: image_store v[0:3], v4, s[0:7] dmask:0xf unorm glc a16{{$}}
446define amdgpu_ps void @store_1d_glc(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords) {
447main_body:
448 %s = extractelement <2 x i16> %coords, i32 0
449 call void @llvm.amdgcn.image.store.1d.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, <8 x i32> %rsrc, i32 0, i32 1)
450 ret void
451}
452
453; GCN-LABEL: {{^}}store_1d_slc:
454; GCN: image_store v[0:3], v4, s[0:7] dmask:0xf unorm slc a16{{$}}
455define amdgpu_ps void @store_1d_slc(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords) {
456main_body:
457 %s = extractelement <2 x i16> %coords, i32 0
458 call void @llvm.amdgcn.image.store.1d.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, <8 x i32> %rsrc, i32 0, i32 2)
459 ret void
460}
461
462; GCN-LABEL: {{^}}store_1d_glc_slc:
463; GCN: image_store v[0:3], v4, s[0:7] dmask:0xf unorm glc slc a16{{$}}
464define amdgpu_ps void @store_1d_glc_slc(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords) {
465main_body:
466 %s = extractelement <2 x i16> %coords, i32 0
467 call void @llvm.amdgcn.image.store.1d.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, <8 x i32> %rsrc, i32 0, i32 3)
468 ret void
469}
470
471; GCN-LABEL: {{^}}getresinfo_dmask0:
472; GCN-NOT: image
473; GCN: ; return to shader part epilog
474define amdgpu_ps <4 x float> @getresinfo_dmask0(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords) #0 {
475main_body:
476 %mip = extractelement <2 x i16> %coords, i32 0
477 %r = call <4 x float> @llvm.amdgcn.image.getresinfo.1d.v4f32.i16(i32 0, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
478 ret <4 x float> %r
479}
480
481declare <4 x float> @llvm.amdgcn.image.load.1d.v4f32.i16(i32, i16, <8 x i32>, i32, i32) #1
482declare <4 x float> @llvm.amdgcn.image.load.2d.v4f32.i16(i32, i16, i16, <8 x i32>, i32, i32) #1
483declare <4 x float> @llvm.amdgcn.image.load.3d.v4f32.i16(i32, i16, i16, i16, <8 x i32>, i32, i32) #1
484declare <4 x float> @llvm.amdgcn.image.load.cube.v4f32.i16(i32, i16, i16, i16, <8 x i32>, i32, i32) #1
485declare <4 x float> @llvm.amdgcn.image.load.1darray.v4f32.i16(i32, i16, i16, <8 x i32>, i32, i32) #1
486declare <4 x float> @llvm.amdgcn.image.load.2darray.v4f32.i16(i32, i16, i16, i16, <8 x i32>, i32, i32) #1
487declare <4 x float> @llvm.amdgcn.image.load.2dmsaa.v4f32.i16(i32, i16, i16, i16, <8 x i32>, i32, i32) #1
488declare <4 x float> @llvm.amdgcn.image.load.2darraymsaa.v4f32.i16(i32, i16, i16, i16, i16, <8 x i32>, i32, i32) #1
489
490declare <4 x float> @llvm.amdgcn.image.load.mip.1d.v4f32.i16(i32, i16, i16, <8 x i32>, i32, i32) #1
491declare <4 x float> @llvm.amdgcn.image.load.mip.2d.v4f32.i16(i32, i16, i16, i16, <8 x i32>, i32, i32) #1
492declare <4 x float> @llvm.amdgcn.image.load.mip.3d.v4f32.i16(i32, i16, i16, i16, i16, <8 x i32>, i32, i32) #1
493declare <4 x float> @llvm.amdgcn.image.load.mip.cube.v4f32.i16(i32, i16, i16, i16, i16, <8 x i32>, i32, i32) #1
494declare <4 x float> @llvm.amdgcn.image.load.mip.1darray.v4f32.i16(i32, i16, i16, i16, <8 x i32>, i32, i32) #1
495declare <4 x float> @llvm.amdgcn.image.load.mip.2darray.v4f32.i16(i32, i16, i16, i16, i16, <8 x i32>, i32, i32) #1
496
497declare void @llvm.amdgcn.image.store.1d.v4f32.i16(<4 x float>, i32, i16, <8 x i32>, i32, i32) #0
498declare void @llvm.amdgcn.image.store.2d.v4f32.i16(<4 x float>, i32, i16, i16, <8 x i32>, i32, i32) #0
499declare void @llvm.amdgcn.image.store.3d.v4f32.i16(<4 x float>, i32, i16, i16, i16, <8 x i32>, i32, i32) #0
500declare void @llvm.amdgcn.image.store.cube.v4f32.i16(<4 x float>, i32, i16, i16, i16, <8 x i32>, i32, i32) #0
501declare void @llvm.amdgcn.image.store.1darray.v4f32.i16(<4 x float>, i32, i16, i16, <8 x i32>, i32, i32) #0
502declare void @llvm.amdgcn.image.store.2darray.v4f32.i16(<4 x float>, i32, i16, i16, i16, <8 x i32>, i32, i32) #0
503declare void @llvm.amdgcn.image.store.2dmsaa.v4f32.i16(<4 x float>, i32, i16, i16, i16, <8 x i32>, i32, i32) #0
504declare void @llvm.amdgcn.image.store.2darraymsaa.v4f32.i16(<4 x float>, i32, i16, i16, i16, i16, <8 x i32>, i32, i32) #0
505
506declare void @llvm.amdgcn.image.store.mip.1d.v4f32.i16(<4 x float>, i32, i16, i16, <8 x i32>, i32, i32) #0
507declare void @llvm.amdgcn.image.store.mip.2d.v4f32.i16(<4 x float>, i32, i16, i16, i16, <8 x i32>, i32, i32) #0
508declare void @llvm.amdgcn.image.store.mip.3d.v4f32.i16(<4 x float>, i32, i16, i16, i16, i16, <8 x i32>, i32, i32) #0
509declare void @llvm.amdgcn.image.store.mip.cube.v4f32.i16(<4 x float>, i32, i16, i16, i16, i16, <8 x i32>, i32, i32) #0
510declare void @llvm.amdgcn.image.store.mip.1darray.v4f32.i16(<4 x float>, i32, i16, i16, i16, <8 x i32>, i32, i32) #0
511declare void @llvm.amdgcn.image.store.mip.2darray.v4f32.i16(<4 x float>, i32, i16, i16, i16, i16, <8 x i32>, i32, i32) #0
512
513declare <4 x float> @llvm.amdgcn.image.getresinfo.1d.v4f32.i16(i32, i16, <8 x i32>, i32, i32) #2
514declare <4 x float> @llvm.amdgcn.image.getresinfo.2d.v4f32.i16(i32, i16, <8 x i32>, i32, i32) #2
515declare <4 x float> @llvm.amdgcn.image.getresinfo.3d.v4f32.i16(i32, i16, <8 x i32>, i32, i32) #2
516declare <4 x float> @llvm.amdgcn.image.getresinfo.cube.v4f32.i16(i32, i16, <8 x i32>, i32, i32) #2
517declare <4 x float> @llvm.amdgcn.image.getresinfo.1darray.v4f32.i16(i32, i16, <8 x i32>, i32, i32) #2
518declare <4 x float> @llvm.amdgcn.image.getresinfo.2darray.v4f32.i16(i32, i16, <8 x i32>, i32, i32) #2
519declare <4 x float> @llvm.amdgcn.image.getresinfo.2dmsaa.v4f32.i16(i32, i16, <8 x i32>, i32, i32) #2
520declare <4 x float> @llvm.amdgcn.image.getresinfo.2darraymsaa.v4f32.i16(i32, i16, <8 x i32>, i32, i32) #2
521
522declare float @llvm.amdgcn.image.load.1d.f32.i16(i32, i16, <8 x i32>, i32, i32) #1
523declare float @llvm.amdgcn.image.load.2d.f32.i16(i32, i16, i16, <8 x i32>, i32, i32) #1
524declare <2 x float> @llvm.amdgcn.image.load.1d.v2f32.i16(i32, i16, <8 x i32>, i32, i32) #1
525declare void @llvm.amdgcn.image.store.1d.f32.i16(float, i32, i16, <8 x i32>, i32, i32) #0
526declare void @llvm.amdgcn.image.store.1d.v2f32.i16(<2 x float>, i32, i16, <8 x i32>, i32, i32) #0
527
528attributes #0 = { nounwind }
529attributes #1 = { nounwind readonly }
530attributes #2 = { nounwind readnone }