; CHECK-LABEL: combine_setcc_eq_vecreduce_or_v8i1:
; CHECK: // %bb.0:
; CHECK-NEXT: cmeq v0.8b, v0.8b, #0
+; CHECK-NEXT: mov w8, #1
; CHECK-NEXT: umaxv b0, v0.8b
-; CHECK-NEXT: fmov w8, s0
-; CHECK-NEXT: mvn w8, w8
-; CHECK-NEXT: and w0, w8, #0x1
+; CHECK-NEXT: fmov w9, s0
+; CHECK-NEXT: bic w0, w8, w9
; CHECK-NEXT: ret
%cmp1 = icmp eq <8 x i8> %a, zeroinitializer
%cast = bitcast <8 x i1> %cmp1 to i8
; CHECK-LABEL: combine_setcc_eq_vecreduce_or_v16i1:
; CHECK: // %bb.0:
; CHECK-NEXT: cmeq v0.16b, v0.16b, #0
+; CHECK-NEXT: mov w8, #1
; CHECK-NEXT: umaxv b0, v0.16b
-; CHECK-NEXT: fmov w8, s0
-; CHECK-NEXT: mvn w8, w8
-; CHECK-NEXT: and w0, w8, #0x1
+; CHECK-NEXT: fmov w9, s0
+; CHECK-NEXT: bic w0, w8, w9
; CHECK-NEXT: ret
%cmp1 = icmp eq <16 x i8> %a, zeroinitializer
%cast = bitcast <16 x i1> %cmp1 to i16
; CHECK-LABEL: combine_setcc_eq_vecreduce_or_v32i1:
; CHECK: // %bb.0:
; CHECK-NEXT: cmeq v1.16b, v1.16b, #0
+; CHECK-NEXT: mov w8, #1
; CHECK-NEXT: cmeq v0.16b, v0.16b, #0
; CHECK-NEXT: orr v0.16b, v0.16b, v1.16b
; CHECK-NEXT: umaxv b0, v0.16b
-; CHECK-NEXT: fmov w8, s0
-; CHECK-NEXT: mvn w8, w8
-; CHECK-NEXT: and w0, w8, #0x1
+; CHECK-NEXT: fmov w9, s0
+; CHECK-NEXT: bic w0, w8, w9
; CHECK-NEXT: ret
%cmp1 = icmp eq <32 x i8> %a, zeroinitializer
%cast = bitcast <32 x i1> %cmp1 to i32
; CHECK-LABEL: combine_setcc_eq_vecreduce_or_v64i1:
; CHECK: // %bb.0:
; CHECK-NEXT: cmeq v2.16b, v2.16b, #0
+; CHECK-NEXT: mov w8, #1
; CHECK-NEXT: cmeq v3.16b, v3.16b, #0
; CHECK-NEXT: cmeq v1.16b, v1.16b, #0
; CHECK-NEXT: cmeq v0.16b, v0.16b, #0
; CHECK-NEXT: orr v0.16b, v0.16b, v2.16b
; CHECK-NEXT: orr v0.16b, v0.16b, v1.16b
; CHECK-NEXT: umaxv b0, v0.16b
-; CHECK-NEXT: fmov w8, s0
-; CHECK-NEXT: mvn w8, w8
-; CHECK-NEXT: and w0, w8, #0x1
+; CHECK-NEXT: fmov w9, s0
+; CHECK-NEXT: bic w0, w8, w9
; CHECK-NEXT: ret
%cmp1 = icmp eq <64 x i8> %a, zeroinitializer
%cast = bitcast <64 x i1> %cmp1 to i64
define i32 @select_0_or_1(i1 %cond) {
; CHECK-LABEL: select_0_or_1:
; CHECK: // %bb.0:
-; CHECK-NEXT: mvn w8, w0
-; CHECK-NEXT: and w0, w8, #0x1
+; CHECK-NEXT: mov w8, #1
+; CHECK-NEXT: bic w0, w8, w0
; CHECK-NEXT: ret
%sel = select i1 %cond, i32 0, i32 1
ret i32 %sel
define i32 @select_0_or_1_signext(i1 signext %cond) {
; CHECK-LABEL: select_0_or_1_signext:
; CHECK: // %bb.0:
-; CHECK-NEXT: mvn w8, w0
-; CHECK-NEXT: and w0, w8, #0x1
+; CHECK-NEXT: mov w8, #1
+; CHECK-NEXT: bic w0, w8, w0
; CHECK-NEXT: ret
%sel = select i1 %cond, i32 0, i32 1
ret i32 %sel