1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-apple-darwin -mattr=sse | FileCheck %s
4 define i32 @test_load(ptr %a) {
5 ; CHECK-LABEL: test_load:
6 ; CHECK: ## %bb.0: ## %start
7 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
8 ; CHECK-NEXT: movaps (%eax), %xmm0
9 ; CHECK-NEXT: movmskps %xmm0, %eax
12 %0 = load <4 x i32>, ptr %a, align 16
13 %1 = icmp slt <4 x i32> %0, zeroinitializer
14 %2 = bitcast <4 x i1> %1 to i4
15 %3 = zext i4 %2 to i32
19 define i32 @test_bitcast(<4 x float> %a) {
20 ; CHECK-LABEL: test_bitcast:
21 ; CHECK: ## %bb.0: ## %start
22 ; CHECK-NEXT: movmskps %xmm0, %eax
25 %0 = bitcast <4 x float> %a to <4 x i32>
26 %1 = icmp slt <4 x i32> %0, zeroinitializer
27 %2 = bitcast <4 x i1> %1 to i4
28 %3 = zext i4 %2 to i32
32 define i32 @test_and(<4 x float> %a, <4 x float> %b) {
33 ; CHECK-LABEL: test_and:
34 ; CHECK: ## %bb.0: ## %start
35 ; CHECK-NEXT: andps %xmm1, %xmm0
36 ; CHECK-NEXT: movmskps %xmm0, %eax
39 %0 = bitcast <4 x float> %a to <4 x i32>
40 %1 = bitcast <4 x float> %b to <4 x i32>
41 %2 = icmp slt <4 x i32> %0, zeroinitializer
42 %3 = icmp slt <4 x i32> %1, zeroinitializer
43 %4 = and <4 x i1> %2, %3
44 %5 = bitcast <4 x i1> %4 to i4
45 %6 = zext i4 %5 to i32
49 define i32 @test_or(<4 x float> %a, <4 x float> %b) {
50 ; CHECK-LABEL: test_or:
51 ; CHECK: ## %bb.0: ## %start
52 ; CHECK-NEXT: orps %xmm1, %xmm0
53 ; CHECK-NEXT: movmskps %xmm0, %eax
56 %0 = bitcast <4 x float> %a to <4 x i32>
57 %1 = bitcast <4 x float> %b to <4 x i32>
58 %2 = icmp slt <4 x i32> %0, zeroinitializer
59 %3 = icmp slt <4 x i32> %1, zeroinitializer
60 %4 = or <4 x i1> %2, %3
61 %5 = bitcast <4 x i1> %4 to i4
62 %6 = zext i4 %5 to i32
66 define i32 @test_xor(<4 x float> %a, <4 x float> %b) {
67 ; CHECK-LABEL: test_xor:
68 ; CHECK: ## %bb.0: ## %start
69 ; CHECK-NEXT: xorps %xmm1, %xmm0
70 ; CHECK-NEXT: movmskps %xmm0, %eax
73 %0 = bitcast <4 x float> %a to <4 x i32>
74 %1 = bitcast <4 x float> %b to <4 x i32>
75 %2 = icmp slt <4 x i32> %0, zeroinitializer
76 %3 = icmp slt <4 x i32> %1, zeroinitializer
77 %4 = xor <4 x i1> %2, %3
78 %5 = bitcast <4 x i1> %4 to i4
79 %6 = zext i4 %5 to i32