1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+sse2 | FileCheck %s --check-prefix=SSE2
3 ; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+sse4.2 | FileCheck %s --check-prefix=SSE42
4 ; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+avx2 | FileCheck %s --check-prefix=AVX2
5 ; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+avx512f | FileCheck %s --check-prefix=AVX512
7 define <2 x i64> @PR32907(<2 x i64> %astype.i, <2 x i64> %astype6.i) {
9 ; SSE2: # %bb.0: # %entry
10 ; SSE2-NEXT: psubq %xmm1, %xmm0
11 ; SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm0[1,1,3,3]
12 ; SSE2-NEXT: psrad $31, %xmm2
13 ; SSE2-NEXT: pxor %xmm1, %xmm1
14 ; SSE2-NEXT: psubq %xmm0, %xmm1
15 ; SSE2-NEXT: pand %xmm2, %xmm1
16 ; SSE2-NEXT: pandn %xmm0, %xmm2
17 ; SSE2-NEXT: por %xmm2, %xmm1
18 ; SSE2-NEXT: movdqa %xmm1, %xmm0
21 ; SSE42-LABEL: PR32907:
22 ; SSE42: # %bb.0: # %entry
23 ; SSE42-NEXT: psubq %xmm1, %xmm0
24 ; SSE42-NEXT: pxor %xmm1, %xmm1
25 ; SSE42-NEXT: pcmpgtq %xmm0, %xmm1
26 ; SSE42-NEXT: pxor %xmm1, %xmm0
27 ; SSE42-NEXT: psubq %xmm1, %xmm0
30 ; AVX2-LABEL: PR32907:
31 ; AVX2: # %bb.0: # %entry
32 ; AVX2-NEXT: vpsubq %xmm1, %xmm0, %xmm0
33 ; AVX2-NEXT: vpxor %xmm1, %xmm1, %xmm1
34 ; AVX2-NEXT: vpcmpgtq %xmm0, %xmm1, %xmm1
35 ; AVX2-NEXT: vpxor %xmm1, %xmm0, %xmm0
36 ; AVX2-NEXT: vpsubq %xmm1, %xmm0, %xmm0
39 ; AVX512-LABEL: PR32907:
40 ; AVX512: # %bb.0: # %entry
41 ; AVX512-NEXT: vpsubq %xmm1, %xmm0, %xmm0
42 ; AVX512-NEXT: vpsraq $63, %zmm0, %zmm1
43 ; AVX512-NEXT: vpxor %xmm1, %xmm0, %xmm0
44 ; AVX512-NEXT: vpsubq %xmm1, %xmm0, %xmm0
45 ; AVX512-NEXT: vzeroupper
48 %sub13.i = sub <2 x i64> %astype.i, %astype6.i
49 %x.lobit.i.i = ashr <2 x i64> %sub13.i, <i64 63, i64 63>
50 %sub.i.i = sub <2 x i64> zeroinitializer, %sub13.i
51 %0 = xor <2 x i64> %x.lobit.i.i, <i64 -1, i64 -1>
52 %1 = and <2 x i64> %sub13.i, %0
53 %2 = and <2 x i64> %x.lobit.i.i, %sub.i.i
54 %cond.i.i = or <2 x i64> %1, %2
55 ret <2 x i64> %cond.i.i