Eugene Leviant | 25347ea | 2018-02-07 05:38:29 +0000 | [diff] [blame] | 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 |
| 3 | |
| 4 | define void @foo(i32 %In1, <2 x i128> %In2, <2 x i128> %In3, <2 x i128> *%Out) { |
| 5 | ; CHECK-LABEL: foo: |
| 6 | ; CHECK: // %bb.0: |
| 7 | ; CHECK-NEXT: and w9, w0, #0x1 |
| 8 | ; CHECK-NEXT: fmov s0, wzr |
| 9 | ; CHECK-NEXT: ldp x10, x8, [sp, #8] |
| 10 | ; CHECK-NEXT: fmov s1, w9 |
| 11 | ; CHECK-NEXT: ldr x9, [sp] |
| 12 | ; CHECK-NEXT: cmeq v0.4s, v1.4s, v0.4s |
| 13 | ; CHECK-NEXT: fmov w11, s0 |
| 14 | ; CHECK-NEXT: tst w11, #0x1 |
| 15 | ; CHECK-NEXT: csel x11, x2, x6, ne |
| 16 | ; CHECK-NEXT: csel x12, x3, x7, ne |
| 17 | ; CHECK-NEXT: csel x9, x4, x9, ne |
| 18 | ; CHECK-NEXT: csel x10, x5, x10, ne |
| 19 | ; CHECK-NEXT: stp x9, x10, [x8, #16] |
| 20 | ; CHECK-NEXT: stp x11, x12, [x8] |
| 21 | ; CHECK-NEXT: ret |
| 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, <2 x i128> *%Out |
| 26 | |
| 27 | ret void |
| 28 | } |
| 29 | |
| 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, <2 x i96> *%Out) { |
| 32 | ; CHECK-LABEL: bar: |
| 33 | ; CHECK: // %bb.0: |
| 34 | ; CHECK-NEXT: and w10, w0, #0x1 |
| 35 | ; CHECK-NEXT: fmov s0, wzr |
| 36 | ; CHECK-NEXT: fmov s1, w10 |
| 37 | ; CHECK-NEXT: cmeq v0.4s, v1.4s, v0.4s |
| 38 | ; CHECK-NEXT: ldp x11, x8, [sp, #8] |
| 39 | ; CHECK-NEXT: ldr x9, [sp] |
| 40 | ; CHECK-NEXT: dup v1.4s, v0.s[0] |
| 41 | ; CHECK-NEXT: mov x10, v1.d[1] |
| 42 | ; CHECK-NEXT: lsr x10, x10, #32 |
| 43 | ; CHECK-NEXT: tst w10, #0x1 |
| 44 | ; CHECK-NEXT: fmov w10, s0 |
| 45 | ; CHECK-NEXT: csel x11, x5, x11, ne |
| 46 | ; CHECK-NEXT: csel x9, x4, x9, ne |
| 47 | ; CHECK-NEXT: tst w10, #0x1 |
| 48 | ; CHECK-NEXT: csel x10, x3, x7, ne |
| 49 | ; CHECK-NEXT: csel x12, x2, x6, ne |
| 50 | ; CHECK-NEXT: stur x9, [x8, #12] |
| 51 | ; CHECK-NEXT: str x12, [x8] |
| 52 | ; CHECK-NEXT: str w10, [x8, #8] |
| 53 | ; CHECK-NEXT: str w11, [x8, #20] |
| 54 | ; CHECK-NEXT: ret |
| 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, <2 x i96> *%Out |
| 59 | |
| 60 | ret void |
| 61 | } |