1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s
4 define i32 @mask_negated_zext_bool1(i1 %x) {
5 ; CHECK-LABEL: mask_negated_zext_bool1:
7 ; CHECK-NEXT: movl %edi, %eax
8 ; CHECK-NEXT: andl $1, %eax
10 %ext = zext i1 %x to i32
11 %neg = sub i32 0, %ext
12 %and = and i32 %neg, 1
16 define i32 @mask_negated_zext_bool2(i1 zeroext %x) {
17 ; CHECK-LABEL: mask_negated_zext_bool2:
19 ; CHECK-NEXT: movl %edi, %eax
21 %ext = zext i1 %x to i32
22 %neg = sub i32 0, %ext
23 %and = and i32 %neg, 1
27 define <4 x i32> @mask_negated_zext_bool_vec(<4 x i1> %x) {
28 ; CHECK-LABEL: mask_negated_zext_bool_vec:
30 ; CHECK-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
32 %ext = zext <4 x i1> %x to <4 x i32>
33 %neg = sub <4 x i32> zeroinitializer, %ext
34 %and = and <4 x i32> %neg, <i32 1, i32 1, i32 1, i32 1>
38 define i32 @mask_negated_sext_bool1(i1 %x) {
39 ; CHECK-LABEL: mask_negated_sext_bool1:
41 ; CHECK-NEXT: movl %edi, %eax
42 ; CHECK-NEXT: andl $1, %eax
44 %ext = sext i1 %x to i32
45 %neg = sub i32 0, %ext
46 %and = and i32 %neg, 1
50 define i32 @mask_negated_sext_bool2(i1 zeroext %x) {
51 ; CHECK-LABEL: mask_negated_sext_bool2:
53 ; CHECK-NEXT: movl %edi, %eax
55 %ext = sext i1 %x to i32
56 %neg = sub i32 0, %ext
57 %and = and i32 %neg, 1
61 define <4 x i32> @mask_negated_sext_bool_vec(<4 x i1> %x) {
62 ; CHECK-LABEL: mask_negated_sext_bool_vec:
64 ; CHECK-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
66 %ext = sext <4 x i1> %x to <4 x i32>
67 %neg = sub <4 x i32> zeroinitializer, %ext
68 %and = and <4 x i32> %neg, <i32 1, i32 1, i32 1, i32 1>