1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512bw,+avx512vl | FileCheck %s
6 define <32 x i8> @vpaddb256_test(<32 x i8> %i, <32 x i8> %j) nounwind readnone {
7 ; CHECK-LABEL: vpaddb256_test:
9 ; CHECK-NEXT: vpaddb %ymm1, %ymm0, %ymm0
11 %x = add <32 x i8> %i, %j
15 define <32 x i8> @vpaddb256_fold_test(<32 x i8> %i, <32 x i8>* %j) nounwind {
16 ; CHECK-LABEL: vpaddb256_fold_test:
18 ; CHECK-NEXT: vpaddb (%rdi), %ymm0, %ymm0
20 %tmp = load <32 x i8>, <32 x i8>* %j, align 4
21 %x = add <32 x i8> %i, %tmp
25 define <16 x i16> @vpaddw256_test(<16 x i16> %i, <16 x i16> %j) nounwind readnone {
26 ; CHECK-LABEL: vpaddw256_test:
28 ; CHECK-NEXT: vpaddw %ymm1, %ymm0, %ymm0
30 %x = add <16 x i16> %i, %j
34 define <16 x i16> @vpaddw256_fold_test(<16 x i16> %i, <16 x i16>* %j) nounwind {
35 ; CHECK-LABEL: vpaddw256_fold_test:
37 ; CHECK-NEXT: vpaddw (%rdi), %ymm0, %ymm0
39 %tmp = load <16 x i16>, <16 x i16>* %j, align 4
40 %x = add <16 x i16> %i, %tmp
44 define <16 x i16> @vpaddw256_mask_test(<16 x i16> %i, <16 x i16> %j, <16 x i16> %mask1) nounwind readnone {
45 ; CHECK-LABEL: vpaddw256_mask_test:
47 ; CHECK-NEXT: vptestmw %ymm2, %ymm2, %k1
48 ; CHECK-NEXT: vpaddw %ymm1, %ymm0, %ymm0 {%k1}
50 %mask = icmp ne <16 x i16> %mask1, zeroinitializer
51 %x = add <16 x i16> %i, %j
52 %r = select <16 x i1> %mask, <16 x i16> %x, <16 x i16> %i
56 define <16 x i16> @vpaddw256_maskz_test(<16 x i16> %i, <16 x i16> %j, <16 x i16> %mask1) nounwind readnone {
57 ; CHECK-LABEL: vpaddw256_maskz_test:
59 ; CHECK-NEXT: vptestmw %ymm2, %ymm2, %k1
60 ; CHECK-NEXT: vpaddw %ymm1, %ymm0, %ymm0 {%k1} {z}
62 %mask = icmp ne <16 x i16> %mask1, zeroinitializer
63 %x = add <16 x i16> %i, %j
64 %r = select <16 x i1> %mask, <16 x i16> %x, <16 x i16> zeroinitializer
68 define <16 x i16> @vpaddw256_mask_fold_test(<16 x i16> %i, <16 x i16>* %j.ptr, <16 x i16> %mask1) nounwind readnone {
69 ; CHECK-LABEL: vpaddw256_mask_fold_test:
71 ; CHECK-NEXT: vptestmw %ymm1, %ymm1, %k1
72 ; CHECK-NEXT: vpaddw (%rdi), %ymm0, %ymm0 {%k1}
74 %mask = icmp ne <16 x i16> %mask1, zeroinitializer
75 %j = load <16 x i16>, <16 x i16>* %j.ptr
76 %x = add <16 x i16> %i, %j
77 %r = select <16 x i1> %mask, <16 x i16> %x, <16 x i16> %i
81 define <16 x i16> @vpaddw256_maskz_fold_test(<16 x i16> %i, <16 x i16>* %j.ptr, <16 x i16> %mask1) nounwind readnone {
82 ; CHECK-LABEL: vpaddw256_maskz_fold_test:
84 ; CHECK-NEXT: vptestmw %ymm1, %ymm1, %k1
85 ; CHECK-NEXT: vpaddw (%rdi), %ymm0, %ymm0 {%k1} {z}
87 %mask = icmp ne <16 x i16> %mask1, zeroinitializer
88 %j = load <16 x i16>, <16 x i16>* %j.ptr
89 %x = add <16 x i16> %i, %j
90 %r = select <16 x i1> %mask, <16 x i16> %x, <16 x i16> zeroinitializer
94 define <32 x i8> @vpsubb256_test(<32 x i8> %i, <32 x i8> %j) nounwind readnone {
95 ; CHECK-LABEL: vpsubb256_test:
97 ; CHECK-NEXT: vpsubb %ymm1, %ymm0, %ymm0
99 %x = sub <32 x i8> %i, %j
103 define <16 x i16> @vpsubw256_test(<16 x i16> %i, <16 x i16> %j) nounwind readnone {
104 ; CHECK-LABEL: vpsubw256_test:
106 ; CHECK-NEXT: vpsubw %ymm1, %ymm0, %ymm0
108 %x = sub <16 x i16> %i, %j
112 define <16 x i16> @vpmullw256_test(<16 x i16> %i, <16 x i16> %j) {
113 ; CHECK-LABEL: vpmullw256_test:
115 ; CHECK-NEXT: vpmullw %ymm1, %ymm0, %ymm0
117 %x = mul <16 x i16> %i, %j
123 define <16 x i8> @vpaddb128_test(<16 x i8> %i, <16 x i8> %j) nounwind readnone {
124 ; CHECK-LABEL: vpaddb128_test:
126 ; CHECK-NEXT: vpaddb %xmm1, %xmm0, %xmm0
128 %x = add <16 x i8> %i, %j
132 define <16 x i8> @vpaddb128_fold_test(<16 x i8> %i, <16 x i8>* %j) nounwind {
133 ; CHECK-LABEL: vpaddb128_fold_test:
135 ; CHECK-NEXT: vpaddb (%rdi), %xmm0, %xmm0
137 %tmp = load <16 x i8>, <16 x i8>* %j, align 4
138 %x = add <16 x i8> %i, %tmp
142 define <8 x i16> @vpaddw128_test(<8 x i16> %i, <8 x i16> %j) nounwind readnone {
143 ; CHECK-LABEL: vpaddw128_test:
145 ; CHECK-NEXT: vpaddw %xmm1, %xmm0, %xmm0
147 %x = add <8 x i16> %i, %j
151 define <8 x i16> @vpaddw128_fold_test(<8 x i16> %i, <8 x i16>* %j) nounwind {
152 ; CHECK-LABEL: vpaddw128_fold_test:
154 ; CHECK-NEXT: vpaddw (%rdi), %xmm0, %xmm0
156 %tmp = load <8 x i16>, <8 x i16>* %j, align 4
157 %x = add <8 x i16> %i, %tmp
161 define <8 x i16> @vpaddw128_mask_test(<8 x i16> %i, <8 x i16> %j, <8 x i16> %mask1) nounwind readnone {
162 ; CHECK-LABEL: vpaddw128_mask_test:
164 ; CHECK-NEXT: vptestmw %xmm2, %xmm2, %k1
165 ; CHECK-NEXT: vpaddw %xmm1, %xmm0, %xmm0 {%k1}
167 %mask = icmp ne <8 x i16> %mask1, zeroinitializer
168 %x = add <8 x i16> %i, %j
169 %r = select <8 x i1> %mask, <8 x i16> %x, <8 x i16> %i
173 define <8 x i16> @vpaddw128_maskz_test(<8 x i16> %i, <8 x i16> %j, <8 x i16> %mask1) nounwind readnone {
174 ; CHECK-LABEL: vpaddw128_maskz_test:
176 ; CHECK-NEXT: vptestmw %xmm2, %xmm2, %k1
177 ; CHECK-NEXT: vpaddw %xmm1, %xmm0, %xmm0 {%k1} {z}
179 %mask = icmp ne <8 x i16> %mask1, zeroinitializer
180 %x = add <8 x i16> %i, %j
181 %r = select <8 x i1> %mask, <8 x i16> %x, <8 x i16> zeroinitializer
185 define <8 x i16> @vpaddw128_mask_fold_test(<8 x i16> %i, <8 x i16>* %j.ptr, <8 x i16> %mask1) nounwind readnone {
186 ; CHECK-LABEL: vpaddw128_mask_fold_test:
188 ; CHECK-NEXT: vptestmw %xmm1, %xmm1, %k1
189 ; CHECK-NEXT: vpaddw (%rdi), %xmm0, %xmm0 {%k1}
191 %mask = icmp ne <8 x i16> %mask1, zeroinitializer
192 %j = load <8 x i16>, <8 x i16>* %j.ptr
193 %x = add <8 x i16> %i, %j
194 %r = select <8 x i1> %mask, <8 x i16> %x, <8 x i16> %i
198 define <8 x i16> @vpaddw128_maskz_fold_test(<8 x i16> %i, <8 x i16>* %j.ptr, <8 x i16> %mask1) nounwind readnone {
199 ; CHECK-LABEL: vpaddw128_maskz_fold_test:
201 ; CHECK-NEXT: vptestmw %xmm1, %xmm1, %k1
202 ; CHECK-NEXT: vpaddw (%rdi), %xmm0, %xmm0 {%k1} {z}
204 %mask = icmp ne <8 x i16> %mask1, zeroinitializer
205 %j = load <8 x i16>, <8 x i16>* %j.ptr
206 %x = add <8 x i16> %i, %j
207 %r = select <8 x i1> %mask, <8 x i16> %x, <8 x i16> zeroinitializer
211 define <16 x i8> @vpsubb128_test(<16 x i8> %i, <16 x i8> %j) nounwind readnone {
212 ; CHECK-LABEL: vpsubb128_test:
214 ; CHECK-NEXT: vpsubb %xmm1, %xmm0, %xmm0
216 %x = sub <16 x i8> %i, %j
220 define <8 x i16> @vpsubw128_test(<8 x i16> %i, <8 x i16> %j) nounwind readnone {
221 ; CHECK-LABEL: vpsubw128_test:
223 ; CHECK-NEXT: vpsubw %xmm1, %xmm0, %xmm0
225 %x = sub <8 x i16> %i, %j
229 define <8 x i16> @vpmullw128_test(<8 x i16> %i, <8 x i16> %j) {
230 ; CHECK-LABEL: vpmullw128_test:
232 ; CHECK-NEXT: vpmullw %xmm1, %xmm0, %xmm0
234 %x = mul <8 x i16> %i, %j