1 ; RUN: llc < %s -mtriple=i686-apple-darwin -mcpu=knl | FileCheck -check-prefix=X32 %s
2 ; RUN: llc < %s -mtriple=i386-pc-win32 -mcpu=knl | FileCheck -check-prefix=X32 %s
3 ; RUN: llc < %s -mtriple=x86_64-win32 -mcpu=knl | FileCheck -check-prefix=WIN64 %s
4 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=knl | FileCheck -check-prefix=X64 %s
6 declare <16 x float> @func_float16_ptr(<16 x float>, <16 x float> *)
7 declare <16 x float> @func_float16(<16 x float>, <16 x float>)
8 declare i32 @func_int(i32, i32)
10 ; WIN64-LABEL: testf16_inp
11 ; WIN64: vaddps {{.*}}, {{%zmm[0-1]}}
12 ; WIN64: leaq {{.*}}(%rsp), %rcx
16 ; X32-LABEL: testf16_inp
17 ; X32: vaddps {{.*}}, {{%zmm[0-1]}}
18 ; X32: movl %eax, (%esp)
22 ; X64-LABEL: testf16_inp
23 ; X64: vaddps {{.*}}, {{%zmm[0-1]}}
24 ; X64: leaq {{.*}}(%rsp), %rdi
28 ;test calling conventions - input parameters
29 define <16 x float> @testf16_inp(<16 x float> %a, <16 x float> %b) nounwind {
30 %y = alloca <16 x float>, align 16
31 %x = fadd <16 x float> %a, %b
32 %1 = call intel_ocl_bicc <16 x float> @func_float16_ptr(<16 x float> %x, <16 x float>* %y)
33 %2 = load <16 x float>, <16 x float>* %y, align 16
34 %3 = fadd <16 x float> %2, %1
38 ;test calling conventions - preserved registers
41 ; WIN64-LABEL: testf16_regs
43 ; WIN64: vaddps %zmm16, %zmm0, %zmm0
47 ; X64-LABEL: testf16_regs
49 ; X64: vaddps %zmm16, %zmm0, %zmm0
52 define <16 x float> @testf16_regs(<16 x float> %a, <16 x float> %b) nounwind {
53 %y = alloca <16 x float>, align 16
54 %x = fadd <16 x float> %a, %b
55 %1 = call intel_ocl_bicc <16 x float> @func_float16_ptr(<16 x float> %x, <16 x float>* %y)
56 %2 = load <16 x float>, <16 x float>* %y, align 16
57 %3 = fadd <16 x float> %1, %b
58 %4 = fadd <16 x float> %2, %3
62 ; test calling conventions - prolog and epilog
63 ; WIN64-LABEL: test_prolog_epilog
64 ; WIN64: vmovups %zmm21, {{.*(%rbp).*}} # 64-byte Spill
65 ; WIN64: vmovups %zmm6, {{.*(%rbp).*}} # 64-byte Spill
67 ; WIN64: vmovups {{.*(%rbp).*}}, %zmm6 # 64-byte Reload
68 ; WIN64: vmovups {{.*(%rbp).*}}, %zmm21 # 64-byte Reload
70 ; X64-LABEL: test_prolog_epilog
71 ; X64: kmovw %k7, {{.*}}(%rsp) ## 8-byte Folded Spill
72 ; X64: kmovw %k6, {{.*}}(%rsp) ## 8-byte Folded Spill
73 ; X64: kmovw %k5, {{.*}}(%rsp) ## 8-byte Folded Spill
74 ; X64: kmovw %k4, {{.*}}(%rsp) ## 8-byte Folded Spill
75 ; X64: vmovups %zmm31, {{.*}}(%rsp) ## 64-byte Spill
76 ; X64: vmovups %zmm16, {{.*}}(%rsp) ## 64-byte Spill
78 ; X64: vmovups {{.*}}(%rsp), %zmm16 ## 64-byte Reload
79 ; X64: vmovups {{.*}}(%rsp), %zmm31 ## 64-byte Reload
80 define intel_ocl_bicc <16 x float> @test_prolog_epilog(<16 x float> %a, <16 x float> %b) nounwind {
81 %c = call <16 x float> @func_float16(<16 x float> %a, <16 x float> %b)
86 declare <16 x float> @func_float16_mask(<16 x float>, <16 x i1>)
88 ; X64-LABEL: testf16_inp_mask
89 ; X64: kmovw %edi, %k1
91 define <16 x float> @testf16_inp_mask(<16 x float> %a, i16 %mask) {
92 %imask = bitcast i16 %mask to <16 x i1>
93 %1 = call intel_ocl_bicc <16 x float> @func_float16_mask(<16 x float> %a, <16 x i1> %imask)
97 ; X64-LABEL: test_prolog_epilog_with_mask
98 ; X64: kxorw %k{{.*}}, %k{{.*}}, %k1
100 define intel_ocl_bicc <16 x float> @test_prolog_epilog_with_mask(<16 x float> %a, <16 x i32> %x1, <16 x i32>%x2, <16 x i1> %mask) nounwind {
101 %cmp_res = icmp eq <16 x i32>%x1, %x2
102 %mask1 = xor <16 x i1> %cmp_res, %mask
103 %c = call intel_ocl_bicc <16 x float> @func_float16_mask(<16 x float> %a, <16 x i1>%mask1)