Sanjay Patel | 09c5630 | 2016-11-29 19:15:27 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -mtriple=aarch64-unknown-unknown | FileCheck %s |
| 2 | |
| 3 | define i1 @andn_cmp(i32 %x, i32 %y) { |
| 4 | ; CHECK-LABEL: andn_cmp: |
Francis Visoiu Mistrih | 25528d6 | 2017-12-04 17:18:51 +0000 | [diff] [blame] | 5 | ; CHECK: // %bb.0: |
Sanjay Patel | 09c5630 | 2016-11-29 19:15:27 +0000 | [diff] [blame] | 6 | ; CHECK-NEXT: bics wzr, w1, w0 |
| 7 | ; CHECK-NEXT: cset w0, eq |
| 8 | ; CHECK-NEXT: ret |
| 9 | ; |
| 10 | %notx = xor i32 %x, -1 |
| 11 | %and = and i32 %notx, %y |
| 12 | %cmp = icmp eq i32 %and, 0 |
| 13 | ret i1 %cmp |
| 14 | } |
| 15 | |
Sanjay Patel | 09c5630 | 2016-11-29 19:15:27 +0000 | [diff] [blame] | 16 | define i1 @and_cmp(i32 %x, i32 %y) { |
| 17 | ; CHECK-LABEL: and_cmp: |
Francis Visoiu Mistrih | 25528d6 | 2017-12-04 17:18:51 +0000 | [diff] [blame] | 18 | ; CHECK: // %bb.0: |
Sanjay Patel | 47f7f30 | 2016-11-29 22:28:58 +0000 | [diff] [blame] | 19 | ; CHECK-NEXT: bics wzr, w1, w0 |
Sanjay Patel | 09c5630 | 2016-11-29 19:15:27 +0000 | [diff] [blame] | 20 | ; CHECK-NEXT: cset w0, eq |
| 21 | ; CHECK-NEXT: ret |
| 22 | ; |
| 23 | %and = and i32 %x, %y |
| 24 | %cmp = icmp eq i32 %and, %y |
| 25 | ret i1 %cmp |
| 26 | } |
| 27 | |
| 28 | define i1 @and_cmp_const(i32 %x) { |
| 29 | ; CHECK-LABEL: and_cmp_const: |
Francis Visoiu Mistrih | 25528d6 | 2017-12-04 17:18:51 +0000 | [diff] [blame] | 30 | ; CHECK: // %bb.0: |
Sanjay Patel | 09c5630 | 2016-11-29 19:15:27 +0000 | [diff] [blame] | 31 | ; CHECK-NEXT: mov w8, #43 |
Sanjay Patel | 47f7f30 | 2016-11-29 22:28:58 +0000 | [diff] [blame] | 32 | ; CHECK-NEXT: bics wzr, w8, w0 |
Sanjay Patel | 09c5630 | 2016-11-29 19:15:27 +0000 | [diff] [blame] | 33 | ; CHECK-NEXT: cset w0, eq |
| 34 | ; CHECK-NEXT: ret |
| 35 | ; |
| 36 | %and = and i32 %x, 43 |
| 37 | %cmp = icmp eq i32 %and, 43 |
| 38 | ret i1 %cmp |
| 39 | } |
| 40 | |