xref: /llvm-project/llvm/test/MC/AArch64/directive-arch_extension-negative.s (revision 106259510f6a7a3824dd34f78a77ead150dd2154)
1// RUN: not llvm-mc -triple aarch64 \
2// RUN: -mattr=+crc,+sm4,+sha3,+sha2,+aes,+fp,+neon,+ras,+lse,+predres,+ccdp,+mte,+tlb-rmi,+pan-rwv,+ccpp,+rcpc,+ls64,+flagm,+hbc,+mops \
3// RUN: -mattr=+rcpc3,+lse128,+d128,+the,+rasv2,+ite,+cssc,+specres2,+gcs,+cmpbr \
4// RUN: -filetype asm -o - %s 2>&1 | FileCheck %s
5
6.arch_extension axp64
7// CHECK: error: unsupported architectural extension: axp64
8// CHECK-NEXT: .arch_extension axp64
9
10crc32cx w0, w1, x3
11// CHECK-NOT: [[@LINE-1]]:1: error: instruction requires: crc
12.arch_extension nocrc
13crc32cx w0, w1, x3
14// CHECK: [[@LINE-1]]:1: error: instruction requires: crc
15// CHECK-NEXT: crc32cx w0, w1, x3
16
17sm4e v2.4s, v15.4s
18// CHECK-NOT: [[@LINE-1]]:1: error: instruction requires: sm4
19.arch_extension nosm4
20sm4e v2.4s, v15.4s
21// CHECK: [[@LINE-1]]:1: error: instruction requires: sm4
22// CHECK-NEXT: sm4e v2.4s, v15.4s
23
24sha512h q0, q1, v2.2d
25// CHECK-NOT: [[@LINE-1]]:1: error: instruction requires: sha3
26.arch_extension nosha3
27sha512h q0, q1, v2.2d
28// CHECK: [[@LINE-1]]:1: error: instruction requires: sha3
29// CHECK-NEXT: sha512h q0, q1, v2.2d
30
31sha1h s0, s1
32// CHECK-NOT: [[@LINE-1]]:1: error: instruction requires: sha2
33.arch_extension nosha2
34sha1h s0, s1
35// CHECK: [[@LINE-1]]:1: error: instruction requires: sha2
36// CHECK-NEXT: sha1h s0, s1
37
38aese v0.16b, v1.16b
39// CHECK-NOT: [[@LINE-1]]:1: error: instruction requires: aes
40.arch_extension noaes
41aese v0.16b, v1.16b
42// CHECK: [[@LINE-1]]:1: error: instruction requires: aes
43// CHECK-NEXT: aese v0.16b, v1.16b
44
45fminnm d0, d0, d1
46// CHECK-NOT: [[@LINE-1]]:1: error: instruction requires: fp
47.arch_extension nofp
48fminnm d0, d0, d1
49// CHECK: [[@LINE-1]]:1: error: instruction requires: fp
50// CHECK-NEXT: fminnm d0, d0, d1
51
52// nofp implied nosimd, so reinstate it
53.arch_extension simd
54addp v0.4s, v0.4s, v0.4s
55// CHECK-NOT: [[@LINE-1]]:1: error: instruction requires: neon
56.arch_extension nosimd
57addp v0.4s, v0.4s, v0.4s
58// CHECK: [[@LINE-1]]:1: error: instruction requires: neon
59// CHECK-NEXT: addp v0.4s, v0.4s, v0.4s
60
61esb
62// CHECK-NOT: [[@LINE-1]]:1: error: instruction requires: ras
63.arch_extension noras
64esb
65// CHECK: [[@LINE-1]]:1: error: instruction requires: ras
66// CHECK-NEXT: esb
67
68casa w5, w7, [x20]
69// CHECK-NOT: [[@LINE-1]]:1: error: instruction requires: lse
70.arch_extension nolse
71casa w5, w7, [x20]
72// CHECK: [[@LINE-1]]:1: error: instruction requires: lse
73// CHECK-NEXT: casa w5, w7, [x20]
74
75// nolse implied nolse128, so reinstate it
76.arch_extension lse128
77swpp x0, x2, [x3]
78// CHECK-NOT: [[@LINE-1]]:1: error: instruction requires: lse128
79.arch_extension nolse128
80swpp x0, x2, [x3]
81// CHECK: [[@LINE-1]]:1: error: instruction requires: lse128
82// CHECK-NEXT: swpp x0, x2, [x3]
83
84cfp rctx, x0
85// CHECK-NOT: [[@LINE-1]]:5: error: CFPRCTX requires: predres
86.arch_extension nopredres
87cfp rctx, x0
88// CHECK: [[@LINE-1]]:5: error: CFPRCTX requires: predres
89// CHECK-NEXT: cfp rctx, x0
90
91// nopredres implied nopredres2, so reinstate it
92.arch_extension predres2
93cosp rctx, x0
94// CHECK-NOT: [[@LINE-1]]:6: error: COSP requires: predres2
95.arch_extension nopredres2
96cosp rctx, x0
97// CHECK: [[@LINE-1]]:6: error: COSP requires: predres2
98// CHECK-NEXT: cosp rctx, x0
99
100dc cvadp, x7
101// CHECK-NOT: [[@LINE-1]]:4: error: DC CVADP requires: ccdp
102.arch_extension noccdp
103dc cvadp, x7
104// CHECK: [[@LINE-1]]:4: error: DC CVADP requires: ccdp
105// CHECK-NEXT: dc cvadp, x7
106
107irg x0, x1
108// CHECK-NOT: [[@LINE-1]]:1: error: instruction requires: mte
109.arch_extension nomte
110irg x0, x1
111// CHECK: [[@LINE-1]]:1: error: instruction requires: mte
112// CHECK-NEXT: irg x0, x1
113
114tlbi vmalle1os
115// CHECK-NOT: [[@LINE-1]]:6: error: TLBI VMALLE1OS requires: tlb-rmi
116.arch_extension notlb-rmi
117tlbi vmalle1os
118// CHECK: [[@LINE-1]]:6: error: TLBI VMALLE1OS requires: tlb-rmi
119// CHECK-NEXT: tlbi vmalle1os
120
121at s1e1wp, x2
122// CHECK-NOT: [[@LINE-1]]:4: error: AT S1E1WP requires: pan-rwv
123.arch_extension nopan-rwv
124at s1e1wp, x2
125// CHECK: [[@LINE-1]]:4: error: AT S1E1WP requires: pan-rwv
126// CHECK-NEXT: at s1e1wp, x2
127
128dc cvap, x7
129// CHECK-NOT: [[@LINE-1]]:4: error: DC CVAP requires: ccpp
130.arch_extension noccpp
131dc cvap, x7
132// CHECK: [[@LINE-1]]:4: error: DC CVAP requires: ccpp
133// CHECK-NEXT: dc cvap, x7
134
135ldapr x0, [x1]
136// CHECK-NOT: [[@LINE-1]]:1: error: instruction requires: rcpc
137.arch_extension norcpc
138ldapr x0, [x1]
139// CHECK: [[@LINE-1]]:1: error: instruction requires: rcpc
140// CHECK-NEXT: ldapr x0, [x1]
141
142// norcpc implied norcpc3, so reinstate it
143.arch_extension rcpc3
144stilp w24, w0, [x16, #-8]!
145// CHECK-NOT: [[@LINE-1]]:1: error: instruction requires: rcpc3
146.arch_extension norcpc3
147stilp w24, w0, [x16, #-8]!
148// CHECK: [[@LINE-1]]:1: error: instruction requires: rcpc3
149// CHECK-NEXT: stilp w24, w0, [x16, #-8]!
150
151ld64b x0, [x13]
152// CHECK-NOT: [[@LINE-1]]:1: error: instruction requires: ls64
153.arch_extension nols64
154ld64b x0, [x13]
155// CHECK: [[@LINE-1]]:1: error: instruction requires: ls64
156// CHECK-NEXT: ld64b x0, [x13]
157
158cfinv
159// CHECK-NOT: [[@LINE-1]]:1: error: instruction requires: flagm
160.arch_extension noflagm
161cfinv
162// CHECK: [[@LINE-1]]:1: error: instruction requires: flagm
163// CHECK-NEXT: cfinv
164
165lbl:
166bc.eq lbl
167// CHECK-NOT: [[@LINE-1]]:1: error: instruction requires: hbc
168.arch_extension nohbc
169bc.eq lbl
170// CHECK: [[@LINE-1]]:1: error: instruction requires: hbc
171// CHECK-NEXT: bc.eq lbl
172
173cpyfp [x0]!, [x1]!, x2!
174// CHECK-NOT: [[@LINE-1]]:1: error: instruction requires: mops
175.arch_extension nomops
176cpyfp [x0]!, [x1]!, x2!
177// CHECK: [[@LINE-1]]:1: error: instruction requires: mops
178// CHECK-NEXT: cpyfp [x0]!, [x1]!, x2!
179
180// nolse128 implied nod128, so reinstate it
181.arch_extension d128
182// This needs to come before `.arch_extension nothe` as it uses an instruction
183// that requires both the and d128
184sysp #0, c2, c0, #0, x0, x1
185rcwcasp   x0, x1, x6, x7, [x4]
186// CHECK-NOT: [[@LINE-2]]:1: error: instruction requires: d128
187// CHECK-NOT: [[@LINE-2]]:1: error: instruction requires: d128
188.arch_extension nod128
189sysp #0, c2, c0, #0, x0, x1
190rcwcasp   x0, x1, x6, x7, [x4]
191// CHECK: [[@LINE-2]]:1: error: instruction requires: d128
192// CHECK-NEXT: sysp #0, c2, c0, #0, x0, x1
193// CHECK: [[@LINE-3]]:1: error: instruction requires: d128
194// CHECK-NEXT: rcwcasp   x0, x1, x6, x7, [x4]
195
196rcwswp x0, x1, [x2]
197// CHECK-NOT: [[@LINE-1]]:1: error: instruction requires: the
198.arch_extension nothe
199rcwswp x0, x1, [x2]
200// CHECK: [[@LINE-1]]:1: error: instruction requires: the
201// CHECK-NEXT: rcwswp x0, x1, [x2]
202
203trcit x0
204// CHECK-NOT: [[@LINE-1]]:1: error: instruction requires: ite
205.arch_extension noite
206trcit x0
207// CHECK: [[@LINE-1]]:1: error: instruction requires: ite
208// CHECK-NEXT: trcit x0
209
210umax x0, x1, x2
211// CHECK-NOT: [[@LINE-1]]:1: error: instruction requires: cssc
212.arch_extension nocssc
213umax x0, x1, x2
214// CHECK: [[@LINE-1]]:1: error: instruction requires: cssc
215// CHECK-NEXT: umax x0, x1, x2
216
217// noras implied norasv2, so reinstate it
218.arch_extension rasv2
219mrs x0, ERXGSR_EL1
220// CHECK-NOT: [[@LINE-1]]:9: error: expected readable system register
221.arch_extension norasv2
222mrs x0, ERXGSR_EL1
223// CHECK: [[@LINE-1]]:9: error: expected readable system register
224// CHECK-NEXT: mrs x0, ERXGSR_EL1
225
226gcspushm x0
227// CHECK-NOT: [[@LINE-1]]:1: error: instruction requires: gcs
228.arch_extension nogcs
229gcspushm x0
230// CHECK: [[@LINE-1]]:1: error: instruction requires: gcs
231// CHECK-NEXT: gcspushm x0
232
233cbhi x5, x5, #1020
234// CHECK-NOT: [[@LINE-1]]:1: error: instruction requires: cmpbr
235.arch_extension nocmpbr
236cbhi x5, x5, #1020
237// CHECK: [[@LINE-1]]:1: error: instruction requires: cmpbr
238// CHECK-NEXT: cbhi x5, x5, #1020
239
240
241.arch_extension fprcvt
242.arch_extension nofprcvt
243fcvtmu s0, d1
244// CHECK: [[@LINE-1]]:1: error: instruction requires: fprcvt
245// CHECK-NEXT: fcvtmu s0, d1
246
247.arch_extension f8f16mm
248.arch_extension nof8f16mm
249fmmla v2.8h, v1.16b, v0.16b
250// CHECK: [[@LINE-1]]:1: error: instruction requires: f8f16mm
251// CHECK-NEXT: fmmla v2.8h, v1.16b, v0.16b
252
253.arch_extension f8f32mm
254.arch_extension nof8f32mm
255fmmla v2.4s, v1.16b, v0.16b
256// CHECK: [[@LINE-1]]:1: error: instruction requires: f8f32mm
257// CHECK-NEXT: fmmla v2.4s, v1.16b, v0.16b
258