Skip to content

Commit 8453f20

Browse files
[AArch64][llvm] Unify AArch64 tests into a single file (3/4) (NFC) (#146330)
This is a series of patches (3/4) to unify assembly/disassembly of recent AArch64 tests into a single file. The aim is to improve consistency, so that all instructions and system registers are thoroughly tested, and future test cases will be in a unified format. This patch: * removes .txt tests which have multiple feature dependencies * makes the .s tests have a roundabout run line to test both encoding and assembly * creates diagnostic tests when needed See also #146328, #146329 and #146331. Co-authored-by: Virginia Cangelosi <[email protected]>
1 parent 385f83c commit 8453f20

29 files changed

+5660
-5141
lines changed

llvm/test/MC/AArch64/armv8.6a-fgt.s

Lines changed: 123 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,149 @@
1-
// RUN: llvm-mc -triple aarch64 -show-encoding -mattr=+fgt < %s | FileCheck %s
2-
// RUN: llvm-mc -triple aarch64 -show-encoding -mattr=+v8.6a < %s | FileCheck %s
3-
// RUN: not llvm-mc -triple aarch64 -show-encoding < %s 2>&1 | FileCheck %s --check-prefix=NOFGT
1+
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+v8.6a < %s \
2+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
3+
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+fgt < %s \
4+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
5+
// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \
6+
// RUN: | FileCheck %s --check-prefixes=CHECK-ERROR
7+
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+fgt < %s \
8+
// RUN: | llvm-objdump -d --mattr=+fgt - | FileCheck %s --check-prefix=CHECK-INST
9+
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+fgt < %s \
10+
// RUN: | llvm-objdump -d --mattr=-fgt - | FileCheck %s --check-prefix=CHECK-UNKNOWN
11+
// Disassemble encoding and check the re-encoding (-show-encoding) matches.
12+
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+fgt < %s \
13+
// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \
14+
// RUN: | llvm-mc -triple=aarch64 -mattr=+fgt -disassemble -show-encoding \
15+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
16+
17+
418

519
msr HFGRTR_EL2, x0
20+
// CHECK-INST: msr HFGRTR_EL2, x0
21+
// CHECK-ENCODING: encoding: [0x80,0x11,0x1c,0xd5]
22+
// CHECK-ERROR: :[[@LINE-3]]:5: error: expected writable system register or pstate
23+
// CHECK-UNKNOWN: d51c1180 msr S3_4_C1_C1_4, x0
24+
625
msr HFGWTR_EL2, x5
26+
// CHECK-INST: msr HFGWTR_EL2, x5
27+
// CHECK-ENCODING: encoding: [0xa5,0x11,0x1c,0xd5]
28+
// CHECK-ERROR: :[[@LINE-3]]:5: error: expected writable system register or pstate
29+
// CHECK-UNKNOWN: d51c11a5 msr S3_4_C1_C1_5, x5
30+
731
msr HFGITR_EL2, x10
32+
// CHECK-INST: msr HFGITR_EL2, x10
33+
// CHECK-ENCODING: encoding: [0xca,0x11,0x1c,0xd5]
34+
// CHECK-ERROR: :[[@LINE-3]]:5: error: expected writable system register or pstate
35+
// CHECK-UNKNOWN: d51c11ca msr S3_4_C1_C1_6, x10
36+
837
msr HDFGRTR_EL2, x15
38+
// CHECK-INST: msr HDFGRTR_EL2, x15
39+
// CHECK-ENCODING: encoding: [0x8f,0x31,0x1c,0xd5]
40+
// CHECK-ERROR: :[[@LINE-3]]:5: error: expected writable system register or pstate
41+
// CHECK-UNKNOWN: d51c318f msr S3_4_C3_C1_4, x15
42+
943
msr HDFGWTR_EL2, x20
44+
// CHECK-INST: msr HDFGWTR_EL2, x20
45+
// CHECK-ENCODING: encoding: [0xb4,0x31,0x1c,0xd5]
46+
// CHECK-ERROR: :[[@LINE-3]]:5: error: expected writable system register or pstate
47+
// CHECK-UNKNOWN: d51c31b4 msr S3_4_C3_C1_5, x20
48+
1049
msr HAFGRTR_EL2, x25
11-
// CHECK: msr HFGRTR_EL2, x0 // encoding: [0x80,0x11,0x1c,0xd5]
12-
// CHECK: msr HFGWTR_EL2, x5 // encoding: [0xa5,0x11,0x1c,0xd5]
13-
// CHECK: msr HFGITR_EL2, x10 // encoding: [0xca,0x11,0x1c,0xd5]
14-
// CHECK: msr HDFGRTR_EL2, x15 // encoding: [0x8f,0x31,0x1c,0xd5]
15-
// CHECK: msr HDFGWTR_EL2, x20 // encoding: [0xb4,0x31,0x1c,0xd5]
16-
// CHECK: msr HAFGRTR_EL2, x25 // encoding: [0xd9,0x31,0x1c,0xd5]
17-
// NOFGT: error: expected writable system register or pstate
18-
// NOFGT: error: expected writable system register or pstate
19-
// NOFGT: error: expected writable system register or pstate
20-
// NOFGT: error: expected writable system register or pstate
21-
// NOFGT: error: expected writable system register or pstate
22-
// NOFGT: error: expected writable system register or pstate
50+
// CHECK-INST: msr HAFGRTR_EL2, x25
51+
// CHECK-ENCODING: encoding: [0xd9,0x31,0x1c,0xd5]
52+
// CHECK-ERROR: :[[@LINE-3]]:5: error: expected writable system register or pstate
53+
// CHECK-UNKNOWN: d51c31d9 msr S3_4_C3_C1_6, x25
2354

2455
mrs x30, HFGRTR_EL2
56+
// CHECK-INST: mrs x30, HFGRTR_EL2
57+
// CHECK-ENCODING: encoding: [0x9e,0x11,0x3c,0xd5]
58+
// CHECK-ERROR: :[[@LINE-3]]:11: error: expected readable system register
59+
// CHECK-UNKNOWN: d53c119e mrs x30, S3_4_C1_C1_4
60+
2561
mrs x25, HFGWTR_EL2
62+
// CHECK-INST: mrs x25, HFGWTR_EL2
63+
// CHECK-ENCODING: encoding: [0xb9,0x11,0x3c,0xd5]
64+
// CHECK-ERROR: :[[@LINE-3]]:11: error: expected readable system register
65+
// CHECK-UNKNOWN: d53c11b9 mrs x25, S3_4_C1_C1_5
66+
2667
mrs x20, HFGITR_EL2
68+
// CHECK-INST: mrs x20, HFGITR_EL2
69+
// CHECK-ENCODING: encoding: [0xd4,0x11,0x3c,0xd5]
70+
// CHECK-ERROR: :[[@LINE-3]]:11: error: expected readable system register
71+
// CHECK-UNKNOWN: d53c11d4 mrs x20, S3_4_C1_C1_6
72+
2773
mrs x15, HDFGRTR_EL2
74+
// CHECK-INST: mrs x15, HDFGRTR_EL2
75+
// CHECK-ENCODING: encoding: [0x8f,0x31,0x3c,0xd5]
76+
// CHECK-ERROR: :[[@LINE-3]]:11: error: expected readable system register
77+
// CHECK-UNKNOWN: d53c318f mrs x15, S3_4_C3_C1_4
78+
2879
mrs x10, HDFGWTR_EL2
29-
mrs x5, HAFGRTR_EL2
30-
// CHECK: mrs x30, HFGRTR_EL2 // encoding: [0x9e,0x11,0x3c,0xd5]
31-
// CHECK: mrs x25, HFGWTR_EL2 // encoding: [0xb9,0x11,0x3c,0xd5]
32-
// CHECK: mrs x20, HFGITR_EL2 // encoding: [0xd4,0x11,0x3c,0xd5]
33-
// CHECK: mrs x15, HDFGRTR_EL2 // encoding: [0x8f,0x31,0x3c,0xd5]
34-
// CHECK: mrs x10, HDFGWTR_EL2 // encoding: [0xaa,0x31,0x3c,0xd5]
35-
// CHECK: mrs x5, HAFGRTR_EL2 // encoding: [0xc5,0x31,0x3c,0xd5]
36-
// NOFGT: error: expected readable system register
37-
// NOFGT: error: expected readable system register
38-
// NOFGT: error: expected readable system register
39-
// NOFGT: error: expected readable system register
40-
// NOFGT: error: expected readable system register
41-
// NOFGT: error: expected readable system register
80+
// CHECK-INST: mrs x10, HDFGWTR_EL2
81+
// CHECK-ENCODING: encoding: [0xaa,0x31,0x3c,0xd5]
82+
// CHECK-ERROR: :[[@LINE-3]]:11: error: expected readable system register
83+
// CHECK-UNKNOWN: d53c31aa mrs x10, S3_4_C3_C1_5
4284

85+
mrs x5, HAFGRTR_EL2
86+
// CHECK-INST: mrs x5, HAFGRTR_EL2
87+
// CHECK-ENCODING: encoding: [0xc5,0x31,0x3c,0xd5]
88+
// CHECK-ERROR: :[[@LINE-3]]:11: error: expected readable system register
89+
// CHECK-UNKNOWN: d53c31c5 mrs x5, S3_4_C3_C1_6
4390

4491
mrs x3, HDFGRTR2_EL2
92+
// CHECK-INST: mrs x3, HDFGRTR2_EL2
93+
// CHECK-ENCODING: encoding: [0x03,0x31,0x3c,0xd5]
94+
// CHECK-ERROR: :[[@LINE-3]]:9: error: expected readable system register
95+
// CHECK-UNKNOWN: d53c3103 mrs x3, S3_4_C3_C1_0
96+
4597
mrs x3, HDFGWTR2_EL2
98+
// CHECK-INST: mrs x3, HDFGWTR2_EL2
99+
// CHECK-ENCODING: encoding: [0x23,0x31,0x3c,0xd5]
100+
// CHECK-ERROR: :[[@LINE-3]]:9: error: expected readable system register
101+
// CHECK-UNKNOWN: d53c3123 mrs x3, S3_4_C3_C1_1
102+
46103
mrs x3, HFGRTR2_EL2
104+
// CHECK-INST: mrs x3, HFGRTR2_EL2
105+
// CHECK-ENCODING: encoding: [0x43,0x31,0x3c,0xd5]
106+
// CHECK-ERROR: :[[@LINE-3]]:9: error: expected readable system register
107+
// CHECK-UNKNOWN: d53c3143 mrs x3, S3_4_C3_C1_2
108+
47109
mrs x3, HFGWTR2_EL2
48-
mrs x3, HFGITR2_EL2
49-
// CHECK: mrs x3, HDFGRTR2_EL2 // encoding: [0x03,0x31,0x3c,0xd5]
50-
// CHECK: mrs x3, HDFGWTR2_EL2 // encoding: [0x23,0x31,0x3c,0xd5]
51-
// CHECK: mrs x3, HFGRTR2_EL2 // encoding: [0x43,0x31,0x3c,0xd5]
52-
// CHECK: mrs x3, HFGWTR2_EL2 // encoding: [0x63,0x31,0x3c,0xd5]
53-
// CHECK: mrs x3, HFGITR2_EL2 // encoding: [0xe3,0x31,0x3c,0xd5]
54-
// NOFGT: error: expected readable system register
55-
// NOFGT: error: expected readable system register
56-
// NOFGT: error: expected readable system register
57-
// NOFGT: error: expected readable system register
58-
// NOFGT: error: expected readable system register
110+
// CHECK-INST: mrs x3, HFGWTR2_EL2
111+
// CHECK-ENCODING: encoding: [0x63,0x31,0x3c,0xd5]
112+
// CHECK-ERROR: :[[@LINE-3]]:9: error: expected readable system register
113+
// CHECK-UNKNOWN: d53c3163 mrs x3, S3_4_C3_C1_3
59114

115+
mrs x3, HFGITR2_EL2
116+
// CHECK-INST: mrs x3, HFGITR2_EL2
117+
// CHECK-ENCODING: encoding: [0xe3,0x31,0x3c,0xd5]
118+
// CHECK-ERROR: :[[@LINE-3]]:9: error: expected readable system register
119+
// CHECK-UNKNOWN: d53c31e3 mrs x3, S3_4_C3_C1_7
60120

61121
msr HDFGRTR2_EL2, x3
122+
// CHECK-INST: msr HDFGRTR2_EL2, x3
123+
// CHECK-ENCODING: encoding: [0x03,0x31,0x1c,0xd5]
124+
// CHECK-ERROR: :[[@LINE-3]]:5: error: expected writable system register or pstate
125+
// CHECK-UNKNOWN: d51c3103 msr S3_4_C3_C1_0, x3
126+
62127
msr HDFGWTR2_EL2, x3
128+
// CHECK-INST: msr HDFGWTR2_EL2, x3
129+
// CHECK-ENCODING: encoding: [0x23,0x31,0x1c,0xd5]
130+
// CHECK-ERROR: :[[@LINE-3]]:5: error: expected writable system register or pstate
131+
// CHECK-UNKNOWN: d51c3123 msr S3_4_C3_C1_1, x3
132+
63133
msr HFGRTR2_EL2, x3
134+
// CHECK-INST: msr HFGRTR2_EL2, x3
135+
// CHECK-ENCODING: encoding: [0x43,0x31,0x1c,0xd5]
136+
// CHECK-ERROR: :[[@LINE-3]]:5: error: expected writable system register or pstate
137+
// CHECK-UNKNOWN: d51c3143 msr S3_4_C3_C1_2, x3
138+
64139
msr HFGWTR2_EL2, x3
140+
// CHECK-INST: msr HFGWTR2_EL2, x3
141+
// CHECK-ENCODING: encoding: [0x63,0x31,0x1c,0xd5]
142+
// CHECK-ERROR: :[[@LINE-3]]:5: error: expected writable system register or pstate
143+
// CHECK-UNKNOWN: d51c3163 msr S3_4_C3_C1_3, x3
144+
65145
msr HFGITR2_EL2, x3
66-
// CHECK: msr HDFGRTR2_EL2, x3 // encoding: [0x03,0x31,0x1c,0xd5]
67-
// CHECK: msr HDFGWTR2_EL2, x3 // encoding: [0x23,0x31,0x1c,0xd5]
68-
// CHECK: msr HFGRTR2_EL2, x3 // encoding: [0x43,0x31,0x1c,0xd5]
69-
// CHECK: msr HFGWTR2_EL2, x3 // encoding: [0x63,0x31,0x1c,0xd5]
70-
// CHECK: msr HFGITR2_EL2, x3 // encoding: [0xe3,0x31,0x1c,0xd5]
71-
// NOFGT: error: expected writable system register
72-
// NOFGT: error: expected writable system register
73-
// NOFGT: error: expected writable system register
74-
// NOFGT: error: expected writable system register
75-
// NOFGT: error: expected writable system register
146+
// CHECK-INST: msr HFGITR2_EL2, x3
147+
// CHECK-ENCODING: encoding: [0xe3,0x31,0x1c,0xd5]
148+
// CHECK-ERROR: :[[@LINE-3]]:5: error: expected writable system register or pstate
149+
// CHECK-UNKNOWN: d51c31e3 msr S3_4_C3_C1_7, x3

0 commit comments

Comments
 (0)