|
1 | 1 | ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
| 2 | +; RUN: llc -verify-machineinstrs -mtriple=powerpc -mcpu=ppc32 < %s | FileCheck %s --check-prefix=PPC32 |
2 | 3 | ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr8 < %s | FileCheck %s
|
3 | 4 | ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu -mcpu=pwr8 < %s | FileCheck %s
|
4 | 5 | declare i32 @llvm.bitreverse.i32(i32)
|
5 | 6 | define i32 @testBitReverseIntrinsicI32(i32 %arg) {
|
| 7 | +; PPC32-LABEL: testBitReverseIntrinsicI32: |
| 8 | +; PPC32: # %bb.0: |
| 9 | +; PPC32-NEXT: lis 4, -21846 |
| 10 | +; PPC32-NEXT: ori 4, 4, 43690 |
| 11 | +; PPC32-NEXT: slwi 5, 3, 1 |
| 12 | +; PPC32-NEXT: and 4, 5, 4 |
| 13 | +; PPC32-NEXT: lis 5, 21845 |
| 14 | +; PPC32-NEXT: ori 5, 5, 21845 |
| 15 | +; PPC32-NEXT: srwi 3, 3, 1 |
| 16 | +; PPC32-NEXT: and 3, 3, 5 |
| 17 | +; PPC32-NEXT: lis 5, -13108 |
| 18 | +; PPC32-NEXT: or 3, 3, 4 |
| 19 | +; PPC32-NEXT: ori 5, 5, 52428 |
| 20 | +; PPC32-NEXT: slwi 4, 3, 2 |
| 21 | +; PPC32-NEXT: and 4, 4, 5 |
| 22 | +; PPC32-NEXT: lis 5, 13107 |
| 23 | +; PPC32-NEXT: ori 5, 5, 13107 |
| 24 | +; PPC32-NEXT: srwi 3, 3, 2 |
| 25 | +; PPC32-NEXT: and 3, 3, 5 |
| 26 | +; PPC32-NEXT: lis 5, -3856 |
| 27 | +; PPC32-NEXT: or 3, 3, 4 |
| 28 | +; PPC32-NEXT: ori 5, 5, 61680 |
| 29 | +; PPC32-NEXT: slwi 4, 3, 4 |
| 30 | +; PPC32-NEXT: and 4, 4, 5 |
| 31 | +; PPC32-NEXT: lis 5, 3855 |
| 32 | +; PPC32-NEXT: ori 5, 5, 3855 |
| 33 | +; PPC32-NEXT: srwi 3, 3, 4 |
| 34 | +; PPC32-NEXT: and 3, 3, 5 |
| 35 | +; PPC32-NEXT: or 4, 3, 4 |
| 36 | +; PPC32-NEXT: rotlwi 3, 4, 24 |
| 37 | +; PPC32-NEXT: rlwimi 3, 4, 8, 8, 15 |
| 38 | +; PPC32-NEXT: rlwimi 3, 4, 8, 24, 31 |
| 39 | +; PPC32-NEXT: blr |
| 40 | +; |
6 | 41 | ; CHECK-LABEL: testBitReverseIntrinsicI32:
|
7 | 42 | ; CHECK: # %bb.0:
|
8 | 43 | ; CHECK-NEXT: lis 4, -21846
|
@@ -43,6 +78,58 @@ define i32 @testBitReverseIntrinsicI32(i32 %arg) {
|
43 | 78 |
|
44 | 79 | declare i64 @llvm.bitreverse.i64(i64)
|
45 | 80 | define i64 @testBitReverseIntrinsicI64(i64 %arg) {
|
| 81 | +; PPC32-LABEL: testBitReverseIntrinsicI64: |
| 82 | +; PPC32: # %bb.0: |
| 83 | +; PPC32-NEXT: lis 5, -21846 |
| 84 | +; PPC32-NEXT: lis 6, 21845 |
| 85 | +; PPC32-NEXT: ori 5, 5, 43690 |
| 86 | +; PPC32-NEXT: slwi 10, 4, 1 |
| 87 | +; PPC32-NEXT: slwi 11, 3, 1 |
| 88 | +; PPC32-NEXT: ori 6, 6, 21845 |
| 89 | +; PPC32-NEXT: srwi 4, 4, 1 |
| 90 | +; PPC32-NEXT: srwi 3, 3, 1 |
| 91 | +; PPC32-NEXT: and 10, 10, 5 |
| 92 | +; PPC32-NEXT: and 5, 11, 5 |
| 93 | +; PPC32-NEXT: and 4, 4, 6 |
| 94 | +; PPC32-NEXT: and 3, 3, 6 |
| 95 | +; PPC32-NEXT: lis 7, -13108 |
| 96 | +; PPC32-NEXT: lis 8, 13107 |
| 97 | +; PPC32-NEXT: or 4, 4, 10 |
| 98 | +; PPC32-NEXT: or 3, 3, 5 |
| 99 | +; PPC32-NEXT: ori 7, 7, 52428 |
| 100 | +; PPC32-NEXT: ori 8, 8, 13107 |
| 101 | +; PPC32-NEXT: slwi 5, 4, 2 |
| 102 | +; PPC32-NEXT: srwi 4, 4, 2 |
| 103 | +; PPC32-NEXT: slwi 6, 3, 2 |
| 104 | +; PPC32-NEXT: srwi 3, 3, 2 |
| 105 | +; PPC32-NEXT: and 5, 5, 7 |
| 106 | +; PPC32-NEXT: and 4, 4, 8 |
| 107 | +; PPC32-NEXT: and 6, 6, 7 |
| 108 | +; PPC32-NEXT: and 3, 3, 8 |
| 109 | +; PPC32-NEXT: lis 9, -3856 |
| 110 | +; PPC32-NEXT: lis 11, 3855 |
| 111 | +; PPC32-NEXT: or 4, 4, 5 |
| 112 | +; PPC32-NEXT: or 3, 3, 6 |
| 113 | +; PPC32-NEXT: ori 9, 9, 61680 |
| 114 | +; PPC32-NEXT: ori 11, 11, 3855 |
| 115 | +; PPC32-NEXT: slwi 5, 4, 4 |
| 116 | +; PPC32-NEXT: srwi 4, 4, 4 |
| 117 | +; PPC32-NEXT: slwi 6, 3, 4 |
| 118 | +; PPC32-NEXT: srwi 3, 3, 4 |
| 119 | +; PPC32-NEXT: and 5, 5, 9 |
| 120 | +; PPC32-NEXT: and 4, 4, 11 |
| 121 | +; PPC32-NEXT: and 6, 6, 9 |
| 122 | +; PPC32-NEXT: and 3, 3, 11 |
| 123 | +; PPC32-NEXT: or 5, 4, 5 |
| 124 | +; PPC32-NEXT: or 6, 3, 6 |
| 125 | +; PPC32-NEXT: rotlwi 3, 5, 24 |
| 126 | +; PPC32-NEXT: rotlwi 4, 6, 24 |
| 127 | +; PPC32-NEXT: rlwimi 3, 5, 8, 8, 15 |
| 128 | +; PPC32-NEXT: rlwimi 4, 6, 8, 8, 15 |
| 129 | +; PPC32-NEXT: rlwimi 3, 5, 8, 24, 31 |
| 130 | +; PPC32-NEXT: rlwimi 4, 6, 8, 24, 31 |
| 131 | +; PPC32-NEXT: blr |
| 132 | +; |
46 | 133 | ; CHECK-LABEL: testBitReverseIntrinsicI64:
|
47 | 134 | ; CHECK: # %bb.0:
|
48 | 135 | ; CHECK-NEXT: lis 4, -21846
|
|
0 commit comments