1
- ; RUN: llc < %s -mtriple=i386-pc-win32 -mattr=+avx512bw | FileCheck --check-prefix=X32 %s
2
- ; RUN: llc < %s -mtriple=x86_64-win32 -mattr=+avx512bw | FileCheck --check-prefix=WIN64 %s
3
- ; RUN: llc < %s -mtriple=x86_64-linux-gnu -mattr=+avx512bw | FileCheck --check-prefix=LINUXOSX64 %s
1
+ ; RUN: llc < %s -mtriple=i386-pc-win32 -mattr=+avx512bw | FileCheck --check-prefix=CHECK --check-prefix= X32 %s
2
+ ; RUN: llc < %s -mtriple=x86_64-win32 -mattr=+avx512bw | FileCheck --check-prefix=CHECK --check-prefix=CHECK64 --check-prefix= WIN64 %s
3
+ ; RUN: llc < %s -mtriple=x86_64-linux-gnu -mattr=+avx512bw | FileCheck --check-prefix=CHECK --check-prefix=CHECK64 --check-prefix= LINUXOSX64 %s
4
4
5
5
; X32-LABEL: test_argv64i1:
6
6
; X32: kmovd %edx, %k0
@@ -155,7 +155,7 @@ define x86_regcallcc i64 @test_argv64i1(<64 x i1> %x0, <64 x i1> %x1, <64 x i1>
155
155
; LINUXOSX64: call{{.*}} test_argv64i1
156
156
157
157
; Test regcall when passing arguments of v64i1 type
158
- define x86_regcallcc i64 @caller_argv64i1 () #0 {
158
+ define i64 @caller_argv64i1 () #0 {
159
159
entry:
160
160
%v0 = bitcast i64 4294967298 to <64 x i1 >
161
161
%call = call x86_regcallcc i64 @test_argv64i1 (<64 x i1 > %v0 , <64 x i1 > %v0 , <64 x i1 > %v0 ,
@@ -171,9 +171,9 @@ entry:
171
171
; X32: mov{{.*}} $1, %ecx
172
172
; X32: ret{{.*}}
173
173
174
- ; WIN64 -LABEL: test_retv64i1:
175
- ; WIN64 : mov{{.*}} $4294967298, %rax
176
- ; WIN64 : ret{{.*}}
174
+ ; CHECK64 -LABEL: test_retv64i1:
175
+ ; CHECK64 : mov{{.*}} $4294967298, %rax
176
+ ; CHECK64 : ret{{.*}}
177
177
178
178
; Test regcall when returning v64i1 type
179
179
define x86_regcallcc <64 x i1 > @test_retv64i1 () {
@@ -187,9 +187,164 @@ define x86_regcallcc <64 x i1> @test_retv64i1() {
187
187
; X32: kmov{{.*}} %ecx, %k1
188
188
; X32: kunpckdq %k0, %k1, %k0
189
189
190
+ ; CHECK64-LABEL: caller_retv64i1:
191
+ ; CHECK64: call{{.*}} {{_*}}test_retv64i1
192
+ ; CHECK64: kmovq %rax, %k0
193
+ ; CHECK64: ret{{.*}}
194
+
190
195
; Test regcall when processing result of v64i1 type
191
- define x86_regcallcc <64 x i1 > @caller_retv64i1 () #0 {
196
+ define <64 x i1 > @caller_retv64i1 () #0 {
192
197
entry:
193
198
%call = call x86_regcallcc <64 x i1 > @test_retv64i1 ()
194
199
ret <64 x i1 > %call
195
200
}
201
+
202
+ ; CHECK-LABEL: test_argv32i1:
203
+ ; CHECK: kmovd %edx, %k{{[0-9]+}}
204
+ ; CHECK: kmovd %ecx, %k{{[0-9]+}}
205
+ ; CHECK: kmovd %eax, %k{{[0-9]+}}
206
+ ; CHECK: ret{{l|q}}
207
+
208
+ ; Test regcall when receiving arguments of v32i1 type
209
+ declare i32 @test_argv32i1helper (<32 x i1 > %x0 , <32 x i1 > %x1 , <32 x i1 > %x2 )
210
+ define x86_regcallcc i32 @test_argv32i1 (<32 x i1 > %x0 , <32 x i1 > %x1 , <32 x i1 > %x2 ) {
211
+ entry:
212
+ %res = call i32 @test_argv32i1helper (<32 x i1 > %x0 , <32 x i1 > %x1 , <32 x i1 > %x2 )
213
+ ret i32 %res
214
+ }
215
+
216
+ ; CHECK-LABEL: caller_argv32i1:
217
+ ; CHECK: mov{{.*}} $1, %eax
218
+ ; CHECK: mov{{.*}} $1, %ecx
219
+ ; CHECK: mov{{.*}} $1, %edx
220
+ ; CHECK: call{{.*}} {{_*}}test_argv32i1
221
+
222
+ ; Test regcall when passing arguments of v32i1 type
223
+ define i32 @caller_argv32i1 () #0 {
224
+ entry:
225
+ %v0 = bitcast i32 1 to <32 x i1 >
226
+ %call = call x86_regcallcc i32 @test_argv32i1 (<32 x i1 > %v0 , <32 x i1 > %v0 , <32 x i1 > %v0 )
227
+ ret i32 %call
228
+ }
229
+
230
+ ; CHECK-LABEL: test_retv32i1:
231
+ ; CHECK: movl $1, %eax
232
+ ; CHECK: ret{{l|q}}
233
+
234
+ ; Test regcall when returning v32i1 type
235
+ define x86_regcallcc <32 x i1 > @test_retv32i1 () {
236
+ %a = bitcast i32 1 to <32 x i1 >
237
+ ret <32 x i1 > %a
238
+ }
239
+
240
+ ; CHECK-LABEL: caller_retv32i1:
241
+ ; CHECK: call{{.*}} {{_*}}test_retv32i1
242
+ ; CHECK: incl %eax
243
+
244
+ ; Test regcall when processing result of v32i1 type
245
+ define i32 @caller_retv32i1 () #0 {
246
+ entry:
247
+ %call = call x86_regcallcc <32 x i1 > @test_retv32i1 ()
248
+ %c = bitcast <32 x i1 > %call to i32
249
+ %add = add i32 %c , 1
250
+ ret i32 %add
251
+ }
252
+
253
+ ; CHECK-LABEL: test_argv16i1:
254
+ ; CHECK: kmovw %edx, %k{{[0-9]+}}
255
+ ; CHECK: kmovw %ecx, %k{{[0-9]+}}
256
+ ; CHECK: kmovw %eax, %k{{[0-9]+}}
257
+ ; CHECK: ret{{l|q}}
258
+
259
+ ; Test regcall when receiving arguments of v16i1 type
260
+ declare i16 @test_argv16i1helper (<16 x i1 > %x0 , <16 x i1 > %x1 , <16 x i1 > %x2 )
261
+ define x86_regcallcc i16 @test_argv16i1 (<16 x i1 > %x0 , <16 x i1 > %x1 , <16 x i1 > %x2 ) {
262
+ %res = call i16 @test_argv16i1helper (<16 x i1 > %x0 , <16 x i1 > %x1 , <16 x i1 > %x2 )
263
+ ret i16 %res
264
+ }
265
+
266
+ ; CHECK-LABEL: caller_argv16i1:
267
+ ; CHECK: movl $1, %eax
268
+ ; CHECK: movl $1, %ecx
269
+ ; CHECK: movl $1, %edx
270
+ ; CHECK: call{{l|q}} {{_*}}test_argv16i1
271
+
272
+ ; Test regcall when passing arguments of v16i1 type
273
+ define i16 @caller_argv16i1 () #0 {
274
+ entry:
275
+ %v0 = bitcast i16 1 to <16 x i1 >
276
+ %call = call x86_regcallcc i16 @test_argv16i1 (<16 x i1 > %v0 , <16 x i1 > %v0 , <16 x i1 > %v0 )
277
+ ret i16 %call
278
+ }
279
+
280
+ ; CHECK-LABEL: test_retv16i1:
281
+ ; CHECK: movw $1, %ax
282
+ ; CHECK: ret{{l|q}}
283
+
284
+ ; Test regcall when returning v16i1 type
285
+ define x86_regcallcc <16 x i1 > @test_retv16i1 () {
286
+ %a = bitcast i16 1 to <16 x i1 >
287
+ ret <16 x i1 > %a
288
+ }
289
+
290
+ ; CHECK-LABEL: caller_retv16i1:
291
+ ; CHECK: call{{l|q}} {{_*}}test_retv16i1
292
+ ; CHECK: incl %eax
293
+
294
+ ; Test regcall when processing result of v16i1 type
295
+ define i16 @caller_retv16i1 () #0 {
296
+ entry:
297
+ %call = call x86_regcallcc <16 x i1 > @test_retv16i1 ()
298
+ %c = bitcast <16 x i1 > %call to i16
299
+ %add = add i16 %c , 1
300
+ ret i16 %add
301
+ }
302
+
303
+ ; CHECK-LABEL: test_argv8i1:
304
+ ; CHECK: kmovw %edx, %k{{[0-9]+}}
305
+ ; CHECK: kmovw %ecx, %k{{[0-9]+}}
306
+ ; CHECK: kmovw %eax, %k{{[0-9]+}}
307
+ ; CHECK: ret{{l|q}}
308
+
309
+ ; Test regcall when receiving arguments of v8i1 type
310
+ declare i8 @test_argv8i1helper (<8 x i1 > %x0 , <8 x i1 > %x1 , <8 x i1 > %x2 )
311
+ define x86_regcallcc i8 @test_argv8i1 (<8 x i1 > %x0 , <8 x i1 > %x1 , <8 x i1 > %x2 ) {
312
+ %res = call i8 @test_argv8i1helper (<8 x i1 > %x0 , <8 x i1 > %x1 , <8 x i1 > %x2 )
313
+ ret i8 %res
314
+ }
315
+
316
+ ; CHECK-LABEL: caller_argv8i1:
317
+ ; CHECK: movl $1, %eax
318
+ ; CHECK: movl $1, %ecx
319
+ ; CHECK: movl $1, %edx
320
+ ; CHECK: call{{l|q}} {{_*}}test_argv8i1
321
+
322
+ ; Test regcall when passing arguments of v8i1 type
323
+ define i8 @caller_argv8i1 () #0 {
324
+ entry:
325
+ %v0 = bitcast i8 1 to <8 x i1 >
326
+ %call = call x86_regcallcc i8 @test_argv8i1 (<8 x i1 > %v0 , <8 x i1 > %v0 , <8 x i1 > %v0 )
327
+ ret i8 %call
328
+ }
329
+
330
+ ; CHECK-LABEL: test_retv8i1:
331
+ ; CHECK: movb $1, %al
332
+ ; CHECK: ret{{q|l}}
333
+
334
+ ; Test regcall when returning v8i1 type
335
+ define x86_regcallcc <8 x i1 > @test_retv8i1 () {
336
+ %a = bitcast i8 1 to <8 x i1 >
337
+ ret <8 x i1 > %a
338
+ }
339
+
340
+ ; CHECK-LABEL: caller_retv8i1:
341
+ ; CHECK: call{{l|q}} {{_*}}test_retv8i1
342
+ ; CHECK: kmovw %eax, %k{{[0-9]+}}
343
+ ; CHECK: ret{{l|q}}
344
+
345
+ ; Test regcall when processing result of v8i1 type
346
+ define <8 x i1 > @caller_retv8i1 () #0 {
347
+ entry:
348
+ %call = call x86_regcallcc <8 x i1 > @test_retv8i1 ()
349
+ ret <8 x i1 > %call
350
+ }
0 commit comments