1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mattr=+sve -force-streaming-compatible-sve < %s | FileCheck %s
4 target triple = "aarch64"
7 ; NOTE: SVE lowering for the BSP pseudoinst is not currently implemented, so we
8 ; don't currently expect the code below to lower to BSL/BIT/BIF. Once
9 ; this is implemented, this test will be fleshed out.
12 define <8 x i32> @fixed_bitselect_v8i32(ptr %pre_cond_ptr, ptr %left_ptr, ptr %right_ptr) {
13 ; CHECK-LABEL: fixed_bitselect_v8i32:
15 ; CHECK-NEXT: mov z0.s, #-1 // =0xffffffffffffffff
16 ; CHECK-NEXT: ldp q2, q1, [x0]
17 ; CHECK-NEXT: ldp q5, q4, [x1]
18 ; CHECK-NEXT: ldp q6, q7, [x2]
19 ; CHECK-NEXT: add z3.s, z1.s, z0.s
20 ; CHECK-NEXT: subr z1.s, z1.s, #0 // =0x0
21 ; CHECK-NEXT: add z0.s, z2.s, z0.s
22 ; CHECK-NEXT: subr z2.s, z2.s, #0 // =0x0
23 ; CHECK-NEXT: and z1.d, z1.d, z4.d
24 ; CHECK-NEXT: and z3.d, z3.d, z7.d
25 ; CHECK-NEXT: and z0.d, z0.d, z6.d
26 ; CHECK-NEXT: and z2.d, z2.d, z5.d
27 ; CHECK-NEXT: orr z1.d, z3.d, z1.d
28 ; CHECK-NEXT: orr z0.d, z0.d, z2.d
29 ; CHECK-NEXT: // kill: def $q1 killed $q1 killed $z1
30 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
32 %pre_cond = load <8 x i32>, ptr %pre_cond_ptr
33 %left = load <8 x i32>, ptr %left_ptr
34 %right = load <8 x i32>, ptr %right_ptr
36 %neg_cond = sub <8 x i32> zeroinitializer, %pre_cond
37 %min_cond = add <8 x i32> %pre_cond, <i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1>
38 %left_bits_0 = and <8 x i32> %neg_cond, %left
39 %right_bits_0 = and <8 x i32> %min_cond, %right
40 %bsl0000 = or <8 x i32> %right_bits_0, %left_bits_0
41 ret <8 x i32> %bsl0000