1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=aarch64-none-elf %s -o - | FileCheck %s
4 define i32 @neg_select_neg(i32 %a, i32 %b, i1 %bb) {
5 ; CHECK-LABEL: neg_select_neg:
7 ; CHECK-NEXT: tst w2, #0x1
8 ; CHECK-NEXT: csel w0, w0, w1, ne
12 %sel = select i1 %bb, i32 %nega, i32 %negb
13 %res = sub i32 0, %sel
17 define i32 @negneg_select_nega(i32 %a, i32 %b, i1 %bb) {
18 ; CHECK-LABEL: negneg_select_nega:
20 ; CHECK-NEXT: tst w2, #0x1
21 ; CHECK-NEXT: csneg w0, w1, w0, eq
24 %sel = select i1 %bb, i32 %nega, i32 %b
25 %nsel = sub i32 0, %sel
26 %res = sub i32 0, %nsel
30 define i32 @neg_select_nega(i32 %a, i32 %b, i1 %bb) {
31 ; CHECK-LABEL: neg_select_nega:
33 ; CHECK-NEXT: tst w2, #0x1
34 ; CHECK-NEXT: csneg w0, w0, w1, ne
37 %sel = select i1 %bb, i32 %nega, i32 %b
38 %res = sub i32 0, %sel
42 define i32 @neg_select_negb(i32 %a, i32 %b, i1 %bb) {
43 ; CHECK-LABEL: neg_select_negb:
45 ; CHECK-NEXT: tst w2, #0x1
46 ; CHECK-NEXT: csneg w0, w1, w0, eq
49 %sel = select i1 %bb, i32 %a, i32 %negb
50 %res = sub i32 0, %sel
54 define i32 @neg_select_ab(i32 %a, i32 %b, i1 %bb) {
55 ; CHECK-LABEL: neg_select_ab:
57 ; CHECK-NEXT: tst w2, #0x1
58 ; CHECK-NEXT: csel w8, w0, w1, ne
59 ; CHECK-NEXT: neg w0, w8
61 %sel = select i1 %bb, i32 %a, i32 %b
62 %res = sub i32 0, %sel
66 define i32 @neg_select_nega_with_use(i32 %a, i32 %b, i1 %bb) {
67 ; CHECK-LABEL: neg_select_nega_with_use:
69 ; CHECK-NEXT: tst w2, #0x1
70 ; CHECK-NEXT: neg w8, w0
71 ; CHECK-NEXT: csneg w9, w1, w0, eq
72 ; CHECK-NEXT: sub w0, w8, w9
75 %sel = select i1 %bb, i32 %nega, i32 %b
76 %nsel = sub i32 0, %sel
77 %res = add i32 %nsel, %nega