1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-linux -mcpu=corei7 | FileCheck %s
3 ; RUN: opt -passes=instsimplify -disable-output < %s
5 define <8 x ptr> @SHUFF0(<4 x ptr> %ptrv) nounwind {
7 ; CHECK: # %bb.0: # %entry
8 ; CHECK-NEXT: pshufd {{.*#+}} xmm2 = xmm0[2,3,1,2]
9 ; CHECK-NEXT: pshufd {{.*#+}} xmm1 = xmm0[0,1,1,1]
10 ; CHECK-NEXT: movdqa %xmm2, %xmm0
13 %G = shufflevector <4 x ptr> %ptrv, <4 x ptr> %ptrv, <8 x i32> <i32 2, i32 7, i32 1, i32 2, i32 4, i32 5, i32 1, i32 1>
17 define <4 x ptr> @SHUFF1(<4 x ptr> %ptrv) nounwind {
18 ; CHECK-LABEL: SHUFF1:
19 ; CHECK: # %bb.0: # %entry
20 ; CHECK-NEXT: pshufd {{.*#+}} xmm0 = xmm0[2,3,3,2]
23 %G = shufflevector <4 x ptr> %ptrv, <4 x ptr> %ptrv, <4 x i32> <i32 2, i32 7, i32 7, i32 2>
27 define <4 x ptr> @SHUFF3(<4 x ptr> %ptrv) nounwind {
28 ; CHECK-LABEL: SHUFF3:
29 ; CHECK: # %bb.0: # %entry
30 ; CHECK-NEXT: pshufd {{.*#+}} xmm0 = xmm0[2,1,1,2]
33 %G = shufflevector <4 x ptr> %ptrv, <4 x ptr> undef, <4 x i32> <i32 2, i32 7, i32 1, i32 2>
37 define <4 x ptr> @LOAD0(ptr %p) nounwind {
39 ; CHECK: # %bb.0: # %entry
40 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
41 ; CHECK-NEXT: movaps (%eax), %xmm0
44 %G = load <4 x ptr>, ptr %p
48 define <4 x ptr> @LOAD1(ptr %p) nounwind {
50 ; CHECK: # %bb.0: # %entry
51 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
52 ; CHECK-NEXT: movdqa (%eax), %xmm0
53 ; CHECK-NEXT: pshufd {{.*#+}} xmm1 = xmm0[3,1,0,3]
54 ; CHECK-NEXT: movdqa %xmm1, (%eax)
57 %G = load <4 x ptr>, ptr %p
58 %T = shufflevector <4 x ptr> %G, <4 x ptr> %G, <4 x i32> <i32 7, i32 1, i32 4, i32 3>
59 store <4 x ptr> %T, ptr %p
63 define <4 x ptr> @LOAD2(ptr %p) nounwind {
65 ; CHECK: # %bb.0: # %entry
66 ; CHECK-NEXT: subl $28, %esp
67 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
68 ; CHECK-NEXT: movaps (%eax), %xmm0
69 ; CHECK-NEXT: movaps %xmm0, (%esp)
70 ; CHECK-NEXT: addl $28, %esp
74 %G = load <4 x ptr>, ptr %p
75 store <4 x ptr> %G, ptr %I
76 %Z = load <4 x ptr>, ptr %I
80 define <4 x i32> @INT2PTR0(ptr %p) nounwind {
81 ; CHECK-LABEL: INT2PTR0:
82 ; CHECK: # %bb.0: # %entry
83 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
84 ; CHECK-NEXT: movaps (%eax), %xmm0
87 %G = load <4 x ptr>, ptr %p
88 %K = ptrtoint <4 x ptr> %G to <4 x i32>
92 define <4 x ptr> @INT2PTR1(ptr %p) nounwind {
93 ; CHECK-LABEL: INT2PTR1:
94 ; CHECK: # %bb.0: # %entry
95 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
96 ; CHECK-NEXT: pmovzxbd {{.*#+}} xmm0 = mem[0],zero,zero,zero,mem[1],zero,zero,zero,mem[2],zero,zero,zero,mem[3],zero,zero,zero
99 %G = load <4 x i8>, ptr %p
100 %K = inttoptr <4 x i8> %G to <4 x ptr>
104 define <4 x ptr> @BITCAST0(ptr %p) nounwind {
105 ; CHECK-LABEL: BITCAST0:
106 ; CHECK: # %bb.0: # %entry
107 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
108 ; CHECK-NEXT: movaps (%eax), %xmm0
111 %G = load <4 x ptr>, ptr %p
112 %T = bitcast <4 x ptr> %G to <4 x ptr>
116 define <2 x ptr> @BITCAST1(ptr %p) nounwind {
117 ; CHECK-LABEL: BITCAST1:
118 ; CHECK: # %bb.0: # %entry
119 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
120 ; CHECK-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
123 %G = load <2 x ptr>, ptr %p
124 %T = bitcast <2 x ptr> %G to <2 x ptr>
128 define <4 x i32> @ICMP0(ptr %p0, ptr %p1) nounwind {
129 ; CHECK-LABEL: ICMP0:
130 ; CHECK: # %bb.0: # %entry
131 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
132 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %ecx
133 ; CHECK-NEXT: movdqa (%ecx), %xmm0
134 ; CHECK-NEXT: pcmpgtd (%eax), %xmm0
135 ; CHECK-NEXT: movaps {{.*#+}} xmm1 = [9,8,7,6]
136 ; CHECK-NEXT: blendvps %xmm0, {{\.?LCPI[0-9]+_[0-9]+}}, %xmm1
137 ; CHECK-NEXT: movaps %xmm1, %xmm0
140 %g0 = load <4 x ptr>, ptr %p0
141 %g1 = load <4 x ptr>, ptr %p1
142 %k = icmp sgt <4 x ptr> %g0, %g1
143 %j = select <4 x i1> %k, <4 x i32> <i32 0, i32 1, i32 2, i32 4>, <4 x i32> <i32 9, i32 8, i32 7, i32 6>
147 define <4 x i32> @ICMP1(ptr %p0, ptr %p1) nounwind {
148 ; CHECK-LABEL: ICMP1:
149 ; CHECK: # %bb.0: # %entry
150 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
151 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %ecx
152 ; CHECK-NEXT: movdqa (%ecx), %xmm0
153 ; CHECK-NEXT: pcmpeqd (%eax), %xmm0
154 ; CHECK-NEXT: movaps {{.*#+}} xmm1 = [9,8,7,6]
155 ; CHECK-NEXT: blendvps %xmm0, {{\.?LCPI[0-9]+_[0-9]+}}, %xmm1
156 ; CHECK-NEXT: movaps %xmm1, %xmm0
159 %g0 = load <4 x ptr>, ptr %p0
160 %g1 = load <4 x ptr>, ptr %p1
161 %k = icmp eq <4 x ptr> %g0, %g1
162 %j = select <4 x i1> %k, <4 x i32> <i32 0, i32 1, i32 2, i32 4>, <4 x i32> <i32 9, i32 8, i32 7, i32 6>