|
| 1 | +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py |
| 2 | +; RUN: llc -mtriple=aarch64-none-elf -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-SD |
| 3 | +; RUN: llc -mtriple=aarch64-none-elf -global-isel -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-GI |
| 4 | + |
| 5 | +define i32 @mask_pair(i32 %x, i32 %y) { |
| 6 | +; CHECK-LABEL: mask_pair: |
| 7 | +; CHECK: // %bb.0: |
| 8 | +; CHECK-NEXT: mov w8, #-1 // =0xffffffff |
| 9 | +; CHECK-NEXT: lsl w8, w8, w1 |
| 10 | +; CHECK-NEXT: and w0, w8, w0 |
| 11 | +; CHECK-NEXT: ret |
| 12 | + %shl = shl nsw i32 -1, %y |
| 13 | + %and = and i32 %shl, %x |
| 14 | + ret i32 %and |
| 15 | +} |
| 16 | + |
| 17 | +define i64 @mask_pair_64(i64 %x, i64 %y) { |
| 18 | +; CHECK-LABEL: mask_pair_64: |
| 19 | +; CHECK: // %bb.0: |
| 20 | +; CHECK-NEXT: mov x8, #-1 // =0xffffffffffffffff |
| 21 | +; CHECK-NEXT: lsl x8, x8, x1 |
| 22 | +; CHECK-NEXT: and x0, x8, x0 |
| 23 | +; CHECK-NEXT: ret |
| 24 | + %shl = shl nsw i64 -1, %y |
| 25 | + %and = and i64 %shl, %x |
| 26 | + ret i64 %and |
| 27 | +} |
| 28 | +;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: |
| 29 | +; CHECK-GI: {{.*}} |
| 30 | +; CHECK-SD: {{.*}} |
0 commit comments