1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+popcnt,+sse2 | FileCheck %s
4 define i1 @noncanonical_parity(<16 x i1> %x) {
5 ; CHECK-LABEL: noncanonical_parity:
7 ; CHECK-NEXT: psllw $7, %xmm0
8 ; CHECK-NEXT: pmovmskb %xmm0, %eax
9 ; CHECK-NEXT: popcntl %eax, %eax
10 ; CHECK-NEXT: andl $1, %eax
11 ; CHECK-NEXT: # kill: def $al killed $al killed $eax
13 %r = call i1 @llvm.vector.reduce.xor.v16i1(<16 x i1> %x)
16 define i1 @canonical_parity(<16 x i1> %x) {
17 ; CHECK-LABEL: canonical_parity:
19 ; CHECK-NEXT: psllw $7, %xmm0
20 ; CHECK-NEXT: pmovmskb %xmm0, %eax
21 ; CHECK-NEXT: popcntw %ax, %ax
22 ; CHECK-NEXT: testb $1, %al
23 ; CHECK-NEXT: setne %al
25 %i1 = bitcast <16 x i1> %x to i16
26 %i2 = call i16 @llvm.ctpop.i16(i16 %i1)
28 %i4 = icmp ne i16 %i3, 0
31 define i1 @canonical_parity_noncanonical_pred(<16 x i1> %x) {
32 ; CHECK-LABEL: canonical_parity_noncanonical_pred:
34 ; CHECK-NEXT: psllw $7, %xmm0
35 ; CHECK-NEXT: pmovmskb %xmm0, %eax
36 ; CHECK-NEXT: popcntw %ax, %ax
37 ; CHECK-NEXT: # kill: def $al killed $al killed $ax
39 %i1 = bitcast <16 x i1> %x to i16
40 %i2 = call i16 @llvm.ctpop.i16(i16 %i1)
42 %i4 = icmp eq i16 %i3, 1
46 define i1 @noncanonical_nonparity(<16 x i1> %x) {
47 ; CHECK-LABEL: noncanonical_nonparity:
49 ; CHECK-NEXT: psllw $7, %xmm0
50 ; CHECK-NEXT: pmovmskb %xmm0, %eax
51 ; CHECK-NEXT: popcntl %eax, %eax
52 ; CHECK-NEXT: andl $1, %eax
53 ; CHECK-NEXT: xorb $1, %al
54 ; CHECK-NEXT: # kill: def $al killed $al killed $eax
56 %r.inv = call i1 @llvm.vector.reduce.xor.v16i1(<16 x i1> %x)
57 %r = xor i1 %r.inv, -1
60 define i1 @canonical_nonparity(<16 x i1> %x) {
61 ; CHECK-LABEL: canonical_nonparity:
63 ; CHECK-NEXT: psllw $7, %xmm0
64 ; CHECK-NEXT: pmovmskb %xmm0, %eax
65 ; CHECK-NEXT: popcntw %ax, %ax
66 ; CHECK-NEXT: testb $1, %al
67 ; CHECK-NEXT: sete %al
69 %i1 = bitcast <16 x i1> %x to i16
70 %i2 = call i16 @llvm.ctpop.i16(i16 %i1)
72 %i4 = icmp eq i16 %i3, 0
75 define i1 @canonical_nonparity_noncanonical_pred(<16 x i1> %x) {
76 ; CHECK-LABEL: canonical_nonparity_noncanonical_pred:
78 ; CHECK-NEXT: psllw $7, %xmm0
79 ; CHECK-NEXT: pmovmskb %xmm0, %eax
80 ; CHECK-NEXT: popcntw %ax, %ax
81 ; CHECK-NEXT: andl $1, %eax
82 ; CHECK-NEXT: xorb $1, %al
83 ; CHECK-NEXT: # kill: def $al killed $al killed $eax
85 %i1 = bitcast <16 x i1> %x to i16
86 %i2 = call i16 @llvm.ctpop.i16(i16 %i1)
88 %i4 = icmp ne i16 %i3, 1
92 declare i1 @llvm.vector.reduce.xor.v16i1(<16 x i1>)
93 declare i16 @llvm.ctpop.i16(i16)