|
| 1 | +// RUN: not llvm-mc -triple aarch64 -mattr +brbe -show-encoding %s 2>%t | FileCheck %s |
| 2 | +// RUN: FileCheck --check-prefix=ERROR %s < %t |
| 3 | +// RUN: not llvm-mc -triple aarch64 -show-encoding %s 2>%t |
| 4 | +// RUN: FileCheck --check-prefix=ERROR-NO-BRBE %s < %t |
| 5 | + |
| 6 | +msr BRBCR_EL1, x0 |
| 7 | +mrs x1, BRBCR_EL1 |
| 8 | +// CHECK: msr BRBCR_EL1, x0 // encoding: [0x00,0x90,0x11,0xd5] |
| 9 | +// CHECK: mrs x1, BRBCR_EL1 // encoding: [0x01,0x90,0x31,0xd5] |
| 10 | +// ERROR-NO-BRBE: [[@LINE-4]]:5: error: expected writable system register |
| 11 | +// ERROR-NO-BRBE: [[@LINE-4]]:9: error: expected readable system register |
| 12 | + |
| 13 | +msr BRBCR_EL12, x2 |
| 14 | +mrs x3, BRBCR_EL12 |
| 15 | +// CHECK: msr BRBCR_EL12, x2 // encoding: [0x02,0x90,0x15,0xd5] |
| 16 | +// CHECK: mrs x3, BRBCR_EL12 // encoding: [0x03,0x90,0x35,0xd5] |
| 17 | +// ERROR-NO-BRBE: [[@LINE-4]]:5: error: expected writable system register |
| 18 | +// ERROR-NO-BRBE: [[@LINE-4]]:9: error: expected readable system register |
| 19 | + |
| 20 | +msr BRBCR_EL2, x4 |
| 21 | +mrs x5, BRBCR_EL2 |
| 22 | +// CHECK: msr BRBCR_EL2, x4 // encoding: [0x04,0x90,0x14,0xd5] |
| 23 | +// CHECK: mrs x5, BRBCR_EL2 // encoding: [0x05,0x90,0x34,0xd5] |
| 24 | +// ERROR-NO-BRBE: [[@LINE-4]]:5: error: expected writable system register |
| 25 | +// ERROR-NO-BRBE: [[@LINE-4]]:9: error: expected readable system register |
| 26 | + |
| 27 | +msr BRBFCR_EL1, x6 |
| 28 | +mrs x7, BRBFCR_EL1 |
| 29 | +// CHECK: msr BRBFCR_EL1, x6 // encoding: [0x26,0x90,0x11,0xd5] |
| 30 | +// CHECK: mrs x7, BRBFCR_EL1 // encoding: [0x27,0x90,0x31,0xd5] |
| 31 | +// ERROR-NO-BRBE: [[@LINE-4]]:5: error: expected writable system register |
| 32 | +// ERROR-NO-BRBE: [[@LINE-4]]:9: error: expected readable system register |
| 33 | + |
| 34 | +msr BRBIDR0_EL1, x8 |
| 35 | +mrs x9, BRBIDR0_EL1 |
| 36 | +// ERROR: [[@LINE-2]]:5: error: expected writable system register |
| 37 | +// CHECK: mrs x9, BRBIDR0_EL1 // encoding: [0x09,0x92,0x31,0xd5] |
| 38 | +// ERROR-NO-BRBE: [[@LINE-4]]:5: error: expected writable system register |
| 39 | +// ERROR-NO-BRBE: [[@LINE-4]]:9: error: expected readable system register |
| 40 | + |
| 41 | +msr BRBINFINJ_EL1, x10 |
| 42 | +mrs x11, BRBINFINJ_EL1 |
| 43 | +// CHECK: msr BRBINFINJ_EL1, x10 // encoding: [0x0a,0x91,0x11,0xd5] |
| 44 | +// CHECK: mrs x11, BRBINFINJ_EL1 // encoding: [0x0b,0x91,0x31,0xd5] |
| 45 | +// ERROR-NO-BRBE: [[@LINE-4]]:5: error: expected writable system register |
| 46 | +// ERROR-NO-BRBE: [[@LINE-4]]:10: error: expected readable system register |
| 47 | + |
| 48 | +msr BRBSRCINJ_EL1, x12 |
| 49 | +mrs x13, BRBSRCINJ_EL1 |
| 50 | +// CHECK: msr BRBSRCINJ_EL1, x12 // encoding: [0x2c,0x91,0x11,0xd5] |
| 51 | +// CHECK: mrs x13, BRBSRCINJ_EL1 // encoding: [0x2d,0x91,0x31,0xd5] |
| 52 | +// ERROR-NO-BRBE: [[@LINE-4]]:5: error: expected writable system register |
| 53 | +// ERROR-NO-BRBE: [[@LINE-4]]:10: error: expected readable system register |
| 54 | + |
| 55 | +msr BRBTGTINJ_EL1, x14 |
| 56 | +mrs x15, BRBTGTINJ_EL1 |
| 57 | +// CHECK: msr BRBTGTINJ_EL1, x14 // encoding: [0x4e,0x91,0x11,0xd5] |
| 58 | +// CHECK: mrs x15, BRBTGTINJ_EL1 // encoding: [0x4f,0x91,0x31,0xd5] |
| 59 | +// ERROR-NO-BRBE: [[@LINE-4]]:5: error: expected writable system register |
| 60 | +// ERROR-NO-BRBE: [[@LINE-4]]:10: error: expected readable system register |
| 61 | + |
| 62 | +msr BRBTS_EL1, x16 |
| 63 | +mrs x17, BRBTS_EL1 |
| 64 | +// CHECK: msr BRBTS_EL1, x16 // encoding: [0x50,0x90,0x11,0xd5] |
| 65 | +// CHECK: mrs x17, BRBTS_EL1 // encoding: [0x51,0x90,0x31,0xd5] |
| 66 | +// ERROR-NO-BRBE: [[@LINE-4]]:5: error: expected writable system register |
| 67 | +// ERROR-NO-BRBE: [[@LINE-4]]:10: error: expected readable system register |
| 68 | + |
| 69 | +// Rather than testing all 32 registers in the three BRBINF/BRBSRC/BRBTGT |
| 70 | +// families, I'll test a representative sample, including all bits clear, |
| 71 | +// all bits set, each bit set individually, and a couple of intermediate |
| 72 | +// patterns. |
| 73 | + |
| 74 | +msr BRBINF0_EL1, x18 |
| 75 | +mrs x19, BRBINF0_EL1 |
| 76 | +// ERROR: [[@LINE-2]]:5: error: expected writable system register |
| 77 | +// CHECK: mrs x19, BRBINF0_EL1 // encoding: [0x13,0x80,0x31,0xd5] |
| 78 | +// ERROR-NO-BRBE: [[@LINE-4]]:5: error: expected writable system register |
| 79 | +// ERROR-NO-BRBE: [[@LINE-4]]:10: error: expected readable system register |
| 80 | + |
| 81 | +msr BRBINF1_EL1, x20 |
| 82 | +mrs x21, BRBINF1_EL1 |
| 83 | +// ERROR: [[@LINE-2]]:5: error: expected writable system register |
| 84 | +// CHECK: mrs x21, BRBINF1_EL1 // encoding: [0x15,0x81,0x31,0xd5] |
| 85 | +// ERROR-NO-BRBE: [[@LINE-4]]:5: error: expected writable system register |
| 86 | +// ERROR-NO-BRBE: [[@LINE-4]]:10: error: expected readable system register |
| 87 | + |
| 88 | +msr BRBINF2_EL1, x22 |
| 89 | +mrs x23, BRBINF2_EL1 |
| 90 | +// ERROR: [[@LINE-2]]:5: error: expected writable system register |
| 91 | +// CHECK: mrs x23, BRBINF2_EL1 // encoding: [0x17,0x82,0x31,0xd5] |
| 92 | +// ERROR-NO-BRBE: [[@LINE-4]]:5: error: expected writable system register |
| 93 | +// ERROR-NO-BRBE: [[@LINE-4]]:10: error: expected readable system register |
| 94 | + |
| 95 | +msr BRBSRC4_EL1, x24 |
| 96 | +mrs x25, BRBSRC4_EL1 |
| 97 | +// ERROR: [[@LINE-2]]:5: error: expected writable system register |
| 98 | +// CHECK: mrs x25, BRBSRC4_EL1 // encoding: [0x39,0x84,0x31,0xd5] |
| 99 | +// ERROR-NO-BRBE: [[@LINE-4]]:5: error: expected writable system register |
| 100 | +// ERROR-NO-BRBE: [[@LINE-4]]:10: error: expected readable system register |
| 101 | + |
| 102 | +msr BRBSRC8_EL1, x26 |
| 103 | +mrs x27, BRBSRC8_EL1 |
| 104 | +// ERROR: [[@LINE-2]]:5: error: expected writable system register |
| 105 | +// CHECK: mrs x27, BRBSRC8_EL1 // encoding: [0x3b,0x88,0x31,0xd5] |
| 106 | +// ERROR-NO-BRBE: [[@LINE-4]]:5: error: expected writable system register |
| 107 | +// ERROR-NO-BRBE: [[@LINE-4]]:10: error: expected readable system register |
| 108 | + |
| 109 | +msr BRBSRC16_EL1, x28 |
| 110 | +mrs x29, BRBSRC16_EL1 |
| 111 | +// ERROR: [[@LINE-2]]:5: error: expected writable system register |
| 112 | +// CHECK: mrs x29, BRBSRC16_EL1 // encoding: [0xbd,0x80,0x31,0xd5] |
| 113 | +// ERROR-NO-BRBE: [[@LINE-4]]:5: error: expected writable system register |
| 114 | +// ERROR-NO-BRBE: [[@LINE-4]]:10: error: expected readable system register |
| 115 | + |
| 116 | +msr BRBTGT10_EL1, x0 |
| 117 | +mrs x1, BRBTGT10_EL1 |
| 118 | +// ERROR: [[@LINE-2]]:5: error: expected writable system register |
| 119 | +// CHECK: mrs x1, BRBTGT10_EL1 // encoding: [0x41,0x8a,0x31,0xd5] |
| 120 | +// ERROR-NO-BRBE: [[@LINE-4]]:5: error: expected writable system register |
| 121 | +// ERROR-NO-BRBE: [[@LINE-4]]:9: error: expected readable system register |
| 122 | + |
| 123 | +msr BRBTGT21_EL1, x2 |
| 124 | +mrs x3, BRBTGT21_EL1 |
| 125 | +// ERROR: [[@LINE-2]]:5: error: expected writable system register |
| 126 | +// CHECK: mrs x3, BRBTGT21_EL1 // encoding: [0xc3,0x85,0x31,0xd5] |
| 127 | +// ERROR-NO-BRBE: [[@LINE-4]]:5: error: expected writable system register |
| 128 | +// ERROR-NO-BRBE: [[@LINE-4]]:9: error: expected readable system register |
| 129 | + |
| 130 | +msr BRBTGT31_EL1, x4 |
| 131 | +mrs x5, BRBTGT31_EL1 |
| 132 | +// ERROR: [[@LINE-2]]:5: error: expected writable system register |
| 133 | +// CHECK: mrs x5, BRBTGT31_EL1 // encoding: [0xc5,0x8f,0x31,0xd5] |
| 134 | +// ERROR-NO-BRBE: [[@LINE-4]]:5: error: expected writable system register |
| 135 | +// ERROR-NO-BRBE: [[@LINE-4]]:9: error: expected readable system register |
0 commit comments