1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=aarch64-unknown-linux-gnu -O3 %s -o - | FileCheck %s
4 define void @foo(i32 %In1, <2 x i128> %In2, <2 x i128> %In3, ptr %Out) {
7 ; CHECK-NEXT: and w8, w0, #0x1
8 ; CHECK-NEXT: fmov s0, wzr
9 ; CHECK-NEXT: ldr x11, [sp]
10 ; CHECK-NEXT: fmov s1, w8
11 ; CHECK-NEXT: ldp x9, x10, [sp, #8]
12 ; CHECK-NEXT: cmeq v0.4s, v1.4s, v0.4s
13 ; CHECK-NEXT: fmov w8, s0
14 ; CHECK-NEXT: tst w8, #0x1
15 ; CHECK-NEXT: csel x8, x5, x9, ne
16 ; CHECK-NEXT: csel x9, x4, x11, ne
17 ; CHECK-NEXT: stp x9, x8, [x10, #16]
18 ; CHECK-NEXT: csel x8, x3, x7, ne
19 ; CHECK-NEXT: csel x9, x2, x6, ne
20 ; CHECK-NEXT: stp x9, x8, [x10]
22 %cond = and i32 %In1, 1
23 %cbool = icmp eq i32 %cond, 0
24 %res = select i1 %cbool, <2 x i128> %In2, <2 x i128> %In3
25 store <2 x i128> %res, ptr %Out
30 ; Check case when scalar size is not power of 2.
31 define void @bar(i32 %In1, <2 x i96> %In2, <2 x i96> %In3, ptr %Out) {
34 ; CHECK-NEXT: and w8, w0, #0x1
35 ; CHECK-NEXT: fmov s0, wzr
36 ; CHECK-NEXT: ldr x11, [sp, #16]
37 ; CHECK-NEXT: fmov s1, w8
38 ; CHECK-NEXT: ldp x9, x10, [sp]
39 ; CHECK-NEXT: cmeq v0.4s, v1.4s, v0.4s
40 ; CHECK-NEXT: dup v1.4s, v0.s[0]
41 ; CHECK-NEXT: mov x8, v1.d[1]
42 ; CHECK-NEXT: lsr x8, x8, #32
43 ; CHECK-NEXT: tst w8, #0x1
44 ; CHECK-NEXT: fmov w8, s0
45 ; CHECK-NEXT: csel x10, x5, x10, ne
46 ; CHECK-NEXT: csel x9, x4, x9, ne
47 ; CHECK-NEXT: stur x9, [x11, #12]
48 ; CHECK-NEXT: tst w8, #0x1
49 ; CHECK-NEXT: str w10, [x11, #20]
50 ; CHECK-NEXT: csel x8, x2, x6, ne
51 ; CHECK-NEXT: csel x9, x3, x7, ne
52 ; CHECK-NEXT: str x8, [x11]
53 ; CHECK-NEXT: str w9, [x11, #8]
55 %cond = and i32 %In1, 1
56 %cbool = icmp eq i32 %cond, 0
57 %res = select i1 %cbool, <2 x i96> %In2, <2 x i96> %In3
58 store <2 x i96> %res, ptr %Out