Skip to content

Commit 32e5272

Browse files
Add test for another variant of bsl.
1 parent e01bdc1 commit 32e5272

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

llvm/test/CodeGen/AArch64/sve2-bsl.ll

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,3 +299,18 @@ define <vscale x 2 x i64> @codegen_bsl2n_i64(<vscale x 2 x i64> %0, <vscale x 2
299299
%7 = or <vscale x 2 x i64> %4, %6
300300
ret <vscale x 2 x i64> %7
301301
}
302+
303+
; (A ^ B) & C) ^ B -> (A & C) ^ (B & !C) when BIC instructions are available.
304+
define <vscale x 4 x i32> @bsl_combine_when_bic_available(<vscale x 4 x i32> %a, <vscale x 4 x i32> %b, <vscale x 4 x i32> %c) {
305+
; CHECK-LABEL: bsl_combine_when_bic_available:
306+
; CHECK: // %bb.0: // %entry
307+
; CHECK-NEXT: eor z0.d, z0.d, z1.d
308+
; CHECK-NEXT: and z0.d, z0.d, z2.d
309+
; CHECK-NEXT: eor z0.d, z0.d, z1.d
310+
; CHECK-NEXT: ret
311+
entry:
312+
%t1 = xor <vscale x 4 x i32> %a, %b
313+
%t2 = and <vscale x 4 x i32> %t1, %c
314+
%t3 = xor <vscale x 4 x i32> %t2, %b
315+
ret <vscale x 4 x i32> %t3
316+
}

0 commit comments

Comments
 (0)