xref: /llvm-project/llvm/test/MC/AArch64/armv8.6a-ecv.s (revision b94b8f1e77d9c41d479108c2e0bc14b09275af40)
1// RUN: not llvm-mc -triple aarch64 -show-encoding -mattr=+ecv   < %s 2> %t | FileCheck %s
2// RUN: FileCheck --check-prefix=ERROR %s < %t
3// RUN: not llvm-mc -triple aarch64 -show-encoding -mattr=+v8.6a < %s 2> %t | FileCheck %s
4// RUN: FileCheck --check-prefix=ERROR %s < %t
5// RUN: not llvm-mc -triple aarch64 -show-encoding               < %s 2> %t | FileCheck --check-prefix=NOECV-OUT %s
6// RUN: FileCheck --check-prefix=NOECV %s < %t
7
8// Expect no successful code generation at all with ECV disabled
9// NOECV-OUT-NOT: {{msr|mrs}}
10
11// Writable system registers
12msr CNTSCALE_EL2, x1
13msr CNTISCALE_EL2, x11
14msr CNTPOFF_EL2, x22
15msr CNTVFRQ_EL2, x3
16// CHECK: msr     CNTSCALE_EL2, x1        // encoding: [0x81,0xe0,0x1c,0xd5]
17// CHECK: msr     CNTISCALE_EL2, x11      // encoding: [0xab,0xe0,0x1c,0xd5]
18// CHECK: msr     CNTPOFF_EL2, x22        // encoding: [0xd6,0xe0,0x1c,0xd5]
19// CHECK: msr     CNTVFRQ_EL2, x3         // encoding: [0xe3,0xe0,0x1c,0xd5]
20// NOECV: :[[@LINE-8]]:5: error: expected writable system register or pstate
21// NOECV: :[[@LINE-8]]:5: error: expected writable system register or pstate
22// NOECV: :[[@LINE-8]]:5: error: expected writable system register or pstate
23// NOECV: :[[@LINE-8]]:5: error: expected writable system register or pstate
24
25// Readonly system registers: writing them gives an error even with
26// ECV enabled
27msr CNTPCTSS_EL0, x13
28msr CNTVCTSS_EL0, x23
29// ERROR: :[[@LINE-2]]:5: error: expected writable system register or pstate
30// ERROR: :[[@LINE-2]]:5: error: expected writable system register or pstate
31// NOECV: :[[@LINE-4]]:5: error: expected writable system register or pstate
32// NOECV: :[[@LINE-4]]:5: error: expected writable system register or pstate
33
34mrs x0, CNTSCALE_EL2
35mrs x5, CNTISCALE_EL2
36mrs x10, CNTPOFF_EL2
37mrs x15, CNTVFRQ_EL2
38mrs x20, CNTPCTSS_EL0
39mrs x30, CNTVCTSS_EL0
40// CHECK: mrs     x0, CNTSCALE_EL2        // encoding: [0x80,0xe0,0x3c,0xd5]
41// CHECK: mrs     x5, CNTISCALE_EL2       // encoding: [0xa5,0xe0,0x3c,0xd5]
42// CHECK: mrs     x10, CNTPOFF_EL2        // encoding: [0xca,0xe0,0x3c,0xd5]
43// CHECK: mrs     x15, CNTVFRQ_EL2        // encoding: [0xef,0xe0,0x3c,0xd5]
44// CHECK: mrs     x20, CNTPCTSS_EL0       // encoding: [0xb4,0xe0,0x3b,0xd5]
45// CHECK: mrs     x30, CNTVCTSS_EL0       // encoding: [0xde,0xe0,0x3b,0xd5]
46// NOECV: :[[@LINE-12]]:9: error: expected readable system register
47// NOECV: :[[@LINE-12]]:9: error: expected readable system register
48// NOECV: :[[@LINE-12]]:10: error: expected readable system register
49// NOECV: :[[@LINE-12]]:10: error: expected readable system register
50// NOECV: :[[@LINE-12]]:10: error: expected readable system register
51// NOECV: :[[@LINE-12]]:10: error: expected readable system register
52