llvm.org GIT mirror llvm / cd10271
[x86] add minmax tests with more predicate coverage; NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315913 91177308-0d34-0410-b5e6-96231b3b80d8 Sanjay Patel 2 years ago
1 changed file(s) with 30 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
218218 ret <4 x i32> %r
219219 }
220220
221 define <4 x i32> @wrong_pred_for_smin_with_not(<4 x i32> %x) {
222 ; CHECK-LABEL: wrong_pred_for_smin_with_not:
223 ; CHECK: # BB#0:
224 ; CHECK-NEXT: vpcmpeqd %xmm1, %xmm1, %xmm1
225 ; CHECK-NEXT: vpxor %xmm1, %xmm0, %xmm1
226 ; CHECK-NEXT: vpxor {{.*}}(%rip), %xmm0, %xmm0
227 ; CHECK-NEXT: vpcmpgtd {{.*}}(%rip), %xmm0, %xmm0
228 ; CHECK-NEXT: vmovaps {{.*#+}} xmm2 = [4294967291,4294967291,4294967291,4294967291]
229 ; CHECK-NEXT: vblendvps %xmm0, %xmm1, %xmm2, %xmm0
230 ; CHECK-NEXT: retq
231 %not_x = xor <4 x i32> %x,
232 %cmp = icmp ugt <4 x i32> %x,
233 %sel = select <4 x i1> %cmp, <4 x i32> %not_x, <4 x i32>
234 ret <4 x i32> %sel
235 }
236
237 define <4 x i32> @wrong_pred_for_smin_with_subnsw(<4 x i32> %x, <4 x i32> %y) {
238 ; CHECK-LABEL: wrong_pred_for_smin_with_subnsw:
239 ; CHECK: # BB#0:
240 ; CHECK-NEXT: vpsubd %xmm1, %xmm0, %xmm2
241 ; CHECK-NEXT: vpminud %xmm1, %xmm0, %xmm1
242 ; CHECK-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0
243 ; CHECK-NEXT: vpand %xmm2, %xmm0, %xmm0
244 ; CHECK-NEXT: retq
245 %sub = sub nsw <4 x i32> %x, %y
246 %cmp = icmp ugt <4 x i32> %x, %y
247 %sel = select <4 x i1> %cmp, <4 x i32> zeroinitializer, <4 x i32> %sub
248 ret <4 x i32> %sel
249 }
250