• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=knl -mattr=+avx512bw| FileCheck %s
2
3; CHECK-LABEL: vpaddb512_test
4; CHECK: vpaddb %zmm{{.*}}
5; CHECK: ret
6define <64 x i8> @vpaddb512_test(<64 x i8> %i, <64 x i8> %j) nounwind readnone {
7  %x = add <64 x i8> %i, %j
8  ret <64 x i8> %x
9}
10
11; CHECK-LABEL: vpaddb512_fold_test
12; CHECK: vpaddb (%rdi), %zmm{{.*}}
13; CHECK: ret
14define <64 x i8> @vpaddb512_fold_test(<64 x i8> %i, <64 x i8>* %j) nounwind {
15  %tmp = load <64 x i8>, <64 x i8>* %j, align 4
16  %x = add <64 x i8> %i, %tmp
17  ret <64 x i8> %x
18}
19
20; CHECK-LABEL: vpaddw512_test
21; CHECK: vpaddw %zmm{{.*}}
22; CHECK: ret
23define <32 x i16> @vpaddw512_test(<32 x i16> %i, <32 x i16> %j) nounwind readnone {
24  %x = add <32 x i16> %i, %j
25  ret <32 x i16> %x
26}
27
28; CHECK-LABEL: vpaddw512_fold_test
29; CHECK: vpaddw (%rdi), %zmm{{.*}}
30; CHECK: ret
31define <32 x i16> @vpaddw512_fold_test(<32 x i16> %i, <32 x i16>* %j) nounwind {
32  %tmp = load <32 x i16>, <32 x i16>* %j, align 4
33  %x = add <32 x i16> %i, %tmp
34  ret <32 x i16> %x
35}
36
37; CHECK-LABEL: vpaddw512_mask_test
38; CHECK: vpaddw %zmm{{.*%k[1-7].*}}
39; CHECK: ret
40define <32 x i16> @vpaddw512_mask_test(<32 x i16> %i, <32 x i16> %j, <32 x i16> %mask1) nounwind readnone {
41  %mask = icmp ne <32 x i16> %mask1, zeroinitializer
42  %x = add <32 x i16> %i, %j
43  %r = select <32 x i1> %mask, <32 x i16> %x, <32 x i16> %i
44  ret <32 x i16> %r
45}
46
47; CHECK-LABEL: vpaddw512_maskz_test
48; CHECK: vpaddw %zmm{{.*{%k[1-7]} {z}.*}}
49; CHECK: ret
50define <32 x i16> @vpaddw512_maskz_test(<32 x i16> %i, <32 x i16> %j, <32 x i16> %mask1) nounwind readnone {
51  %mask = icmp ne <32 x i16> %mask1, zeroinitializer
52  %x = add <32 x i16> %i, %j
53  %r = select <32 x i1> %mask, <32 x i16> %x, <32 x i16> zeroinitializer
54  ret <32 x i16> %r
55}
56
57; CHECK-LABEL: vpaddw512_mask_fold_test
58; CHECK: vpaddw (%rdi), %zmm{{.*%k[1-7]}}
59; CHECK: ret
60define <32 x i16> @vpaddw512_mask_fold_test(<32 x i16> %i, <32 x i16>* %j.ptr, <32 x i16> %mask1) nounwind readnone {
61  %mask = icmp ne <32 x i16> %mask1, zeroinitializer
62  %j = load <32 x i16>, <32 x i16>* %j.ptr
63  %x = add <32 x i16> %i, %j
64  %r = select <32 x i1> %mask, <32 x i16> %x, <32 x i16> %i
65  ret <32 x i16> %r
66}
67
68; CHECK-LABEL: vpaddw512_maskz_fold_test
69; CHECK: vpaddw (%rdi), %zmm{{.*{%k[1-7]} {z}}}
70; CHECK: ret
71define <32 x i16> @vpaddw512_maskz_fold_test(<32 x i16> %i, <32 x i16>* %j.ptr, <32 x i16> %mask1) nounwind readnone {
72  %mask = icmp ne <32 x i16> %mask1, zeroinitializer
73  %j = load <32 x i16>, <32 x i16>* %j.ptr
74  %x = add <32 x i16> %i, %j
75  %r = select <32 x i1> %mask, <32 x i16> %x, <32 x i16> zeroinitializer
76  ret <32 x i16> %r
77}
78
79; CHECK-LABEL: vpsubb512_test
80; CHECK: vpsubb %zmm{{.*}}
81; CHECK: ret
82define <64 x i8> @vpsubb512_test(<64 x i8> %i, <64 x i8> %j) nounwind readnone {
83  %x = sub <64 x i8> %i, %j
84  ret <64 x i8> %x
85}
86
87; CHECK-LABEL: vpsubw512_test
88; CHECK: vpsubw %zmm{{.*}}
89; CHECK: ret
90define <32 x i16> @vpsubw512_test(<32 x i16> %i, <32 x i16> %j) nounwind readnone {
91  %x = sub <32 x i16> %i, %j
92  ret <32 x i16> %x
93}
94
95; CHECK-LABEL: vpmullw512_test
96; CHECK: vpmullw %zmm{{.*}}
97; CHECK: ret
98define <32 x i16> @vpmullw512_test(<32 x i16> %i, <32 x i16> %j) {
99  %x = mul <32 x i16> %i, %j
100  ret <32 x i16> %x
101}
102
103