1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
|
; Verifies correctness of load/store of parameters and return values.
; RUN: llc < %s -march=nvptx64 -mcpu=sm_35 -O0 -verify-machineinstrs | FileCheck -allow-deprecated-dag-overlap %s
; RUN: %if ptxas %{ llc < %s -march=nvptx64 -mcpu=sm_35 -O0 -verify-machineinstrs | %ptxas-verify %}
%s_i8i16p = type { <{ i16, i8, i16 }>, i64 }
%s_i8i32p = type { <{ i32, i8, i32 }>, i64 }
%s_i8i64p = type { <{ i64, i8, i64 }>, i64 }
%s_i8f16p = type { <{ half, i8, half }>, i64 }
%s_i8f16x2p = type { <{ <2 x half>, i8, <2 x half> }>, i64 }
%s_i8f32p = type { <{ float, i8, float }>, i64 }
%s_i8f64p = type { <{ double, i8, double }>, i64 }
; -- All loads/stores from parameters aligned by one must be done one
; byte at a time.
; -- Notes:
; -- There are two fields of interest in the packed part of the struct, one
; with a proper offset and one without. The former should be loaded or
; stored as a whole, and the latter by bytes.
; -- Only loading and storing the said fields are checked in the following
; series of tests so that they are more concise.
; CHECK: .visible .func (.param .align 8 .b8 func_retval0[16])
; CHECK-LABEL: test_s_i8i16p(
; CHECK: .param .align 8 .b8 test_s_i8i16p_param_0[16]
; CHECK-DAG: ld.param.u16 [[P0:%rs[0-9]+]], [test_s_i8i16p_param_0];
; CHECK-DAG: ld.param.u8 [[P2_0:%rs[0-9]+]], [test_s_i8i16p_param_0+3];
; CHECK-DAG: ld.param.u8 [[P2_1:%rs[0-9]+]], [test_s_i8i16p_param_0+4];
; CHECK-DAG: shl.b16 [[P2_1_shl:%rs[0-9]+]], [[P2_1]], 8;
; CHECK-DAG: or.b16 [[P2_1_or:%rs[0-9]+]], [[P2_1_shl]], [[P2_0]];
; CHECK: { // callseq
; CHECK: .param .align 8 .b8 param0[16];
; CHECK-DAG: st.param.b16 [param0+0], [[P0]];
; CHECK-DAG: st.param.b8 [param0+3], [[P2_1_or]];
; CHECK-DAG: st.param.b8 [param0+4], [[P2_1]];
; CHECK: .param .align 8 .b8 retval0[16];
; CHECK-NEXT: call.uni (retval0),
; CHECK-NEXT: test_s_i8i16p,
; CHECK-NEXT: (
; CHECK-NEXT: param0
; CHECK-NEXT: );
; CHECK-DAG: ld.param.b16 [[R0:%rs[0-9]+]], [retval0+0];
; CHECK-DAG: ld.param.b8 [[R2_0:%rs[0-9]+]], [retval0+3];
; CHECK-DAG: ld.param.b8 [[R2_1:%rs[0-9]+]], [retval0+4];
; CHECK: } // callseq
; CHECK-DAG: st.param.b16 [func_retval0+0], [[R0]];
; CHECK-DAG: shl.b16 [[R2_1_shl:%rs[0-9]+]], [[R2_1]], 8;
; CHECK-DAG: and.b16 [[R2_0_and:%rs[0-9]+]], [[R2_0]], 255;
; CHECK-DAG: or.b16 [[R2:%rs[0-9]+]], [[R2_0_and]], [[R2_1_shl]];
; CHECK-DAG: st.param.b8 [func_retval0+3], [[R2]];
; CHECK-DAG: and.b16 [[R2_1_and:%rs[0-9]+]], [[R2_1]], 255;
; CHECK-DAG: st.param.b8 [func_retval0+4], [[R2_1_and]];
; CHECK: ret;
define %s_i8i16p @test_s_i8i16p(%s_i8i16p %a) {
%r = tail call %s_i8i16p @test_s_i8i16p(%s_i8i16p %a)
ret %s_i8i16p %r
}
; CHECK: .visible .func (.param .align 8 .b8 func_retval0[24])
; CHECK-LABEL: test_s_i8i32p(
; CHECK: .param .align 8 .b8 test_s_i8i32p_param_0[24]
; CHECK-DAG: ld.param.u32 [[P0:%r[0-9]+]], [test_s_i8i32p_param_0];
; CHECK-DAG: ld.param.u8 [[P2_0:%r[0-9]+]], [test_s_i8i32p_param_0+5];
; CHECK-DAG: ld.param.u8 [[P2_1:%r[0-9]+]], [test_s_i8i32p_param_0+6];
; CHECK-DAG: ld.param.u8 [[P2_2:%r[0-9]+]], [test_s_i8i32p_param_0+7];
; CHECK-DAG: ld.param.u8 [[P2_3:%r[0-9]+]], [test_s_i8i32p_param_0+8];
; CHECK-DAG: shl.b32 [[P2_1_shl:%r[0-9]+]], [[P2_1]], 8;
; CHECK-DAG: shl.b32 [[P2_2_shl:%r[0-9]+]], [[P2_2]], 16;
; CHECK-DAG: shl.b32 [[P2_3_shl:%r[0-9]+]], [[P2_3]], 24;
; CHECK-DAG: or.b32 [[P2_or:%r[0-9]+]], [[P2_1_shl]], [[P2_0]];
; CHECK-DAG: or.b32 [[P2_or_1:%r[0-9]+]], [[P2_3_shl]], [[P2_2_shl]];
; CHECK-DAG: or.b32 [[P2:%r[0-9]+]], [[P2_or_1]], [[P2_or]];
; CHECK-DAG: shr.u32 [[P2_1_shr:%r[0-9]+]], [[P2]], 8;
; CHECK-DAG: shr.u32 [[P2_2_shr:%r[0-9]+]], [[P2_or_1]], 16;
; CHECK: { // callseq
; CHECK-DAG: .param .align 8 .b8 param0[24];
; CHECK-DAG: st.param.b32 [param0+0], [[P0]];
; CHECK-DAG: st.param.b8 [param0+5], [[P2]];
; CHECK-DAG: st.param.b8 [param0+6], [[P2_1_shr]];
; CHECK-DAG: st.param.b8 [param0+7], [[P2_2_shr]];
; CHECK-DAG: st.param.b8 [param0+8], [[P2_3]];
; CHECK: .param .align 8 .b8 retval0[24];
; CHECK-NEXT: call.uni (retval0),
; CHECK-NEXT: test_s_i8i32p,
; CHECK-NEXT: (
; CHECK-NEXT: param0
; CHECK-NEXT: );
; CHECK-DAG: ld.param.b32 [[R0:%r[0-9]+]], [retval0+0];
; CHECK-DAG: ld.param.b8 [[R2_0:%rs[0-9]+]], [retval0+5];
; CHECK-DAG: ld.param.b8 [[R2_1:%rs[0-9]+]], [retval0+6];
; CHECK-DAG: ld.param.b8 [[R2_2:%rs[0-9]+]], [retval0+7];
; CHECK-DAG: ld.param.b8 [[R2_3:%rs[0-9]+]], [retval0+8];
; CHECK: } // callseq
; CHECK-DAG: st.param.b32 [func_retval0+0], [[R0]];
; CHECK-DAG: st.param.b8 [func_retval0+5],
; CHECK-DAG: st.param.b8 [func_retval0+6],
; CHECK-DAG: st.param.b8 [func_retval0+7],
; CHECK-DAG: st.param.b8 [func_retval0+8],
; CHECK: ret;
define %s_i8i32p @test_s_i8i32p(%s_i8i32p %a) {
%r = tail call %s_i8i32p @test_s_i8i32p(%s_i8i32p %a)
ret %s_i8i32p %r
}
; CHECK: .visible .func (.param .align 8 .b8 func_retval0[32])
; CHECK-LABEL: test_s_i8i64p(
; CHECK: .param .align 8 .b8 test_s_i8i64p_param_0[32]
; CHECK-DAG: ld.param.u64 [[P0:%rd[0-9]+]], [test_s_i8i64p_param_0];
; CHECK-DAG: ld.param.u8 [[P2_0:%rd[0-9]+]], [test_s_i8i64p_param_0+9];
; CHECK-DAG: ld.param.u8 [[P2_1:%rd[0-9]+]], [test_s_i8i64p_param_0+10];
; CHECK-DAG: ld.param.u8 [[P2_2:%rd[0-9]+]], [test_s_i8i64p_param_0+11];
; CHECK-DAG: ld.param.u8 [[P2_3:%rd[0-9]+]], [test_s_i8i64p_param_0+12];
; CHECK-DAG: ld.param.u8 [[P2_4:%rd[0-9]+]], [test_s_i8i64p_param_0+13];
; CHECK-DAG: ld.param.u8 [[P2_5:%rd[0-9]+]], [test_s_i8i64p_param_0+14];
; CHECK-DAG: ld.param.u8 [[P2_6:%rd[0-9]+]], [test_s_i8i64p_param_0+15];
; CHECK-DAG: ld.param.u8 [[P2_7:%rd[0-9]+]], [test_s_i8i64p_param_0+16];
; CHECK-DAG: shl.b64 [[P2_1_shl:%rd[0-9]+]], [[P2_1]], 8;
; CHECK-DAG: shl.b64 [[P2_2_shl:%rd[0-9]+]], [[P2_2]], 16;
; CHECK-DAG: shl.b64 [[P2_3_shl:%rd[0-9]+]], [[P2_3]], 24;
; CHECK-DAG: or.b64 [[P2_or_0:%rd[0-9]+]], [[P2_1_shl]], [[P2_0]];
; CHECK-DAG: or.b64 [[P2_or_1:%rd[0-9]+]], [[P2_3_shl]], [[P2_2_shl]];
; CHECK-DAG: or.b64 [[P2_or_2:%rd[0-9]+]], [[P2_or_1]], [[P2_or_0]];
; CHECK-DAG: shl.b64 [[P2_5_shl:%rd[0-9]+]], [[P2_5]], 8;
; CHECK-DAG: shl.b64 [[P2_6_shl:%rd[0-9]+]], [[P2_6]], 16;
; CHECK-DAG: shl.b64 [[P2_7_shl:%rd[0-9]+]], [[P2_7]], 24;
; CHECK-DAG: or.b64 [[P2_or_3:%rd[0-9]+]], [[P2_5_shl]], [[P2_4]];
; CHECK-DAG: or.b64 [[P2_or_4:%rd[0-9]+]], [[P2_7_shl]], [[P2_6_shl]];
; CHECK-DAG: or.b64 [[P2_or_5:%rd[0-9]+]], [[P2_or_4]], [[P2_or_3]];
; CHECK-DAG: shl.b64 [[P2_or_shl:%rd[0-9]+]], [[P2_or_5]], 32;
; CHECK-DAG: or.b64 [[P2:%rd[0-9]+]], [[P2_or_shl]], [[P2_or_2]];
; CHECK-DAG: shr.u64 [[P2_shr_1:%rd[0-9]+]], [[P2]], 8;
; CHECK-DAG: shr.u64 [[P2_shr_2:%rd[0-9]+]], [[P2]], 16;
; CHECK-DAG: shr.u64 [[P2_shr_3:%rd[0-9]+]], [[P2]], 24;
; CHECK-DAG: bfe.u64 [[P2_bfe_4:%rd[0-9]+]], [[P2_or_5]], 8, 24;
; CHECK-DAG: bfe.u64 [[P2_bfe_5:%rd[0-9]+]], [[P2_or_5]], 16, 16;
; CHECK-DAG: bfe.u64 [[P2_bfe_6:%rd[0-9]+]], [[P2_or_5]], 24, 8;
; CHECK: { // callseq
; CHECK: .param .align 8 .b8 param0[32];
; CHECK-DAG: st.param.b64 [param0+0], [[P0]];
; CHECK-DAG: st.param.b8 [param0+9], [[P2]];
; CHECK-DAG: st.param.b8 [param0+10], [[P2_shr_1]];
; CHECK-DAG: st.param.b8 [param0+11], [[P2_shr_2]];
; CHECK-DAG: st.param.b8 [param0+12], [[P2_shr_3]];
; CHECK-DAG: st.param.b8 [param0+13], [[P2_or_5]];
; CHECK-DAG: st.param.b8 [param0+14], [[P2_bfe_4]];
; CHECK-DAG: st.param.b8 [param0+15], [[P2_bfe_5]];
; CHECK-DAG: st.param.b8 [param0+16], [[P2_bfe_6]];
; CHECK: .param .align 8 .b8 retval0[32];
; CHECK-NEXT: call.uni (retval0),
; CHECK-NEXT: test_s_i8i64p,
; CHECK-NEXT: (
; CHECK-NEXT: param0
; CHECK-NEXT: );
; CHECK-DAG: ld.param.b64 [[R0:%rd[0-9]+]], [retval0+0];
; CHECK-DAG: ld.param.b8 [[R2_0:%rs[0-9]+]], [retval0+9];
; CHECK-DAG: ld.param.b8 [[R2_1:%rs[0-9]+]], [retval0+10];
; CHECK-DAG: ld.param.b8 [[R2_2:%rs[0-9]+]], [retval0+11];
; CHECK-DAG: ld.param.b8 [[R2_3:%rs[0-9]+]], [retval0+12];
; CHECK-DAG: ld.param.b8 [[R2_4:%rs[0-9]+]], [retval0+13];
; CHECK-DAG: ld.param.b8 [[R2_5:%rs[0-9]+]], [retval0+14];
; CHECK-DAG: ld.param.b8 [[R2_6:%rs[0-9]+]], [retval0+15];
; CHECK-DAG: ld.param.b8 [[R2_7:%rs[0-9]+]], [retval0+16];
; CHECK: } // callseq
; CHECK-DAG: st.param.b64 [func_retval0+0], [[R0]];
; CHECK-DAG: st.param.b8 [func_retval0+9],
; CHECK-DAG: st.param.b8 [func_retval0+10],
; CHECK-DAG: st.param.b8 [func_retval0+11],
; CHECK-DAG: st.param.b8 [func_retval0+12],
; CHECK-DAG: st.param.b8 [func_retval0+13],
; CHECK-DAG: st.param.b8 [func_retval0+14],
; CHECK-DAG: st.param.b8 [func_retval0+15],
; CHECK-DAG: st.param.b8 [func_retval0+16],
; CHECK: ret;
define %s_i8i64p @test_s_i8i64p(%s_i8i64p %a) {
%r = tail call %s_i8i64p @test_s_i8i64p(%s_i8i64p %a)
ret %s_i8i64p %r
}
; CHECK: .visible .func (.param .align 8 .b8 func_retval0[16])
; CHECK-LABEL: test_s_i8f16p(
; CHECK: .param .align 8 .b8 test_s_i8f16p_param_0[16]
; CHECK-DAG: ld.param.b16 [[P0:%rs[0-9]+]], [test_s_i8f16p_param_0];
; CHECK-DAG: ld.param.u8 [[P2_0:%rs[0-9]+]], [test_s_i8f16p_param_0+3];
; CHECK-DAG: ld.param.u8 [[P2_1:%rs[0-9]+]], [test_s_i8f16p_param_0+4];
; CHECK-DAG: shl.b16 [[P2_1_shl:%rs[0-9]+]], [[P2_1]], 8;
; CHECK-DAG: or.b16 [[P2_1_or:%rs[0-9]+]], [[P2_1_shl]], [[P2_0]];
; CHECK: { // callseq
; CHECK: .param .align 8 .b8 param0[16];
; CHECK-DAG: st.param.b16 [param0+0], [[P0]];
; CHECK-DAG: st.param.b8 [param0+3], [[P2_1_or]];
; CHECK-DAG: st.param.b8 [param0+4], [[P2_1]];
; CHECK: .param .align 8 .b8 retval0[16];
; CHECK-NEXT: call.uni (retval0),
; CHECK-NEXT: test_s_i8f16p,
; CHECK-NEXT: (
; CHECK-NEXT: param0
; CHECK-NEXT: );
; CHECK-DAG: ld.param.b16 [[R0:%rs[0-9]+]], [retval0+0];
; CHECK-DAG: ld.param.b8 [[R2I_0:%rs[0-9]+]], [retval0+3];
; CHECK-DAG: ld.param.b8 [[R2I_1:%rs[0-9]+]], [retval0+4];
; CHECK: } // callseq
; CHECK-DAG: st.param.b16 [func_retval0+0], [[R0]];
; CHECK-DAG: shl.b16 [[R2I_1_shl:%rs[0-9]+]], [[R2I_1]], 8;
; CHECK-DAG: and.b16 [[R2I_0_and:%rs[0-9]+]], [[R2I_0]], 255;
; CHECK-DAG: or.b16 [[R2I:%rs[0-9]+]], [[R2I_0_and]], [[R2I_1_shl]];
; CHECK-DAG: st.param.b8 [func_retval0+3], [[R2I]];
; CHECK-DAG: and.b16 [[R2I_1_and:%rs[0-9]+]], [[R2I_1]], 255;
; CHECK-DAG: st.param.b8 [func_retval0+4], [[R2I_1_and]];
; CHECK: ret;
define %s_i8f16p @test_s_i8f16p(%s_i8f16p %a) {
%r = tail call %s_i8f16p @test_s_i8f16p(%s_i8f16p %a)
ret %s_i8f16p %r
}
; CHECK: .visible .func (.param .align 8 .b8 func_retval0[24])
; CHECK-LABEL: test_s_i8f16x2p(
; CHECK: .param .align 8 .b8 test_s_i8f16x2p_param_0[24]
; CHECK-DAG: ld.param.b32 [[P0:%r[0-9]+]], [test_s_i8f16x2p_param_0];
; CHECK-DAG: ld.param.u8 [[P2_0:%r[0-9]+]], [test_s_i8f16x2p_param_0+5];
; CHECK-DAG: ld.param.u8 [[P2_1:%r[0-9]+]], [test_s_i8f16x2p_param_0+6];
; CHECK-DAG: ld.param.u8 [[P2_2:%r[0-9]+]], [test_s_i8f16x2p_param_0+7];
; CHECK-DAG: ld.param.u8 [[P2_3:%r[0-9]+]], [test_s_i8f16x2p_param_0+8];
; CHECK-DAG: shl.b32 [[P2_1_shl:%r[0-9]+]], [[P2_1]], 8;
; CHECK-DAG: shl.b32 [[P2_2_shl:%r[0-9]+]], [[P2_2]], 16;
; CHECK-DAG: shl.b32 [[P2_3_shl:%r[0-9]+]], [[P2_3]], 24;
; CHECK-DAG: or.b32 [[P2_or:%r[0-9]+]], [[P2_1_shl]], [[P2_0]];
; CHECK-DAG: or.b32 [[P2_or_1:%r[0-9]+]], [[P2_3_shl]], [[P2_2_shl]];
; CHECK-DAG: or.b32 [[P2:%r[0-9]+]], [[P2_or_1]], [[P2_or]];
; CHECK-DAG: shr.u32 [[P2_1_shr:%r[0-9]+]], [[P2]], 8;
; CHECK-DAG: shr.u32 [[P2_2_shr:%r[0-9]+]], [[P2_or_1]], 16;
; CHECK: { // callseq
; CHECK-DAG: .param .align 8 .b8 param0[24];
; CHECK-DAG: st.param.b32 [param0+0], [[P0]];
; CHECK-DAG: st.param.b8 [param0+5], [[P2]];
; CHECK-DAG: st.param.b8 [param0+6], [[P2_1_shr]];
; CHECK-DAG: st.param.b8 [param0+7], [[P2_2_shr]];
; CHECK-DAG: st.param.b8 [param0+8], [[P2_3]];
; CHECK: .param .align 8 .b8 retval0[24];
; CHECK-NEXT: call.uni (retval0),
; CHECK-NEXT: test_s_i8f16x2p,
; CHECK-NEXT: (
; CHECK-NEXT: param0
; CHECK-NEXT: );
; CHECK-DAG: ld.param.b32 [[R0:%r[0-9]+]], [retval0+0];
; CHECK-DAG: ld.param.b8 [[R2_0:%rs[0-9]+]], [retval0+5];
; CHECK-DAG: ld.param.b8 [[R2_1:%rs[0-9]+]], [retval0+6];
; CHECK-DAG: ld.param.b8 [[R2_2:%rs[0-9]+]], [retval0+7];
; CHECK-DAG: ld.param.b8 [[R2_3:%rs[0-9]+]], [retval0+8];
; CHECK: } // callseq
; CHECK-DAG: st.param.b32 [func_retval0+0], [[R0]];
; CHECK-DAG: st.param.b8 [func_retval0+5],
; CHECK-DAG: st.param.b8 [func_retval0+6],
; CHECK-DAG: st.param.b8 [func_retval0+7],
; CHECK-DAG: st.param.b8 [func_retval0+8],
; CHECK: ret;
define %s_i8f16x2p @test_s_i8f16x2p(%s_i8f16x2p %a) {
%r = tail call %s_i8f16x2p @test_s_i8f16x2p(%s_i8f16x2p %a)
ret %s_i8f16x2p %r
}
; CHECK: .visible .func (.param .align 8 .b8 func_retval0[24])
; CHECK-LABEL: test_s_i8f32p(
; CHECK: .param .align 8 .b8 test_s_i8f32p_param_0[24]
; CHECK-DAG: ld.param.f32 [[P0:%f[0-9]+]], [test_s_i8f32p_param_0];
; CHECK-DAG: ld.param.u8 [[P2_0:%r[0-9]+]], [test_s_i8f32p_param_0+5];
; CHECK-DAG: ld.param.u8 [[P2_1:%r[0-9]+]], [test_s_i8f32p_param_0+6];
; CHECK-DAG: ld.param.u8 [[P2_2:%r[0-9]+]], [test_s_i8f32p_param_0+7];
; CHECK-DAG: ld.param.u8 [[P2_3:%r[0-9]+]], [test_s_i8f32p_param_0+8];
; CHECK-DAG: shl.b32 [[P2_1_shl:%r[0-9]+]], [[P2_1]], 8;
; CHECK-DAG: shl.b32 [[P2_2_shl:%r[0-9]+]], [[P2_2]], 16;
; CHECK-DAG: shl.b32 [[P2_3_shl:%r[0-9]+]], [[P2_3]], 24;
; CHECK-DAG: or.b32 [[P2_or:%r[0-9]+]], [[P2_1_shl]], [[P2_0]];
; CHECK-DAG: or.b32 [[P2_or_1:%r[0-9]+]], [[P2_3_shl]], [[P2_2_shl]];
; CHECK-DAG: or.b32 [[P2:%r[0-9]+]], [[P2_or_1]], [[P2_or]];
; CHECK-DAG: shr.u32 [[P2_1_shr:%r[0-9]+]], [[P2]], 8;
; CHECK-DAG: shr.u32 [[P2_2_shr:%r[0-9]+]], [[P2_or_1]], 16;
; CHECK: { // callseq
; CHECK-DAG: .param .align 8 .b8 param0[24];
; CHECK-DAG: st.param.f32 [param0+0], [[P0]];
; CHECK-DAG: st.param.b8 [param0+5], [[P2]];
; CHECK-DAG: st.param.b8 [param0+6], [[P2_1_shr]];
; CHECK-DAG: st.param.b8 [param0+7], [[P2_2_shr]];
; CHECK-DAG: st.param.b8 [param0+8], [[P2_3]];
; CHECK: .param .align 8 .b8 retval0[24];
; CHECK-NEXT: call.uni (retval0),
; CHECK-NEXT: test_s_i8f32p,
; CHECK-NEXT: (
; CHECK-NEXT: param0
; CHECK-NEXT: );
; CHECK-DAG: ld.param.f32 [[R0:%f[0-9]+]], [retval0+0];
; CHECK-DAG: ld.param.b8 [[R2_0:%rs[0-9]+]], [retval0+5];
; CHECK-DAG: ld.param.b8 [[R2_1:%rs[0-9]+]], [retval0+6];
; CHECK-DAG: ld.param.b8 [[R2_2:%rs[0-9]+]], [retval0+7];
; CHECK-DAG: ld.param.b8 [[R2_3:%rs[0-9]+]], [retval0+8];
; CHECK: } // callseq
; CHECK-DAG: st.param.f32 [func_retval0+0], [[R0]];
; CHECK-DAG: st.param.b8 [func_retval0+5],
; CHECK-DAG: st.param.b8 [func_retval0+6],
; CHECK-DAG: st.param.b8 [func_retval0+7],
; CHECK-DAG: st.param.b8 [func_retval0+8],
; CHECK: ret;
define %s_i8f32p @test_s_i8f32p(%s_i8f32p %a) {
%r = tail call %s_i8f32p @test_s_i8f32p(%s_i8f32p %a)
ret %s_i8f32p %r
}
; CHECK: .visible .func (.param .align 8 .b8 func_retval0[32])
; CHECK-LABEL: test_s_i8f64p(
; CHECK: .param .align 8 .b8 test_s_i8f64p_param_0[32]
; CHECK-DAG: ld.param.f64 [[P0:%fd[0-9]+]], [test_s_i8f64p_param_0];
; CHECK-DAG: ld.param.u8 [[P2_0:%rd[0-9]+]], [test_s_i8f64p_param_0+9];
; CHECK-DAG: ld.param.u8 [[P2_1:%rd[0-9]+]], [test_s_i8f64p_param_0+10];
; CHECK-DAG: ld.param.u8 [[P2_2:%rd[0-9]+]], [test_s_i8f64p_param_0+11];
; CHECK-DAG: ld.param.u8 [[P2_3:%rd[0-9]+]], [test_s_i8f64p_param_0+12];
; CHECK-DAG: ld.param.u8 [[P2_4:%rd[0-9]+]], [test_s_i8f64p_param_0+13];
; CHECK-DAG: ld.param.u8 [[P2_5:%rd[0-9]+]], [test_s_i8f64p_param_0+14];
; CHECK-DAG: ld.param.u8 [[P2_6:%rd[0-9]+]], [test_s_i8f64p_param_0+15];
; CHECK-DAG: ld.param.u8 [[P2_7:%rd[0-9]+]], [test_s_i8f64p_param_0+16];
; CHECK-DAG: shl.b64 [[P2_1_shl:%rd[0-9]+]], [[P2_1]], 8;
; CHECK-DAG: shl.b64 [[P2_2_shl:%rd[0-9]+]], [[P2_2]], 16;
; CHECK-DAG: shl.b64 [[P2_3_shl:%rd[0-9]+]], [[P2_3]], 24;
; CHECK-DAG: or.b64 [[P2_or_0:%rd[0-9]+]], [[P2_1_shl]], [[P2_0]];
; CHECK-DAG: or.b64 [[P2_or_1:%rd[0-9]+]], [[P2_3_shl]], [[P2_2_shl]];
; CHECK-DAG: or.b64 [[P2_or_2:%rd[0-9]+]], [[P2_or_1]], [[P2_or_0]];
; CHECK-DAG: shl.b64 [[P2_5_shl:%rd[0-9]+]], [[P2_5]], 8;
; CHECK-DAG: shl.b64 [[P2_6_shl:%rd[0-9]+]], [[P2_6]], 16;
; CHECK-DAG: shl.b64 [[P2_7_shl:%rd[0-9]+]], [[P2_7]], 24;
; CHECK-DAG: or.b64 [[P2_or_3:%rd[0-9]+]], [[P2_5_shl]], [[P2_4]];
; CHECK-DAG: or.b64 [[P2_or_4:%rd[0-9]+]], [[P2_7_shl]], [[P2_6_shl]];
; CHECK-DAG: or.b64 [[P2_or_5:%rd[0-9]+]], [[P2_or_4]], [[P2_or_3]];
; CHECK-DAG: shl.b64 [[P2_or_shl:%rd[0-9]+]], [[P2_or_5]], 32;
; CHECK-DAG: or.b64 [[P2:%rd[0-9]+]], [[P2_or_shl]], [[P2_or_2]];
; CHECK-DAG: shr.u64 [[P2_shr_1:%rd[0-9]+]], [[P2]], 8;
; CHECK-DAG: shr.u64 [[P2_shr_2:%rd[0-9]+]], [[P2]], 16;
; CHECK-DAG: shr.u64 [[P2_shr_3:%rd[0-9]+]], [[P2]], 24;
; CHECK-DAG: bfe.u64 [[P2_bfe_4:%rd[0-9]+]], [[P2_or_5]], 8, 24;
; CHECK-DAG: bfe.u64 [[P2_bfe_5:%rd[0-9]+]], [[P2_or_5]], 16, 16;
; CHECK-DAG: bfe.u64 [[P2_bfe_6:%rd[0-9]+]], [[P2_or_5]], 24, 8;
; CHECK: { // callseq
; CHECK: .param .align 8 .b8 param0[32];
; CHECK-DAG: st.param.f64 [param0+0], [[P0]];
; CHECK-DAG: st.param.b8 [param0+9], [[P2]];
; CHECK-DAG: st.param.b8 [param0+10], [[P2_shr_1]];
; CHECK-DAG: st.param.b8 [param0+11], [[P2_shr_2]];
; CHECK-DAG: st.param.b8 [param0+12], [[P2_shr_3]];
; CHECK-DAG: st.param.b8 [param0+13], [[P2_or_5]];
; CHECK-DAG: st.param.b8 [param0+14], [[P2_bfe_4]];
; CHECK-DAG: st.param.b8 [param0+15], [[P2_bfe_5]];
; CHECK-DAG: st.param.b8 [param0+16], [[P2_bfe_6]];
; CHECK: .param .align 8 .b8 retval0[32];
; CHECK-NEXT: call.uni (retval0),
; CHECK-NEXT: test_s_i8f64p,
; CHECK-NEXT: (
; CHECK-NEXT: param0
; CHECK-NEXT: );
; CHECK-DAG: ld.param.f64 [[R0:%fd[0-9]+]], [retval0+0];
; CHECK-DAG: ld.param.b8 [[R2_0:%rs[0-9]+]], [retval0+9];
; CHECK-DAG: ld.param.b8 [[R2_1:%rs[0-9]+]], [retval0+10];
; CHECK-DAG: ld.param.b8 [[R2_2:%rs[0-9]+]], [retval0+11];
; CHECK-DAG: ld.param.b8 [[R2_3:%rs[0-9]+]], [retval0+12];
; CHECK-DAG: ld.param.b8 [[R2_4:%rs[0-9]+]], [retval0+13];
; CHECK-DAG: ld.param.b8 [[R2_5:%rs[0-9]+]], [retval0+14];
; CHECK-DAG: ld.param.b8 [[R2_6:%rs[0-9]+]], [retval0+15];
; CHECK-DAG: ld.param.b8 [[R2_7:%rs[0-9]+]], [retval0+16];
; CHECK: } // callseq
; CHECK-DAG: st.param.f64 [func_retval0+0], [[R0]];
; CHECK-DAG: st.param.b8 [func_retval0+9],
; CHECK-DAG: st.param.b8 [func_retval0+10],
; CHECK-DAG: st.param.b8 [func_retval0+11],
; CHECK-DAG: st.param.b8 [func_retval0+12],
; CHECK-DAG: st.param.b8 [func_retval0+13],
; CHECK-DAG: st.param.b8 [func_retval0+14],
; CHECK-DAG: st.param.b8 [func_retval0+15],
; CHECK-DAG: st.param.b8 [func_retval0+16],
; CHECK: ret;
define %s_i8f64p @test_s_i8f64p(%s_i8f64p %a) {
%r = tail call %s_i8f64p @test_s_i8f64p(%s_i8f64p %a)
ret %s_i8f64p %r
}
|