1 //===- AArch64SystemOperands.td ----------------------------*- tablegen -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file defines the symbolic operands permitted for various kinds of
10 // AArch64 system instruction.
12 //===----------------------------------------------------------------------===//
14 include "llvm/TableGen/SearchableTable.td"
16 //===----------------------------------------------------------------------===//
17 // Features that, for the compiler, only enable system operands and PStates
18 //===----------------------------------------------------------------------===//
20 def HasCCPP : Predicate<"Subtarget->hasCCPP()">,
21 AssemblerPredicateWithAll<(all_of FeatureCCPP), "ccpp">;
23 def HasPAN : Predicate<"Subtarget->hasPAN()">,
24 AssemblerPredicateWithAll<(all_of FeaturePAN),
25 "ARM v8.1 Privileged Access-Never extension">;
27 def HasPsUAO : Predicate<"Subtarget->hasPsUAO()">,
28 AssemblerPredicateWithAll<(all_of FeaturePsUAO),
29 "ARM v8.2 UAO PState extension (psuao)">;
31 def HasPAN_RWV : Predicate<"Subtarget->hasPAN_RWV()">,
32 AssemblerPredicateWithAll<(all_of FeaturePAN_RWV),
33 "ARM v8.2 PAN AT S1E1R and AT S1E1W Variation">;
36 : Predicate<"Subtarget->hasCONTEXTIDREL2()">,
37 AssemblerPredicateWithAll<(all_of FeatureCONTEXTIDREL2),
38 "Target contains CONTEXTIDR_EL2 RW operand">;
40 //===----------------------------------------------------------------------===//
41 // AT (address translate) instruction options.
42 //===----------------------------------------------------------------------===//
44 class AT<string name, bits<3> op1, bits<4> crn, bits<4> crm,
48 let Encoding{13-11} = op1;
49 let Encoding{10-7} = crn;
50 let Encoding{6-3} = crm;
51 let Encoding{2-0} = op2;
52 code Requires = [{ {} }];
55 def ATValues : GenericEnum {
56 let FilterClass = "AT";
57 let NameField = "Name";
58 let ValueField = "Encoding";
61 def ATsList : GenericTable {
62 let FilterClass = "AT";
63 let Fields = ["Name", "Encoding", "Requires"];
65 let PrimaryKey = ["Encoding"];
66 let PrimaryKeyName = "lookupATByEncoding";
69 def lookupATByName : SearchIndex {
74 def : AT<"S1E1R", 0b000, 0b0111, 0b1000, 0b000>;
75 def : AT<"S1E2R", 0b100, 0b0111, 0b1000, 0b000>;
76 def : AT<"S1E3R", 0b110, 0b0111, 0b1000, 0b000>;
77 def : AT<"S1E1W", 0b000, 0b0111, 0b1000, 0b001>;
78 def : AT<"S1E2W", 0b100, 0b0111, 0b1000, 0b001>;
79 def : AT<"S1E3W", 0b110, 0b0111, 0b1000, 0b001>;
80 def : AT<"S1E0R", 0b000, 0b0111, 0b1000, 0b010>;
81 def : AT<"S1E0W", 0b000, 0b0111, 0b1000, 0b011>;
82 def : AT<"S12E1R", 0b100, 0b0111, 0b1000, 0b100>;
83 def : AT<"S12E1W", 0b100, 0b0111, 0b1000, 0b101>;
84 def : AT<"S12E0R", 0b100, 0b0111, 0b1000, 0b110>;
85 def : AT<"S12E0W", 0b100, 0b0111, 0b1000, 0b111>;
87 let Requires = [{ {AArch64::FeaturePAN_RWV} }] in {
88 def : AT<"S1E1RP", 0b000, 0b0111, 0b1001, 0b000>;
89 def : AT<"S1E1WP", 0b000, 0b0111, 0b1001, 0b001>;
92 // v8.9a/v9.4a FEAT_ATS1A
93 def : AT<"S1E1A", 0b000, 0b0111, 0b1001, 0b010>;
94 def : AT<"S1E2A", 0b100, 0b0111, 0b1001, 0b010>;
95 def : AT<"S1E3A", 0b110, 0b0111, 0b1001, 0b010>;
97 //===----------------------------------------------------------------------===//
98 // DMB/DSB (data barrier) instruction options.
99 //===----------------------------------------------------------------------===//
101 class DB<string name, bits<4> encoding> {
103 bits<4> Encoding = encoding;
106 def DBValues : GenericEnum {
107 let FilterClass = "DB";
108 let NameField = "Name";
109 let ValueField = "Encoding";
112 def DBsList : GenericTable {
113 let FilterClass = "DB";
114 let Fields = ["Name", "Encoding"];
116 let PrimaryKey = ["Encoding"];
117 let PrimaryKeyName = "lookupDBByEncoding";
120 def lookupDBByName : SearchIndex {
125 def : DB<"oshld", 0x1>;
126 def : DB<"oshst", 0x2>;
127 def : DB<"osh", 0x3>;
128 def : DB<"nshld", 0x5>;
129 def : DB<"nshst", 0x6>;
130 def : DB<"nsh", 0x7>;
131 def : DB<"ishld", 0x9>;
132 def : DB<"ishst", 0xa>;
133 def : DB<"ish", 0xb>;
138 class DBnXS<string name, bits<4> encoding, bits<5> immValue> {
140 bits<4> Encoding = encoding;
141 bits<5> ImmValue = immValue;
142 code Requires = [{ {AArch64::FeatureXS} }];
145 def DBnXSValues : GenericEnum {
146 let FilterClass = "DBnXS";
147 let NameField = "Name";
148 let ValueField = "Encoding";
151 def DBnXSsList : GenericTable {
152 let FilterClass = "DBnXS";
153 let Fields = ["Name", "Encoding", "ImmValue", "Requires"];
155 let PrimaryKey = ["Encoding"];
156 let PrimaryKeyName = "lookupDBnXSByEncoding";
159 def lookupDBnXSByName : SearchIndex {
160 let Table = DBnXSsList;
164 def lookupDBnXSByImmValue : SearchIndex {
165 let Table = DBnXSsList;
166 let Key = ["ImmValue"];
169 def : DBnXS<"oshnxs", 0x3, 0x10>;
170 def : DBnXS<"nshnxs", 0x7, 0x14>;
171 def : DBnXS<"ishnxs", 0xb, 0x18>;
172 def : DBnXS<"synxs", 0xf, 0x1c>;
174 //===----------------------------------------------------------------------===//
175 // DC (data cache maintenance) instruction options.
176 //===----------------------------------------------------------------------===//
178 class DC<string name, bits<3> op1, bits<4> crn, bits<4> crm,
182 let Encoding{13-11} = op1;
183 let Encoding{10-7} = crn;
184 let Encoding{6-3} = crm;
185 let Encoding{2-0} = op2;
186 code Requires = [{ {} }];
189 def DCValues : GenericEnum {
190 let FilterClass = "DC";
191 let NameField = "Name";
192 let ValueField = "Encoding";
195 def DCsList : GenericTable {
196 let FilterClass = "DC";
197 let Fields = ["Name", "Encoding", "Requires"];
199 let PrimaryKey = ["Encoding"];
200 let PrimaryKeyName = "lookupDCByEncoding";
203 def lookupDCByName : SearchIndex {
208 def : DC<"ZVA", 0b011, 0b0111, 0b0100, 0b001>;
209 def : DC<"IVAC", 0b000, 0b0111, 0b0110, 0b001>;
210 def : DC<"ISW", 0b000, 0b0111, 0b0110, 0b010>;
211 def : DC<"CVAC", 0b011, 0b0111, 0b1010, 0b001>;
212 def : DC<"CSW", 0b000, 0b0111, 0b1010, 0b010>;
213 def : DC<"CVAU", 0b011, 0b0111, 0b1011, 0b001>;
214 def : DC<"CIVAC", 0b011, 0b0111, 0b1110, 0b001>;
215 def : DC<"CISW", 0b000, 0b0111, 0b1110, 0b010>;
217 let Requires = [{ {AArch64::FeatureCCPP} }] in
218 def : DC<"CVAP", 0b011, 0b0111, 0b1100, 0b001>;
220 let Requires = [{ {AArch64::FeatureCacheDeepPersist} }] in
221 def : DC<"CVADP", 0b011, 0b0111, 0b1101, 0b001>;
223 let Requires = [{ {AArch64::FeatureMTE} }] in {
224 def : DC<"IGVAC", 0b000, 0b0111, 0b0110, 0b011>;
225 def : DC<"IGSW", 0b000, 0b0111, 0b0110, 0b100>;
226 def : DC<"CGSW", 0b000, 0b0111, 0b1010, 0b100>;
227 def : DC<"CIGSW", 0b000, 0b0111, 0b1110, 0b100>;
228 def : DC<"CGVAC", 0b011, 0b0111, 0b1010, 0b011>;
229 def : DC<"CGVAP", 0b011, 0b0111, 0b1100, 0b011>;
230 def : DC<"CGVADP", 0b011, 0b0111, 0b1101, 0b011>;
231 def : DC<"CIGVAC", 0b011, 0b0111, 0b1110, 0b011>;
232 def : DC<"GVA", 0b011, 0b0111, 0b0100, 0b011>;
233 def : DC<"IGDVAC", 0b000, 0b0111, 0b0110, 0b101>;
234 def : DC<"IGDSW", 0b000, 0b0111, 0b0110, 0b110>;
235 def : DC<"CGDSW", 0b000, 0b0111, 0b1010, 0b110>;
236 def : DC<"CIGDSW", 0b000, 0b0111, 0b1110, 0b110>;
237 def : DC<"CGDVAC", 0b011, 0b0111, 0b1010, 0b101>;
238 def : DC<"CGDVAP", 0b011, 0b0111, 0b1100, 0b101>;
239 def : DC<"CGDVADP", 0b011, 0b0111, 0b1101, 0b101>;
240 def : DC<"CIGDVAC", 0b011, 0b0111, 0b1110, 0b101>;
241 def : DC<"GZVA", 0b011, 0b0111, 0b0100, 0b100>;
244 let Requires = [{ {AArch64::FeatureMEC} }] in {
245 def : DC<"CIPAE", 0b100, 0b0111, 0b1110, 0b000>;
246 def : DC<"CIGDPAE", 0b100, 0b0111, 0b1110, 0b111>;
249 let Requires = [{ {AArch64::FeatureRME} }] in {
250 def : DC<"CIGDPAPA", 0b110, 0b0111, 0b1110, 0b101>;
251 def : DC<"CIPAPA", 0b110, 0b0111, 0b1110, 0b001>;
254 let Requires = [{ {AArch64::FeatureOCCMO} }] in {
255 // Outer cacheable CMO (FEAT_OCCMO)
256 def : DC<"CIVAOC", 0b011, 0b0111, 0b1111, 0b000>;
257 def : DC<"CVAOC", 0b011, 0b0111, 0b1011, 0b000>;
260 let Requires = [{ {AArch64::FeatureOCCMO, AArch64::FeatureMTE} }] in {
261 def : DC<"CIGDVAOC", 0b011, 0b0111, 0b1111, 0b111>;
262 def : DC<"CGDVAOC", 0b011, 0b0111, 0b1011, 0b111>;
265 //===----------------------------------------------------------------------===//
266 // IC (instruction cache maintenance) instruction options.
267 //===----------------------------------------------------------------------===//
269 class IC<string name, bits<3> op1, bits<4> crn, bits<4> crm, bits<3> op2,
273 let Encoding{13-11} = op1;
274 let Encoding{10-7} = crn;
275 let Encoding{6-3} = crm;
276 let Encoding{2-0} = op2;
277 bit NeedsReg = needsreg;
280 def ICValues : GenericEnum {
281 let FilterClass = "IC";
282 let NameField = "Name";
283 let ValueField = "Encoding";
286 def ICsList : GenericTable {
287 let FilterClass = "IC";
288 let Fields = ["Name", "Encoding", "NeedsReg"];
290 let PrimaryKey = ["Encoding"];
291 let PrimaryKeyName = "lookupICByEncoding";
294 def lookupICByName : SearchIndex {
299 def : IC<"IALLUIS", 0b000, 0b0111, 0b0001, 0b000, 0>;
300 def : IC<"IALLU", 0b000, 0b0111, 0b0101, 0b000, 0>;
301 def : IC<"IVAU", 0b011, 0b0111, 0b0101, 0b001, 1>;
303 //===----------------------------------------------------------------------===//
304 // ISB (instruction-fetch barrier) instruction options.
305 //===----------------------------------------------------------------------===//
307 class ISB<string name, bits<4> encoding> {
310 let Encoding = encoding;
313 def ISBValues : GenericEnum {
314 let FilterClass = "ISB";
315 let NameField = "Name";
316 let ValueField = "Encoding";
319 def ISBsList : GenericTable {
320 let FilterClass = "ISB";
321 let Fields = ["Name", "Encoding"];
323 let PrimaryKey = ["Encoding"];
324 let PrimaryKeyName = "lookupISBByEncoding";
327 def lookupISBByName : SearchIndex {
328 let Table = ISBsList;
332 def : ISB<"sy", 0xf>;
334 //===----------------------------------------------------------------------===//
335 // TSB (Trace synchronization barrier) instruction options.
336 //===----------------------------------------------------------------------===//
338 class TSB<string name, bits<4> encoding> {
341 let Encoding = encoding;
343 code Requires = [{ {AArch64::FeatureTRACEV8_4} }];
346 def TSBValues : GenericEnum {
347 let FilterClass = "TSB";
348 let NameField = "Name";
349 let ValueField = "Encoding";
352 def TSBsList : GenericTable {
353 let FilterClass = "TSB";
354 let Fields = ["Name", "Encoding", "Requires"];
356 let PrimaryKey = ["Encoding"];
357 let PrimaryKeyName = "lookupTSBByEncoding";
360 def lookupTSBByName : SearchIndex {
361 let Table = TSBsList;
365 def : TSB<"csync", 0>;
367 //===----------------------------------------------------------------------===//
368 // PRFM (prefetch) instruction options.
369 //===----------------------------------------------------------------------===//
371 class PRFM<string type, bits<2> type_encoding,
372 string target, bits<2> target_encoding,
373 string policy, bits<1> policy_encoding> {
374 string Name = type # target # policy;
376 let Encoding{4-3} = type_encoding;
377 let Encoding{2-1} = target_encoding;
378 let Encoding{0} = policy_encoding;
380 code Requires = [{ {} }];
383 def PRFMValues : GenericEnum {
384 let FilterClass = "PRFM";
385 let NameField = "Name";
386 let ValueField = "Encoding";
389 def PRFMsList : GenericTable {
390 let FilterClass = "PRFM";
391 let Fields = ["Name", "Encoding", "Requires"];
393 let PrimaryKey = ["Encoding"];
394 let PrimaryKeyName = "lookupPRFMByEncoding";
397 def lookupPRFMByName : SearchIndex {
398 let Table = PRFMsList;
402 def : PRFM<"pld", 0b00, "l1", 0b00, "keep", 0b0>;
403 def : PRFM<"pld", 0b00, "l1", 0b00, "strm", 0b1>;
404 def : PRFM<"pld", 0b00, "l2", 0b01, "keep", 0b0>;
405 def : PRFM<"pld", 0b00, "l2", 0b01, "strm", 0b1>;
406 def : PRFM<"pld", 0b00, "l3", 0b10, "keep", 0b0>;
407 def : PRFM<"pld", 0b00, "l3", 0b10, "strm", 0b1>;
408 let Requires = [{ {AArch64::FeaturePRFM_SLC} }] in {
409 def : PRFM<"pld", 0b00, "slc", 0b11, "keep", 0b0>;
410 def : PRFM<"pld", 0b00, "slc", 0b11, "strm", 0b1>;
412 def : PRFM<"pli", 0b01, "l1", 0b00, "keep", 0b0>;
413 def : PRFM<"pli", 0b01, "l1", 0b00, "strm", 0b1>;
414 def : PRFM<"pli", 0b01, "l2", 0b01, "keep", 0b0>;
415 def : PRFM<"pli", 0b01, "l2", 0b01, "strm", 0b1>;
416 def : PRFM<"pli", 0b01, "l3", 0b10, "keep", 0b0>;
417 def : PRFM<"pli", 0b01, "l3", 0b10, "strm", 0b1>;
418 let Requires = [{ {AArch64::FeaturePRFM_SLC} }] in {
419 def : PRFM<"pli", 0b01, "slc", 0b11, "keep", 0b0>;
420 def : PRFM<"pli", 0b01, "slc", 0b11, "strm", 0b1>;
422 def : PRFM<"pst", 0b10, "l1", 0b00, "keep", 0b0>;
423 def : PRFM<"pst", 0b10, "l1", 0b00, "strm", 0b1>;
424 def : PRFM<"pst", 0b10, "l2", 0b01, "keep", 0b0>;
425 def : PRFM<"pst", 0b10, "l2", 0b01, "strm", 0b1>;
426 def : PRFM<"pst", 0b10, "l3", 0b10, "keep", 0b0>;
427 def : PRFM<"pst", 0b10, "l3", 0b10, "strm", 0b1>;
428 let Requires = [{ {AArch64::FeaturePRFM_SLC} }] in {
429 def : PRFM<"pst", 0b10, "slc", 0b11, "keep", 0b0>;
430 def : PRFM<"pst", 0b10, "slc", 0b11, "strm", 0b1>;
433 //===----------------------------------------------------------------------===//
434 // SVE Prefetch instruction options.
435 //===----------------------------------------------------------------------===//
437 class SVEPRFM<string name, bits<4> encoding> {
440 let Encoding = encoding;
441 code Requires = [{ {} }];
444 def SVEPRFMValues : GenericEnum {
445 let FilterClass = "SVEPRFM";
446 let NameField = "Name";
447 let ValueField = "Encoding";
450 def SVEPRFMsList : GenericTable {
451 let FilterClass = "SVEPRFM";
452 let Fields = ["Name", "Encoding", "Requires"];
454 let PrimaryKey = ["Encoding"];
455 let PrimaryKeyName = "lookupSVEPRFMByEncoding";
458 def lookupSVEPRFMByName : SearchIndex {
459 let Table = SVEPRFMsList;
463 let Requires = [{ {AArch64::FeatureSVE} }] in {
464 def : SVEPRFM<"pldl1keep", 0x00>;
465 def : SVEPRFM<"pldl1strm", 0x01>;
466 def : SVEPRFM<"pldl2keep", 0x02>;
467 def : SVEPRFM<"pldl2strm", 0x03>;
468 def : SVEPRFM<"pldl3keep", 0x04>;
469 def : SVEPRFM<"pldl3strm", 0x05>;
470 def : SVEPRFM<"pstl1keep", 0x08>;
471 def : SVEPRFM<"pstl1strm", 0x09>;
472 def : SVEPRFM<"pstl2keep", 0x0a>;
473 def : SVEPRFM<"pstl2strm", 0x0b>;
474 def : SVEPRFM<"pstl3keep", 0x0c>;
475 def : SVEPRFM<"pstl3strm", 0x0d>;
478 //===----------------------------------------------------------------------===//
479 // RPRFM (prefetch) instruction options.
480 //===----------------------------------------------------------------------===//
482 class RPRFM<string name, bits<1> type_encoding, bits<5> policy_encoding> {
485 let Encoding{0} = type_encoding;
486 let Encoding{5-1} = policy_encoding;
487 code Requires = [{ {} }];
490 def RPRFMValues : GenericEnum {
491 let FilterClass = "RPRFM";
492 let NameField = "Name";
493 let ValueField = "Encoding";
496 def RPRFMsList : GenericTable {
497 let FilterClass = "RPRFM";
498 let Fields = ["Name", "Encoding", "Requires"];
501 def lookupRPRFMByName : SearchIndex {
502 let Table = RPRFMsList;
506 def lookupRPRFMByEncoding : SearchIndex {
507 let Table = RPRFMsList;
508 let Key = ["Encoding"];
511 def : RPRFM<"pldkeep", 0b0, 0b00000>;
512 def : RPRFM<"pstkeep", 0b1, 0b00000>;
513 def : RPRFM<"pldstrm", 0b0, 0b00010>;
514 def : RPRFM<"pststrm", 0b1, 0b00010>;
516 //===----------------------------------------------------------------------===//
517 // SVE Predicate patterns
518 //===----------------------------------------------------------------------===//
520 class SVEPREDPAT<string name, bits<5> encoding> {
523 let Encoding = encoding;
526 def SVEPREDPATValues : GenericEnum {
527 let FilterClass = "SVEPREDPAT";
528 let NameField = "Name";
529 let ValueField = "Encoding";
532 def SVEPREDPATsList : GenericTable {
533 let FilterClass = "SVEPREDPAT";
534 let Fields = ["Name", "Encoding"];
536 let PrimaryKey = ["Encoding"];
537 let PrimaryKeyName = "lookupSVEPREDPATByEncoding";
540 def lookupSVEPREDPATByName : SearchIndex {
541 let Table = SVEPREDPATsList;
545 def : SVEPREDPAT<"pow2", 0x00>;
546 def : SVEPREDPAT<"vl1", 0x01>;
547 def : SVEPREDPAT<"vl2", 0x02>;
548 def : SVEPREDPAT<"vl3", 0x03>;
549 def : SVEPREDPAT<"vl4", 0x04>;
550 def : SVEPREDPAT<"vl5", 0x05>;
551 def : SVEPREDPAT<"vl6", 0x06>;
552 def : SVEPREDPAT<"vl7", 0x07>;
553 def : SVEPREDPAT<"vl8", 0x08>;
554 def : SVEPREDPAT<"vl16", 0x09>;
555 def : SVEPREDPAT<"vl32", 0x0a>;
556 def : SVEPREDPAT<"vl64", 0x0b>;
557 def : SVEPREDPAT<"vl128", 0x0c>;
558 def : SVEPREDPAT<"vl256", 0x0d>;
559 def : SVEPREDPAT<"mul4", 0x1d>;
560 def : SVEPREDPAT<"mul3", 0x1e>;
561 def : SVEPREDPAT<"all", 0x1f>;
563 //===----------------------------------------------------------------------===//
564 // SVE Predicate-as-counter patterns
565 //===----------------------------------------------------------------------===//
567 class SVEVECLENSPECIFIER<string name, bits<1> encoding> {
570 let Encoding = encoding;
573 def SVEVECLENSPECIFIERValues : GenericEnum {
574 let FilterClass = "SVEVECLENSPECIFIER";
575 let NameField = "Name";
576 let ValueField = "Encoding";
579 def SVEVECLENSPECIFIERsList : GenericTable {
580 let FilterClass = "SVEVECLENSPECIFIER";
581 let Fields = ["Name", "Encoding"];
583 let PrimaryKey = ["Encoding"];
584 let PrimaryKeyName = "lookupSVEVECLENSPECIFIERByEncoding";
587 def lookupSVEVECLENSPECIFIERByName : SearchIndex {
588 let Table = SVEVECLENSPECIFIERsList;
592 def : SVEVECLENSPECIFIER<"vlx2", 0x0>;
593 def : SVEVECLENSPECIFIER<"vlx4", 0x1>;
595 //===----------------------------------------------------------------------===//
596 // Exact FP Immediates.
598 // These definitions are used to create a lookup table with FP Immediates that
599 // is used for a few instructions that only accept a limited set of exact FP
600 // immediates values.
601 //===----------------------------------------------------------------------===//
602 class ExactFPImm<string name, string repr, bits<4> enum > {
608 def ExactFPImmValues : GenericEnum {
609 let FilterClass = "ExactFPImm";
610 let NameField = "Name";
611 let ValueField = "Enum";
614 def ExactFPImmsList : GenericTable {
615 let FilterClass = "ExactFPImm";
616 let Fields = ["Enum", "Repr"];
619 def lookupExactFPImmByEnum : SearchIndex {
620 let Table = ExactFPImmsList;
624 def : ExactFPImm<"zero", "0.0", 0x0>;
625 def : ExactFPImm<"half", "0.5", 0x1>;
626 def : ExactFPImm<"one", "1.0", 0x2>;
627 def : ExactFPImm<"two", "2.0", 0x3>;
629 //===----------------------------------------------------------------------===//
630 // PState instruction options.
631 //===----------------------------------------------------------------------===//
633 class PStateImm0_15<string name, bits<3> op1, bits<3> op2> {
636 let Encoding{5-3} = op1;
637 let Encoding{2-0} = op2;
638 code Requires = [{ {} }];
641 def PStateImm0_15Values : GenericEnum {
642 let FilterClass = "PStateImm0_15";
643 let NameField = "Name";
644 let ValueField = "Encoding";
647 def PStateImm0_15sList : GenericTable {
648 let FilterClass = "PStateImm0_15";
649 let Fields = ["Name", "Encoding", "Requires"];
651 let PrimaryKey = ["Encoding"];
652 let PrimaryKeyName = "lookupPStateImm0_15ByEncoding";
655 def lookupPStateImm0_15ByName : SearchIndex {
656 let Table = PStateImm0_15sList;
660 class PStateImm0_1<string name, bits<3> op1, bits<3> op2, bits<3> crm_high> {
663 let Encoding{8-6} = crm_high;
664 let Encoding{5-3} = op1;
665 let Encoding{2-0} = op2;
666 code Requires = [{ {} }];
669 def PStateImm0_1Values : GenericEnum {
670 let FilterClass = "PStateImm0_1";
671 let NameField = "Name";
672 let ValueField = "Encoding";
675 def PStateImm0_1sList : GenericTable {
676 let FilterClass = "PStateImm0_1";
677 let Fields = ["Name", "Encoding", "Requires"];
679 let PrimaryKey = ["Encoding"];
680 let PrimaryKeyName = "lookupPStateImm0_1ByEncoding";
683 def lookupPStateImm0_1ByName : SearchIndex {
684 let Table = PStateImm0_1sList;
689 def : PStateImm0_15<"SPSel", 0b000, 0b101>;
690 def : PStateImm0_15<"DAIFSet", 0b011, 0b110>;
691 def : PStateImm0_15<"DAIFClr", 0b011, 0b111>;
692 // v8.1a "Privileged Access Never" extension-specific PStates
693 let Requires = [{ {AArch64::FeaturePAN} }] in
694 def : PStateImm0_15<"PAN", 0b000, 0b100>;
696 // v8.2a "User Access Override" extension-specific PStates
697 let Requires = [{ {AArch64::FeaturePsUAO} }] in
698 def : PStateImm0_15<"UAO", 0b000, 0b011>;
699 // v8.4a timing insensitivity of data processing instructions
700 let Requires = [{ {AArch64::FeatureDIT} }] in
701 def : PStateImm0_15<"DIT", 0b011, 0b010>;
702 // v8.5a Spectre Mitigation
703 let Requires = [{ {AArch64::FeatureSSBS} }] in
704 def : PStateImm0_15<"SSBS", 0b011, 0b001>;
705 // v8.5a Memory Tagging Extension
706 let Requires = [{ {AArch64::FeatureMTE} }] in
707 def : PStateImm0_15<"TCO", 0b011, 0b100>;
708 // v8.8a Non-Maskable Interrupts
709 let Requires = [{ {AArch64::FeatureNMI} }] in
710 def : PStateImm0_1<"ALLINT", 0b001, 0b000, 0b000>;
711 // v9.4a Exception-based event profiling
712 // Name, Op1, Op2, Crm_high
713 def : PStateImm0_1<"PM", 0b001, 0b000, 0b001>;
715 //===----------------------------------------------------------------------===//
716 // SVCR instruction options.
717 //===----------------------------------------------------------------------===//
719 class SVCR<string name, bits<3> encoding> {
722 let Encoding = encoding;
723 code Requires = [{ {} }];
726 def SVCRValues : GenericEnum {
727 let FilterClass = "SVCR";
728 let NameField = "Name";
729 let ValueField = "Encoding";
732 def SVCRsList : GenericTable {
733 let FilterClass = "SVCR";
734 let Fields = ["Name", "Encoding", "Requires"];
736 let PrimaryKey = ["Encoding"];
737 let PrimaryKeyName = "lookupSVCRByEncoding";
740 def lookupSVCRByName : SearchIndex {
741 let Table = SVCRsList;
745 let Requires = [{ {AArch64::FeatureSME} }] in {
746 def : SVCR<"SVCRSM", 0b001>;
747 def : SVCR<"SVCRZA", 0b010>;
748 def : SVCR<"SVCRSMZA", 0b011>;
751 //===----------------------------------------------------------------------===//
752 // PSB instruction options.
753 //===----------------------------------------------------------------------===//
755 class PSB<string name, bits<5> encoding> {
758 let Encoding = encoding;
761 def PSBValues : GenericEnum {
762 let FilterClass = "PSB";
763 let NameField = "Name";
764 let ValueField = "Encoding";
767 def PSBsList : GenericTable {
768 let FilterClass = "PSB";
769 let Fields = ["Name", "Encoding"];
771 let PrimaryKey = ["Encoding"];
772 let PrimaryKeyName = "lookupPSBByEncoding";
775 def lookupPSBByName : SearchIndex {
776 let Table = PSBsList;
780 def : PSB<"csync", 0x11>;
782 //===----------------------------------------------------------------------===//
783 // BTI instruction options.
784 //===----------------------------------------------------------------------===//
786 class BTI<string name, bits<3> encoding> {
789 let Encoding = encoding;
792 def BTIValues : GenericEnum {
793 let FilterClass = "BTI";
794 let NameField = "Name";
795 let ValueField = "Encoding";
798 def BTIsList : GenericTable {
799 let FilterClass = "BTI";
800 let Fields = ["Name", "Encoding"];
802 let PrimaryKey = ["Encoding"];
803 let PrimaryKeyName = "lookupBTIByEncoding";
806 def lookupBTIByName : SearchIndex {
807 let Table = BTIsList;
811 def : BTI<"c", 0b010>;
812 def : BTI<"j", 0b100>;
813 def : BTI<"jc", 0b110>;
815 //===----------------------------------------------------------------------===//
816 // TLBI (translation lookaside buffer invalidate) instruction options.
817 //===----------------------------------------------------------------------===//
819 class TLBIEntry<string name, bits<3> op1, bits<4> crn, bits<4> crm,
820 bits<3> op2, bit needsreg> {
823 let Encoding{13-11} = op1;
824 let Encoding{10-7} = crn;
825 let Encoding{6-3} = crm;
826 let Encoding{2-0} = op2;
827 bit NeedsReg = needsreg;
828 list<string> Requires = [];
829 list<string> ExtraRequires = [];
830 code RequiresStr = [{ { }] # !interleave(Requires # ExtraRequires, [{, }]) # [{ } }];
833 def TLBITable : GenericTable {
834 let FilterClass = "TLBIEntry";
835 let CppTypeName = "TLBI";
836 let Fields = ["Name", "Encoding", "NeedsReg", "RequiresStr"];
838 let PrimaryKey = ["Encoding"];
839 let PrimaryKeyName = "lookupTLBIByEncoding";
842 def lookupTLBIByName : SearchIndex {
843 let Table = TLBITable;
847 multiclass TLBI<string name, bits<3> op1, bits<4> crn, bits<4> crm,
848 bits<3> op2, bit needsreg = 1> {
849 def : TLBIEntry<name, op1, crn, crm, op2, needsreg>;
850 def : TLBIEntry<!strconcat(name, "nXS"), op1, crn, crm, op2, needsreg> {
852 let ExtraRequires = ["AArch64::FeatureXS"];
856 defm : TLBI<"IPAS2E1IS", 0b100, 0b1000, 0b0000, 0b001>;
857 defm : TLBI<"IPAS2LE1IS", 0b100, 0b1000, 0b0000, 0b101>;
858 defm : TLBI<"VMALLE1IS", 0b000, 0b1000, 0b0011, 0b000, 0>;
859 defm : TLBI<"ALLE2IS", 0b100, 0b1000, 0b0011, 0b000, 0>;
860 defm : TLBI<"ALLE3IS", 0b110, 0b1000, 0b0011, 0b000, 0>;
861 defm : TLBI<"VAE1IS", 0b000, 0b1000, 0b0011, 0b001>;
862 defm : TLBI<"VAE2IS", 0b100, 0b1000, 0b0011, 0b001>;
863 defm : TLBI<"VAE3IS", 0b110, 0b1000, 0b0011, 0b001>;
864 defm : TLBI<"ASIDE1IS", 0b000, 0b1000, 0b0011, 0b010>;
865 defm : TLBI<"VAAE1IS", 0b000, 0b1000, 0b0011, 0b011>;
866 defm : TLBI<"ALLE1IS", 0b100, 0b1000, 0b0011, 0b100, 0>;
867 defm : TLBI<"VALE1IS", 0b000, 0b1000, 0b0011, 0b101>;
868 defm : TLBI<"VALE2IS", 0b100, 0b1000, 0b0011, 0b101>;
869 defm : TLBI<"VALE3IS", 0b110, 0b1000, 0b0011, 0b101>;
870 defm : TLBI<"VMALLS12E1IS", 0b100, 0b1000, 0b0011, 0b110, 0>;
871 defm : TLBI<"VAALE1IS", 0b000, 0b1000, 0b0011, 0b111>;
872 defm : TLBI<"IPAS2E1", 0b100, 0b1000, 0b0100, 0b001>;
873 defm : TLBI<"IPAS2LE1", 0b100, 0b1000, 0b0100, 0b101>;
874 defm : TLBI<"VMALLE1", 0b000, 0b1000, 0b0111, 0b000, 0>;
875 defm : TLBI<"ALLE2", 0b100, 0b1000, 0b0111, 0b000, 0>;
876 defm : TLBI<"ALLE3", 0b110, 0b1000, 0b0111, 0b000, 0>;
877 defm : TLBI<"VAE1", 0b000, 0b1000, 0b0111, 0b001>;
878 defm : TLBI<"VAE2", 0b100, 0b1000, 0b0111, 0b001>;
879 defm : TLBI<"VAE3", 0b110, 0b1000, 0b0111, 0b001>;
880 defm : TLBI<"ASIDE1", 0b000, 0b1000, 0b0111, 0b010>;
881 defm : TLBI<"VAAE1", 0b000, 0b1000, 0b0111, 0b011>;
882 defm : TLBI<"ALLE1", 0b100, 0b1000, 0b0111, 0b100, 0>;
883 defm : TLBI<"VALE1", 0b000, 0b1000, 0b0111, 0b101>;
884 defm : TLBI<"VALE2", 0b100, 0b1000, 0b0111, 0b101>;
885 defm : TLBI<"VALE3", 0b110, 0b1000, 0b0111, 0b101>;
886 defm : TLBI<"VMALLS12E1", 0b100, 0b1000, 0b0111, 0b110, 0>;
887 defm : TLBI<"VAALE1", 0b000, 0b1000, 0b0111, 0b111>;
889 // Armv8.4-A Translation Lookaside Buffer Instructions (TLBI)
890 let Requires = ["AArch64::FeatureTLB_RMI"] in {
891 // Armv8.4-A Outer Sharable TLB Maintenance instructions:
893 defm : TLBI<"VMALLE1OS", 0b000, 0b1000, 0b0001, 0b000, 0>;
894 defm : TLBI<"VAE1OS", 0b000, 0b1000, 0b0001, 0b001>;
895 defm : TLBI<"ASIDE1OS", 0b000, 0b1000, 0b0001, 0b010>;
896 defm : TLBI<"VAAE1OS", 0b000, 0b1000, 0b0001, 0b011>;
897 defm : TLBI<"VALE1OS", 0b000, 0b1000, 0b0001, 0b101>;
898 defm : TLBI<"VAALE1OS", 0b000, 0b1000, 0b0001, 0b111>;
899 defm : TLBI<"IPAS2E1OS", 0b100, 0b1000, 0b0100, 0b000>;
900 defm : TLBI<"IPAS2LE1OS", 0b100, 0b1000, 0b0100, 0b100>;
901 defm : TLBI<"VAE2OS", 0b100, 0b1000, 0b0001, 0b001>;
902 defm : TLBI<"VALE2OS", 0b100, 0b1000, 0b0001, 0b101>;
903 defm : TLBI<"VMALLS12E1OS", 0b100, 0b1000, 0b0001, 0b110, 0>;
904 defm : TLBI<"VAE3OS", 0b110, 0b1000, 0b0001, 0b001>;
905 defm : TLBI<"VALE3OS", 0b110, 0b1000, 0b0001, 0b101>;
906 defm : TLBI<"ALLE2OS", 0b100, 0b1000, 0b0001, 0b000, 0>;
907 defm : TLBI<"ALLE1OS", 0b100, 0b1000, 0b0001, 0b100, 0>;
908 defm : TLBI<"ALLE3OS", 0b110, 0b1000, 0b0001, 0b000, 0>;
910 // Armv8.4-A TLB Range Maintenance instructions:
912 defm : TLBI<"RVAE1", 0b000, 0b1000, 0b0110, 0b001>;
913 defm : TLBI<"RVAAE1", 0b000, 0b1000, 0b0110, 0b011>;
914 defm : TLBI<"RVALE1", 0b000, 0b1000, 0b0110, 0b101>;
915 defm : TLBI<"RVAALE1", 0b000, 0b1000, 0b0110, 0b111>;
916 defm : TLBI<"RVAE1IS", 0b000, 0b1000, 0b0010, 0b001>;
917 defm : TLBI<"RVAAE1IS", 0b000, 0b1000, 0b0010, 0b011>;
918 defm : TLBI<"RVALE1IS", 0b000, 0b1000, 0b0010, 0b101>;
919 defm : TLBI<"RVAALE1IS", 0b000, 0b1000, 0b0010, 0b111>;
920 defm : TLBI<"RVAE1OS", 0b000, 0b1000, 0b0101, 0b001>;
921 defm : TLBI<"RVAAE1OS", 0b000, 0b1000, 0b0101, 0b011>;
922 defm : TLBI<"RVALE1OS", 0b000, 0b1000, 0b0101, 0b101>;
923 defm : TLBI<"RVAALE1OS", 0b000, 0b1000, 0b0101, 0b111>;
924 defm : TLBI<"RIPAS2E1IS", 0b100, 0b1000, 0b0000, 0b010>;
925 defm : TLBI<"RIPAS2LE1IS", 0b100, 0b1000, 0b0000, 0b110>;
926 defm : TLBI<"RIPAS2E1", 0b100, 0b1000, 0b0100, 0b010>;
927 defm : TLBI<"RIPAS2LE1", 0b100, 0b1000, 0b0100, 0b110>;
928 defm : TLBI<"RIPAS2E1OS", 0b100, 0b1000, 0b0100, 0b011>;
929 defm : TLBI<"RIPAS2LE1OS", 0b100, 0b1000, 0b0100, 0b111>;
930 defm : TLBI<"RVAE2", 0b100, 0b1000, 0b0110, 0b001>;
931 defm : TLBI<"RVALE2", 0b100, 0b1000, 0b0110, 0b101>;
932 defm : TLBI<"RVAE2IS", 0b100, 0b1000, 0b0010, 0b001>;
933 defm : TLBI<"RVALE2IS", 0b100, 0b1000, 0b0010, 0b101>;
934 defm : TLBI<"RVAE2OS", 0b100, 0b1000, 0b0101, 0b001>;
935 defm : TLBI<"RVALE2OS", 0b100, 0b1000, 0b0101, 0b101>;
936 defm : TLBI<"RVAE3", 0b110, 0b1000, 0b0110, 0b001>;
937 defm : TLBI<"RVALE3", 0b110, 0b1000, 0b0110, 0b101>;
938 defm : TLBI<"RVAE3IS", 0b110, 0b1000, 0b0010, 0b001>;
939 defm : TLBI<"RVALE3IS", 0b110, 0b1000, 0b0010, 0b101>;
940 defm : TLBI<"RVAE3OS", 0b110, 0b1000, 0b0101, 0b001>;
941 defm : TLBI<"RVALE3OS", 0b110, 0b1000, 0b0101, 0b101>;
944 // Armv9-A Realm Management Extention TLBI Instructions
945 let Requires = ["AArch64::FeatureRME"] in {
946 defm : TLBI<"RPAOS", 0b110, 0b1000, 0b0100, 0b011>;
947 defm : TLBI<"RPALOS", 0b110, 0b1000, 0b0100, 0b111>;
948 defm : TLBI<"PAALLOS", 0b110, 0b1000, 0b0001, 0b100, 0>;
949 defm : TLBI<"PAALL", 0b110, 0b1000, 0b0111, 0b100, 0>;
952 // Armv9.5-A TLBI VMALL for Dirty State
953 let Requires = ["AArch64::FeatureTLBIW"] in {
954 // op1, CRn, CRm, op2, needsreg
955 defm : TLBI<"VMALLWS2E1", 0b100, 0b1000, 0b0110, 0b010, 0>;
956 defm : TLBI<"VMALLWS2E1IS", 0b100, 0b1000, 0b0010, 0b010, 0>;
957 defm : TLBI<"VMALLWS2E1OS", 0b100, 0b1000, 0b0101, 0b010, 0>;
960 //===----------------------------------------------------------------------===//
961 // MRS/MSR (system register read/write) instruction options.
962 //===----------------------------------------------------------------------===//
964 class SysReg<string name, bits<2> op0, bits<3> op1, bits<4> crn, bits<4> crm,
968 let Encoding{15-14} = op0;
969 let Encoding{13-11} = op1;
970 let Encoding{10-7} = crn;
971 let Encoding{6-3} = crm;
972 let Encoding{2-0} = op2;
975 code Requires = [{ {} }];
978 def SysRegValues : GenericEnum {
979 let FilterClass = "SysReg";
980 let NameField = "Name";
981 let ValueField = "Encoding";
984 def SysRegsList : GenericTable {
985 let FilterClass = "SysReg";
986 let Fields = ["Name", "Encoding", "Readable", "Writeable", "Requires"];
988 let PrimaryKey = ["Encoding"];
989 let PrimaryKeyName = "lookupSysRegByEncoding";
990 let PrimaryKeyReturnRange = true;
993 def lookupSysRegByName : SearchIndex {
994 let Table = SysRegsList;
998 class RWSysReg<string name, bits<2> op0, bits<3> op1, bits<4> crn, bits<4> crm,
1000 : SysReg<name, op0, op1, crn, crm, op2> {
1005 class ROSysReg<string name, bits<2> op0, bits<3> op1, bits<4> crn, bits<4> crm,
1007 : SysReg<name, op0, op1, crn, crm, op2> {
1012 class WOSysReg<string name, bits<2> op0, bits<3> op1, bits<4> crn, bits<4> crm,
1014 : SysReg<name, op0, op1, crn, crm, op2> {
1019 //===----------------------
1021 //===----------------------
1023 // Op0 Op1 CRn CRm Op2
1024 def : ROSysReg<"MDCCSR_EL0", 0b10, 0b011, 0b0000, 0b0001, 0b000>;
1025 def : ROSysReg<"DBGDTRRX_EL0", 0b10, 0b011, 0b0000, 0b0101, 0b000>;
1026 def : ROSysReg<"MDRAR_EL1", 0b10, 0b000, 0b0001, 0b0000, 0b000>;
1027 def : ROSysReg<"OSLSR_EL1", 0b10, 0b000, 0b0001, 0b0001, 0b100>;
1028 def : ROSysReg<"DBGAUTHSTATUS_EL1", 0b10, 0b000, 0b0111, 0b1110, 0b110>;
1029 def : ROSysReg<"PMCEID0_EL0", 0b11, 0b011, 0b1001, 0b1100, 0b110>;
1030 def : ROSysReg<"PMCEID1_EL0", 0b11, 0b011, 0b1001, 0b1100, 0b111>;
1031 def : ROSysReg<"PMMIR_EL1", 0b11, 0b000, 0b1001, 0b1110, 0b110>;
1032 def : ROSysReg<"MIDR_EL1", 0b11, 0b000, 0b0000, 0b0000, 0b000>;
1033 def : ROSysReg<"CCSIDR_EL1", 0b11, 0b001, 0b0000, 0b0000, 0b000>;
1035 //v8.3 CCIDX - extending the CCsIDr number of sets
1036 def : ROSysReg<"CCSIDR2_EL1", 0b11, 0b001, 0b0000, 0b0000, 0b010> {
1037 let Requires = [{ {AArch64::FeatureCCIDX} }];
1039 def : ROSysReg<"CLIDR_EL1", 0b11, 0b001, 0b0000, 0b0000, 0b001>;
1040 def : ROSysReg<"CTR_EL0", 0b11, 0b011, 0b0000, 0b0000, 0b001>;
1041 def : ROSysReg<"MPIDR_EL1", 0b11, 0b000, 0b0000, 0b0000, 0b101>;
1042 def : ROSysReg<"REVIDR_EL1", 0b11, 0b000, 0b0000, 0b0000, 0b110>;
1043 def : ROSysReg<"AIDR_EL1", 0b11, 0b001, 0b0000, 0b0000, 0b111>;
1044 def : ROSysReg<"DCZID_EL0", 0b11, 0b011, 0b0000, 0b0000, 0b111>;
1045 def : ROSysReg<"ID_PFR0_EL1", 0b11, 0b000, 0b0000, 0b0001, 0b000>;
1046 def : ROSysReg<"ID_PFR1_EL1", 0b11, 0b000, 0b0000, 0b0001, 0b001>;
1047 def : ROSysReg<"ID_PFR2_EL1", 0b11, 0b000, 0b0000, 0b0011, 0b100> {
1048 let Requires = [{ {AArch64::FeatureSpecRestrict} }];
1050 def : ROSysReg<"ID_DFR0_EL1", 0b11, 0b000, 0b0000, 0b0001, 0b010>;
1051 def : ROSysReg<"ID_DFR1_EL1", 0b11, 0b000, 0b0000, 0b0011, 0b101>;
1052 def : ROSysReg<"ID_AFR0_EL1", 0b11, 0b000, 0b0000, 0b0001, 0b011>;
1053 def : ROSysReg<"ID_MMFR0_EL1", 0b11, 0b000, 0b0000, 0b0001, 0b100>;
1054 def : ROSysReg<"ID_MMFR1_EL1", 0b11, 0b000, 0b0000, 0b0001, 0b101>;
1055 def : ROSysReg<"ID_MMFR2_EL1", 0b11, 0b000, 0b0000, 0b0001, 0b110>;
1056 def : ROSysReg<"ID_MMFR3_EL1", 0b11, 0b000, 0b0000, 0b0001, 0b111>;
1057 def : ROSysReg<"ID_ISAR0_EL1", 0b11, 0b000, 0b0000, 0b0010, 0b000>;
1058 def : ROSysReg<"ID_ISAR1_EL1", 0b11, 0b000, 0b0000, 0b0010, 0b001>;
1059 def : ROSysReg<"ID_ISAR2_EL1", 0b11, 0b000, 0b0000, 0b0010, 0b010>;
1060 def : ROSysReg<"ID_ISAR3_EL1", 0b11, 0b000, 0b0000, 0b0010, 0b011>;
1061 def : ROSysReg<"ID_ISAR4_EL1", 0b11, 0b000, 0b0000, 0b0010, 0b100>;
1062 def : ROSysReg<"ID_ISAR5_EL1", 0b11, 0b000, 0b0000, 0b0010, 0b101>;
1063 def : ROSysReg<"ID_ISAR6_EL1", 0b11, 0b000, 0b0000, 0b0010, 0b111> {
1064 let Requires = [{ {AArch64::HasV8_2aOps} }];
1066 def : ROSysReg<"ID_AA64PFR0_EL1", 0b11, 0b000, 0b0000, 0b0100, 0b000>;
1067 def : ROSysReg<"ID_AA64PFR1_EL1", 0b11, 0b000, 0b0000, 0b0100, 0b001>;
1068 def : ROSysReg<"ID_AA64PFR2_EL1", 0b11, 0b000, 0b0000, 0b0100, 0b010>;
1069 def : ROSysReg<"ID_AA64DFR0_EL1", 0b11, 0b000, 0b0000, 0b0101, 0b000>;
1070 def : ROSysReg<"ID_AA64DFR1_EL1", 0b11, 0b000, 0b0000, 0b0101, 0b001>;
1071 def : ROSysReg<"ID_AA64DFR2_EL1", 0b11, 0b000, 0b0000, 0b0101, 0b010>;
1072 def : ROSysReg<"ID_AA64AFR0_EL1", 0b11, 0b000, 0b0000, 0b0101, 0b100>;
1073 def : ROSysReg<"ID_AA64AFR1_EL1", 0b11, 0b000, 0b0000, 0b0101, 0b101>;
1074 def : ROSysReg<"ID_AA64ISAR0_EL1", 0b11, 0b000, 0b0000, 0b0110, 0b000>;
1075 def : ROSysReg<"ID_AA64ISAR1_EL1", 0b11, 0b000, 0b0000, 0b0110, 0b001>;
1076 def : ROSysReg<"ID_AA64ISAR2_EL1", 0b11, 0b000, 0b0000, 0b0110, 0b010>;
1077 def : ROSysReg<"ID_AA64ISAR3_EL1", 0b11, 0b000, 0b0000, 0b0110, 0b011>;
1078 def : ROSysReg<"ID_AA64MMFR0_EL1", 0b11, 0b000, 0b0000, 0b0111, 0b000>;
1079 def : ROSysReg<"ID_AA64MMFR1_EL1", 0b11, 0b000, 0b0000, 0b0111, 0b001>;
1080 def : ROSysReg<"ID_AA64MMFR2_EL1", 0b11, 0b000, 0b0000, 0b0111, 0b010>;
1081 def : ROSysReg<"ID_AA64MMFR3_EL1", 0b11, 0b000, 0b0000, 0b0111, 0b011>;
1082 def : ROSysReg<"ID_AA64MMFR4_EL1", 0b11, 0b000, 0b0000, 0b0111, 0b100>;
1083 def : ROSysReg<"MVFR0_EL1", 0b11, 0b000, 0b0000, 0b0011, 0b000>;
1084 def : ROSysReg<"MVFR1_EL1", 0b11, 0b000, 0b0000, 0b0011, 0b001>;
1085 def : ROSysReg<"MVFR2_EL1", 0b11, 0b000, 0b0000, 0b0011, 0b010>;
1086 def : ROSysReg<"RVBAR_EL1", 0b11, 0b000, 0b1100, 0b0000, 0b001>;
1087 def : ROSysReg<"RVBAR_EL2", 0b11, 0b100, 0b1100, 0b0000, 0b001>;
1088 def : ROSysReg<"RVBAR_EL3", 0b11, 0b110, 0b1100, 0b0000, 0b001>;
1089 def : ROSysReg<"ISR_EL1", 0b11, 0b000, 0b1100, 0b0001, 0b000>;
1090 def : ROSysReg<"CNTPCT_EL0", 0b11, 0b011, 0b1110, 0b0000, 0b001>;
1091 def : ROSysReg<"CNTVCT_EL0", 0b11, 0b011, 0b1110, 0b0000, 0b010>;
1092 def : ROSysReg<"ID_MMFR4_EL1", 0b11, 0b000, 0b0000, 0b0010, 0b110>;
1093 def : ROSysReg<"ID_MMFR5_EL1", 0b11, 0b000, 0b0000, 0b0011, 0b110>;
1096 // Op0 Op1 CRn CRm Op2
1097 def : ROSysReg<"TRCSTATR", 0b10, 0b001, 0b0000, 0b0011, 0b000>;
1098 def : ROSysReg<"TRCIDR8", 0b10, 0b001, 0b0000, 0b0000, 0b110>;
1099 def : ROSysReg<"TRCIDR9", 0b10, 0b001, 0b0000, 0b0001, 0b110>;
1100 def : ROSysReg<"TRCIDR10", 0b10, 0b001, 0b0000, 0b0010, 0b110>;
1101 def : ROSysReg<"TRCIDR11", 0b10, 0b001, 0b0000, 0b0011, 0b110>;
1102 def : ROSysReg<"TRCIDR12", 0b10, 0b001, 0b0000, 0b0100, 0b110>;
1103 def : ROSysReg<"TRCIDR13", 0b10, 0b001, 0b0000, 0b0101, 0b110>;
1104 def : ROSysReg<"TRCIDR0", 0b10, 0b001, 0b0000, 0b1000, 0b111>;
1105 def : ROSysReg<"TRCIDR1", 0b10, 0b001, 0b0000, 0b1001, 0b111>;
1106 def : ROSysReg<"TRCIDR2", 0b10, 0b001, 0b0000, 0b1010, 0b111>;
1107 def : ROSysReg<"TRCIDR3", 0b10, 0b001, 0b0000, 0b1011, 0b111>;
1108 def : ROSysReg<"TRCIDR4", 0b10, 0b001, 0b0000, 0b1100, 0b111>;
1109 def : ROSysReg<"TRCIDR5", 0b10, 0b001, 0b0000, 0b1101, 0b111>;
1110 def : ROSysReg<"TRCIDR6", 0b10, 0b001, 0b0000, 0b1110, 0b111>;
1111 def : ROSysReg<"TRCIDR7", 0b10, 0b001, 0b0000, 0b1111, 0b111>;
1112 def : ROSysReg<"TRCOSLSR", 0b10, 0b001, 0b0001, 0b0001, 0b100>;
1113 def : ROSysReg<"TRCPDSR", 0b10, 0b001, 0b0001, 0b0101, 0b100>;
1114 def : ROSysReg<"TRCDEVAFF0", 0b10, 0b001, 0b0111, 0b1010, 0b110>;
1115 def : ROSysReg<"TRCDEVAFF1", 0b10, 0b001, 0b0111, 0b1011, 0b110>;
1116 def : ROSysReg<"TRCLSR", 0b10, 0b001, 0b0111, 0b1101, 0b110>;
1117 def : ROSysReg<"TRCAUTHSTATUS", 0b10, 0b001, 0b0111, 0b1110, 0b110>;
1118 def : ROSysReg<"TRCDEVARCH", 0b10, 0b001, 0b0111, 0b1111, 0b110>;
1119 def : ROSysReg<"TRCDEVID", 0b10, 0b001, 0b0111, 0b0010, 0b111>;
1120 def : ROSysReg<"TRCDEVTYPE", 0b10, 0b001, 0b0111, 0b0011, 0b111>;
1121 def : ROSysReg<"TRCPIDR4", 0b10, 0b001, 0b0111, 0b0100, 0b111>;
1122 def : ROSysReg<"TRCPIDR5", 0b10, 0b001, 0b0111, 0b0101, 0b111>;
1123 def : ROSysReg<"TRCPIDR6", 0b10, 0b001, 0b0111, 0b0110, 0b111>;
1124 def : ROSysReg<"TRCPIDR7", 0b10, 0b001, 0b0111, 0b0111, 0b111>;
1125 def : ROSysReg<"TRCPIDR0", 0b10, 0b001, 0b0111, 0b1000, 0b111>;
1126 def : ROSysReg<"TRCPIDR1", 0b10, 0b001, 0b0111, 0b1001, 0b111>;
1127 def : ROSysReg<"TRCPIDR2", 0b10, 0b001, 0b0111, 0b1010, 0b111>;
1128 def : ROSysReg<"TRCPIDR3", 0b10, 0b001, 0b0111, 0b1011, 0b111>;
1129 def : ROSysReg<"TRCCIDR0", 0b10, 0b001, 0b0111, 0b1100, 0b111>;
1130 def : ROSysReg<"TRCCIDR1", 0b10, 0b001, 0b0111, 0b1101, 0b111>;
1131 def : ROSysReg<"TRCCIDR2", 0b10, 0b001, 0b0111, 0b1110, 0b111>;
1132 def : ROSysReg<"TRCCIDR3", 0b10, 0b001, 0b0111, 0b1111, 0b111>;
1135 // Op0 Op1 CRn CRm Op2
1136 def : ROSysReg<"ICC_IAR1_EL1", 0b11, 0b000, 0b1100, 0b1100, 0b000>;
1137 def : ROSysReg<"ICC_IAR0_EL1", 0b11, 0b000, 0b1100, 0b1000, 0b000>;
1138 def : ROSysReg<"ICC_HPPIR1_EL1", 0b11, 0b000, 0b1100, 0b1100, 0b010>;
1139 def : ROSysReg<"ICC_HPPIR0_EL1", 0b11, 0b000, 0b1100, 0b1000, 0b010>;
1140 def : ROSysReg<"ICC_RPR_EL1", 0b11, 0b000, 0b1100, 0b1011, 0b011>;
1141 def : ROSysReg<"ICH_VTR_EL2", 0b11, 0b100, 0b1100, 0b1011, 0b001>;
1142 def : ROSysReg<"ICH_EISR_EL2", 0b11, 0b100, 0b1100, 0b1011, 0b011>;
1143 def : ROSysReg<"ICH_ELRSR_EL2", 0b11, 0b100, 0b1100, 0b1011, 0b101>;
1145 // SVE control registers
1146 // Op0 Op1 CRn CRm Op2
1147 let Requires = [{ {AArch64::FeatureSVE} }] in {
1148 def : ROSysReg<"ID_AA64ZFR0_EL1", 0b11, 0b000, 0b0000, 0b0100, 0b100>;
1151 // v8.1a "Limited Ordering Regions" extension-specific system register
1152 // Op0 Op1 CRn CRm Op2
1153 let Requires = [{ {AArch64::FeatureLOR} }] in
1154 def : ROSysReg<"LORID_EL1", 0b11, 0b000, 0b1010, 0b0100, 0b111>;
1156 // v8.2a "RAS extension" registers
1157 // Op0 Op1 CRn CRm Op2
1158 let Requires = [{ {AArch64::FeatureRAS} }] in {
1159 def : ROSysReg<"ERRIDR_EL1", 0b11, 0b000, 0b0101, 0b0011, 0b000>;
1160 def : ROSysReg<"ERXFR_EL1", 0b11, 0b000, 0b0101, 0b0100, 0b000>;
1163 // v8.5a "random number" registers
1164 // Op0 Op1 CRn CRm Op2
1165 let Requires = [{ {AArch64::FeatureRandGen} }] in {
1166 def : ROSysReg<"RNDR", 0b11, 0b011, 0b0010, 0b0100, 0b000>;
1167 def : ROSysReg<"RNDRRS", 0b11, 0b011, 0b0010, 0b0100, 0b001>;
1170 // v8.5a Software Context Number registers
1171 let Requires = [{ {AArch64::FeatureSpecRestrict} }] in {
1172 def : RWSysReg<"SCXTNUM_EL0", 0b11, 0b011, 0b1101, 0b0000, 0b111>;
1173 def : RWSysReg<"SCXTNUM_EL1", 0b11, 0b000, 0b1101, 0b0000, 0b111>;
1174 def : RWSysReg<"SCXTNUM_EL2", 0b11, 0b100, 0b1101, 0b0000, 0b111>;
1175 def : RWSysReg<"SCXTNUM_EL3", 0b11, 0b110, 0b1101, 0b0000, 0b111>;
1176 def : RWSysReg<"SCXTNUM_EL12", 0b11, 0b101, 0b1101, 0b0000, 0b111>;
1179 // v9a Realm Management Extension registers
1180 let Requires = [{ {AArch64::FeatureRME} }] in {
1181 def : RWSysReg<"GPCCR_EL3", 0b11, 0b110, 0b0010, 0b0001, 0b110>;
1182 def : RWSysReg<"GPTBR_EL3", 0b11, 0b110, 0b0010, 0b0001, 0b100>;
1184 // MFAR_EL3 is part of both FEAT_RME and FEAT_PFAR (further below). The latter
1185 // is unconditional so this register has to be too.
1186 def : RWSysReg<"MFAR_EL3", 0b11, 0b110, 0b0110, 0b0000, 0b101>;
1188 // v9a Memory Encryption Contexts Extension registers
1189 let Requires = [{ {AArch64::FeatureMEC} }] in {
1190 def : ROSysReg<"MECIDR_EL2", 0b11, 0b100, 0b1010, 0b1000, 0b111>;
1191 def : RWSysReg<"MECID_P0_EL2", 0b11, 0b100, 0b1010, 0b1000, 0b000>;
1192 def : RWSysReg<"MECID_A0_EL2", 0b11, 0b100, 0b1010, 0b1000, 0b001>;
1193 def : RWSysReg<"MECID_P1_EL2", 0b11, 0b100, 0b1010, 0b1000, 0b010>;
1194 def : RWSysReg<"MECID_A1_EL2", 0b11, 0b100, 0b1010, 0b1000, 0b011>;
1195 def : RWSysReg<"VMECID_P_EL2", 0b11, 0b100, 0b1010, 0b1001, 0b000>;
1196 def : RWSysReg<"VMECID_A_EL2", 0b11, 0b100, 0b1010, 0b1001, 0b001>;
1197 def : RWSysReg<"MECID_RL_A_EL3", 0b11, 0b110, 0b1010, 0b1010, 0b001>;
1200 // v9-a Scalable Matrix Extension (SME) registers
1201 // Op0 Op1 CRn CRm Op2
1202 let Requires = [{ {AArch64::FeatureSME} }] in {
1203 def : ROSysReg<"ID_AA64SMFR0_EL1", 0b11, 0b000, 0b0000, 0b0100, 0b101>;
1206 //===----------------------
1208 //===----------------------
1210 // Op0 Op1 CRn CRm Op2
1211 def : WOSysReg<"DBGDTRTX_EL0", 0b10, 0b011, 0b0000, 0b0101, 0b000>;
1212 def : WOSysReg<"OSLAR_EL1", 0b10, 0b000, 0b0001, 0b0000, 0b100>;
1213 def : WOSysReg<"PMSWINC_EL0", 0b11, 0b011, 0b1001, 0b1100, 0b100>;
1216 // Op0 Op1 CRn CRm Op2
1217 def : WOSysReg<"TRCOSLAR", 0b10, 0b001, 0b0001, 0b0000, 0b100>;
1218 def : WOSysReg<"TRCLAR", 0b10, 0b001, 0b0111, 0b1100, 0b110>;
1221 // Op0 Op1 CRn CRm Op2
1222 def : WOSysReg<"ICC_EOIR1_EL1", 0b11, 0b000, 0b1100, 0b1100, 0b001>;
1223 def : WOSysReg<"ICC_EOIR0_EL1", 0b11, 0b000, 0b1100, 0b1000, 0b001>;
1224 def : WOSysReg<"ICC_DIR_EL1", 0b11, 0b000, 0b1100, 0b1011, 0b001>;
1225 def : WOSysReg<"ICC_SGI1R_EL1", 0b11, 0b000, 0b1100, 0b1011, 0b101>;
1226 def : WOSysReg<"ICC_ASGI1R_EL1", 0b11, 0b000, 0b1100, 0b1011, 0b110>;
1227 def : WOSysReg<"ICC_SGI0R_EL1", 0b11, 0b000, 0b1100, 0b1011, 0b111>;
1229 //===----------------------
1231 //===----------------------
1233 // Op0 Op1 CRn CRm Op2
1234 def : RWSysReg<"OSDTRRX_EL1", 0b10, 0b000, 0b0000, 0b0000, 0b010>;
1235 def : RWSysReg<"OSDTRTX_EL1", 0b10, 0b000, 0b0000, 0b0011, 0b010>;
1236 def : RWSysReg<"TEECR32_EL1", 0b10, 0b010, 0b0000, 0b0000, 0b000>;
1237 def : RWSysReg<"MDCCINT_EL1", 0b10, 0b000, 0b0000, 0b0010, 0b000>;
1238 def : RWSysReg<"MDSCR_EL1", 0b10, 0b000, 0b0000, 0b0010, 0b010>;
1239 def : RWSysReg<"DBGDTR_EL0", 0b10, 0b011, 0b0000, 0b0100, 0b000>;
1240 def : RWSysReg<"OSECCR_EL1", 0b10, 0b000, 0b0000, 0b0110, 0b010>;
1241 def : RWSysReg<"DBGVCR32_EL2", 0b10, 0b100, 0b0000, 0b0111, 0b000>;
1242 foreach n = 0-15 in {
1243 defvar nb = !cast<bits<4>>(n);
1244 // Op0 Op1 CRn CRm Op2
1245 def : RWSysReg<"DBGBVR"#n#"_EL1", 0b10, 0b000, 0b0000, nb, 0b100>;
1246 def : RWSysReg<"DBGBCR"#n#"_EL1", 0b10, 0b000, 0b0000, nb, 0b101>;
1247 def : RWSysReg<"DBGWVR"#n#"_EL1", 0b10, 0b000, 0b0000, nb, 0b110>;
1248 def : RWSysReg<"DBGWCR"#n#"_EL1", 0b10, 0b000, 0b0000, nb, 0b111>;
1250 // Op0 Op1 CRn CRm Op2
1251 def : RWSysReg<"TEEHBR32_EL1", 0b10, 0b010, 0b0001, 0b0000, 0b000>;
1252 def : RWSysReg<"OSDLR_EL1", 0b10, 0b000, 0b0001, 0b0011, 0b100>;
1253 def : RWSysReg<"DBGPRCR_EL1", 0b10, 0b000, 0b0001, 0b0100, 0b100>;
1254 def : RWSysReg<"DBGCLAIMSET_EL1", 0b10, 0b000, 0b0111, 0b1000, 0b110>;
1255 def : RWSysReg<"DBGCLAIMCLR_EL1", 0b10, 0b000, 0b0111, 0b1001, 0b110>;
1256 def : RWSysReg<"CSSELR_EL1", 0b11, 0b010, 0b0000, 0b0000, 0b000>;
1257 def : RWSysReg<"VPIDR_EL2", 0b11, 0b100, 0b0000, 0b0000, 0b000>;
1258 def : RWSysReg<"VMPIDR_EL2", 0b11, 0b100, 0b0000, 0b0000, 0b101>;
1259 def : RWSysReg<"CPACR_EL1", 0b11, 0b000, 0b0001, 0b0000, 0b010>;
1260 def : RWSysReg<"SCTLR_EL1", 0b11, 0b000, 0b0001, 0b0000, 0b000>;
1261 def : RWSysReg<"SCTLR_EL2", 0b11, 0b100, 0b0001, 0b0000, 0b000>;
1262 def : RWSysReg<"SCTLR_EL3", 0b11, 0b110, 0b0001, 0b0000, 0b000>;
1263 def : RWSysReg<"ACTLR_EL1", 0b11, 0b000, 0b0001, 0b0000, 0b001>;
1264 def : RWSysReg<"ACTLR_EL12", 0b11, 0b101, 0b0001, 0b0000, 0b001>;
1265 def : RWSysReg<"ACTLR_EL2", 0b11, 0b100, 0b0001, 0b0000, 0b001>;
1266 def : RWSysReg<"ACTLR_EL3", 0b11, 0b110, 0b0001, 0b0000, 0b001>;
1267 def : RWSysReg<"HCR_EL2", 0b11, 0b100, 0b0001, 0b0001, 0b000>;
1268 def : RWSysReg<"HCRX_EL2", 0b11, 0b100, 0b0001, 0b0010, 0b010> {
1269 let Requires = [{ {AArch64::FeatureHCX} }];
1271 def : RWSysReg<"SCR_EL3", 0b11, 0b110, 0b0001, 0b0001, 0b000>;
1272 def : RWSysReg<"MDCR_EL2", 0b11, 0b100, 0b0001, 0b0001, 0b001>;
1273 def : RWSysReg<"SDER32_EL3", 0b11, 0b110, 0b0001, 0b0001, 0b001>;
1274 def : RWSysReg<"CPTR_EL2", 0b11, 0b100, 0b0001, 0b0001, 0b010>;
1275 def : RWSysReg<"CPTR_EL3", 0b11, 0b110, 0b0001, 0b0001, 0b010>;
1276 def : RWSysReg<"HSTR_EL2", 0b11, 0b100, 0b0001, 0b0001, 0b011>;
1277 def : RWSysReg<"HACR_EL2", 0b11, 0b100, 0b0001, 0b0001, 0b111>;
1278 def : RWSysReg<"MDCR_EL3", 0b11, 0b110, 0b0001, 0b0011, 0b001>;
1279 def : RWSysReg<"TTBR0_EL1", 0b11, 0b000, 0b0010, 0b0000, 0b000>;
1280 def : RWSysReg<"TTBR0_EL3", 0b11, 0b110, 0b0010, 0b0000, 0b000>;
1282 let Requires = [{ {AArch64::FeatureEL2VMSA} }] in {
1283 def : RWSysReg<"TTBR0_EL2", 0b11, 0b100, 0b0010, 0b0000, 0b000>;
1284 def : RWSysReg<"VTTBR_EL2", 0b11, 0b100, 0b0010, 0b0001, 0b000>;
1287 def : RWSysReg<"TTBR1_EL1", 0b11, 0b000, 0b0010, 0b0000, 0b001>;
1288 def : RWSysReg<"TCR_EL1", 0b11, 0b000, 0b0010, 0b0000, 0b010>;
1289 def : RWSysReg<"TCR_EL2", 0b11, 0b100, 0b0010, 0b0000, 0b010>;
1290 def : RWSysReg<"TCR_EL3", 0b11, 0b110, 0b0010, 0b0000, 0b010>;
1291 def : RWSysReg<"VTCR_EL2", 0b11, 0b100, 0b0010, 0b0001, 0b010>;
1292 def : RWSysReg<"DACR32_EL2", 0b11, 0b100, 0b0011, 0b0000, 0b000>;
1293 def : RWSysReg<"SPSR_EL1", 0b11, 0b000, 0b0100, 0b0000, 0b000>;
1294 def : RWSysReg<"SPSR_EL2", 0b11, 0b100, 0b0100, 0b0000, 0b000>;
1295 def : RWSysReg<"SPSR_EL3", 0b11, 0b110, 0b0100, 0b0000, 0b000>;
1296 def : RWSysReg<"ELR_EL1", 0b11, 0b000, 0b0100, 0b0000, 0b001>;
1297 def : RWSysReg<"ELR_EL2", 0b11, 0b100, 0b0100, 0b0000, 0b001>;
1298 def : RWSysReg<"ELR_EL3", 0b11, 0b110, 0b0100, 0b0000, 0b001>;
1299 def : RWSysReg<"SP_EL0", 0b11, 0b000, 0b0100, 0b0001, 0b000>;
1300 def : RWSysReg<"SP_EL1", 0b11, 0b100, 0b0100, 0b0001, 0b000>;
1301 def : RWSysReg<"SP_EL2", 0b11, 0b110, 0b0100, 0b0001, 0b000>;
1302 def : RWSysReg<"SPSel", 0b11, 0b000, 0b0100, 0b0010, 0b000>;
1303 def : RWSysReg<"NZCV", 0b11, 0b011, 0b0100, 0b0010, 0b000>;
1304 def : RWSysReg<"DAIF", 0b11, 0b011, 0b0100, 0b0010, 0b001>;
1305 def : ROSysReg<"CurrentEL", 0b11, 0b000, 0b0100, 0b0010, 0b010>;
1306 def : RWSysReg<"SPSR_irq", 0b11, 0b100, 0b0100, 0b0011, 0b000>;
1307 def : RWSysReg<"SPSR_abt", 0b11, 0b100, 0b0100, 0b0011, 0b001>;
1308 def : RWSysReg<"SPSR_und", 0b11, 0b100, 0b0100, 0b0011, 0b010>;
1309 def : RWSysReg<"SPSR_fiq", 0b11, 0b100, 0b0100, 0b0011, 0b011>;
1310 let Requires = [{ {AArch64::FeatureFPARMv8} }] in {
1311 def : RWSysReg<"FPCR", 0b11, 0b011, 0b0100, 0b0100, 0b000>;
1312 def : RWSysReg<"FPSR", 0b11, 0b011, 0b0100, 0b0100, 0b001>;
1314 def : RWSysReg<"DSPSR_EL0", 0b11, 0b011, 0b0100, 0b0101, 0b000>;
1315 def : RWSysReg<"DLR_EL0", 0b11, 0b011, 0b0100, 0b0101, 0b001>;
1316 def : RWSysReg<"IFSR32_EL2", 0b11, 0b100, 0b0101, 0b0000, 0b001>;
1317 def : RWSysReg<"AFSR0_EL1", 0b11, 0b000, 0b0101, 0b0001, 0b000>;
1318 def : RWSysReg<"AFSR0_EL2", 0b11, 0b100, 0b0101, 0b0001, 0b000>;
1319 def : RWSysReg<"AFSR0_EL3", 0b11, 0b110, 0b0101, 0b0001, 0b000>;
1320 def : RWSysReg<"AFSR1_EL1", 0b11, 0b000, 0b0101, 0b0001, 0b001>;
1321 def : RWSysReg<"AFSR1_EL2", 0b11, 0b100, 0b0101, 0b0001, 0b001>;
1322 def : RWSysReg<"AFSR1_EL3", 0b11, 0b110, 0b0101, 0b0001, 0b001>;
1323 def : RWSysReg<"ESR_EL1", 0b11, 0b000, 0b0101, 0b0010, 0b000>;
1324 def : RWSysReg<"ESR_EL2", 0b11, 0b100, 0b0101, 0b0010, 0b000>;
1325 def : RWSysReg<"ESR_EL3", 0b11, 0b110, 0b0101, 0b0010, 0b000>;
1326 def : RWSysReg<"FPEXC32_EL2", 0b11, 0b100, 0b0101, 0b0011, 0b000>;
1327 def : RWSysReg<"FAR_EL1", 0b11, 0b000, 0b0110, 0b0000, 0b000>;
1328 def : RWSysReg<"FAR_EL2", 0b11, 0b100, 0b0110, 0b0000, 0b000>;
1329 def : RWSysReg<"FAR_EL3", 0b11, 0b110, 0b0110, 0b0000, 0b000>;
1330 def : RWSysReg<"HPFAR_EL2", 0b11, 0b100, 0b0110, 0b0000, 0b100>;
1331 def : RWSysReg<"PAR_EL1", 0b11, 0b000, 0b0111, 0b0100, 0b000>;
1332 def : RWSysReg<"PMCR_EL0", 0b11, 0b011, 0b1001, 0b1100, 0b000>;
1333 def : RWSysReg<"PMCNTENSET_EL0", 0b11, 0b011, 0b1001, 0b1100, 0b001>;
1334 def : RWSysReg<"PMCNTENCLR_EL0", 0b11, 0b011, 0b1001, 0b1100, 0b010>;
1335 def : RWSysReg<"PMOVSCLR_EL0", 0b11, 0b011, 0b1001, 0b1100, 0b011>;
1336 def : RWSysReg<"PMSELR_EL0", 0b11, 0b011, 0b1001, 0b1100, 0b101>;
1337 def : RWSysReg<"PMCCNTR_EL0", 0b11, 0b011, 0b1001, 0b1101, 0b000>;
1338 def : RWSysReg<"PMXEVTYPER_EL0", 0b11, 0b011, 0b1001, 0b1101, 0b001>;
1339 def : RWSysReg<"PMXEVCNTR_EL0", 0b11, 0b011, 0b1001, 0b1101, 0b010>;
1340 def : RWSysReg<"PMUSERENR_EL0", 0b11, 0b011, 0b1001, 0b1110, 0b000>;
1341 def : RWSysReg<"PMINTENSET_EL1", 0b11, 0b000, 0b1001, 0b1110, 0b001>;
1342 def : RWSysReg<"PMINTENCLR_EL1", 0b11, 0b000, 0b1001, 0b1110, 0b010>;
1343 def : RWSysReg<"PMOVSSET_EL0", 0b11, 0b011, 0b1001, 0b1110, 0b011>;
1344 def : RWSysReg<"MAIR_EL1", 0b11, 0b000, 0b1010, 0b0010, 0b000>;
1345 def : RWSysReg<"MAIR_EL2", 0b11, 0b100, 0b1010, 0b0010, 0b000>;
1346 def : RWSysReg<"MAIR_EL3", 0b11, 0b110, 0b1010, 0b0010, 0b000>;
1347 def : RWSysReg<"AMAIR_EL1", 0b11, 0b000, 0b1010, 0b0011, 0b000>;
1348 def : RWSysReg<"AMAIR_EL2", 0b11, 0b100, 0b1010, 0b0011, 0b000>;
1349 def : RWSysReg<"AMAIR_EL3", 0b11, 0b110, 0b1010, 0b0011, 0b000>;
1350 def : RWSysReg<"VBAR_EL1", 0b11, 0b000, 0b1100, 0b0000, 0b000>;
1351 def : RWSysReg<"VBAR_EL2", 0b11, 0b100, 0b1100, 0b0000, 0b000>;
1352 def : RWSysReg<"VBAR_EL3", 0b11, 0b110, 0b1100, 0b0000, 0b000>;
1353 def : RWSysReg<"RMR_EL1", 0b11, 0b000, 0b1100, 0b0000, 0b010>;
1354 def : RWSysReg<"RMR_EL2", 0b11, 0b100, 0b1100, 0b0000, 0b010>;
1355 def : RWSysReg<"RMR_EL3", 0b11, 0b110, 0b1100, 0b0000, 0b010>;
1356 def : RWSysReg<"CONTEXTIDR_EL1", 0b11, 0b000, 0b1101, 0b0000, 0b001>;
1357 def : RWSysReg<"TPIDR_EL0", 0b11, 0b011, 0b1101, 0b0000, 0b010>;
1358 def : RWSysReg<"TPIDR_EL2", 0b11, 0b100, 0b1101, 0b0000, 0b010>;
1359 def : RWSysReg<"TPIDR_EL3", 0b11, 0b110, 0b1101, 0b0000, 0b010>;
1360 def : RWSysReg<"TPIDRRO_EL0", 0b11, 0b011, 0b1101, 0b0000, 0b011>;
1361 def : RWSysReg<"TPIDR_EL1", 0b11, 0b000, 0b1101, 0b0000, 0b100>;
1362 def : RWSysReg<"CNTFRQ_EL0", 0b11, 0b011, 0b1110, 0b0000, 0b000>;
1363 def : RWSysReg<"CNTVOFF_EL2", 0b11, 0b100, 0b1110, 0b0000, 0b011>;
1364 def : RWSysReg<"CNTKCTL_EL1", 0b11, 0b000, 0b1110, 0b0001, 0b000>;
1365 def : RWSysReg<"CNTHCTL_EL2", 0b11, 0b100, 0b1110, 0b0001, 0b000>;
1366 def : RWSysReg<"CNTP_TVAL_EL0", 0b11, 0b011, 0b1110, 0b0010, 0b000>;
1367 def : RWSysReg<"CNTHP_TVAL_EL2", 0b11, 0b100, 0b1110, 0b0010, 0b000>;
1368 def : RWSysReg<"CNTPS_TVAL_EL1", 0b11, 0b111, 0b1110, 0b0010, 0b000>;
1369 def : RWSysReg<"CNTP_CTL_EL0", 0b11, 0b011, 0b1110, 0b0010, 0b001>;
1370 def : RWSysReg<"CNTHP_CTL_EL2", 0b11, 0b100, 0b1110, 0b0010, 0b001>;
1371 def : RWSysReg<"CNTPS_CTL_EL1", 0b11, 0b111, 0b1110, 0b0010, 0b001>;
1372 def : RWSysReg<"CNTP_CVAL_EL0", 0b11, 0b011, 0b1110, 0b0010, 0b010>;
1373 def : RWSysReg<"CNTHP_CVAL_EL2", 0b11, 0b100, 0b1110, 0b0010, 0b010>;
1374 def : RWSysReg<"CNTPS_CVAL_EL1", 0b11, 0b111, 0b1110, 0b0010, 0b010>;
1375 def : RWSysReg<"CNTV_TVAL_EL0", 0b11, 0b011, 0b1110, 0b0011, 0b000>;
1376 def : RWSysReg<"CNTV_CTL_EL0", 0b11, 0b011, 0b1110, 0b0011, 0b001>;
1377 def : RWSysReg<"CNTV_CVAL_EL0", 0b11, 0b011, 0b1110, 0b0011, 0b010>;
1378 def : RWSysReg<"PMEVCNTR0_EL0", 0b11, 0b011, 0b1110, 0b1000, 0b000>;
1379 def : RWSysReg<"PMEVCNTR1_EL0", 0b11, 0b011, 0b1110, 0b1000, 0b001>;
1380 def : RWSysReg<"PMEVCNTR2_EL0", 0b11, 0b011, 0b1110, 0b1000, 0b010>;
1381 def : RWSysReg<"PMEVCNTR3_EL0", 0b11, 0b011, 0b1110, 0b1000, 0b011>;
1382 def : RWSysReg<"PMEVCNTR4_EL0", 0b11, 0b011, 0b1110, 0b1000, 0b100>;
1383 def : RWSysReg<"PMEVCNTR5_EL0", 0b11, 0b011, 0b1110, 0b1000, 0b101>;
1384 def : RWSysReg<"PMEVCNTR6_EL0", 0b11, 0b011, 0b1110, 0b1000, 0b110>;
1385 def : RWSysReg<"PMEVCNTR7_EL0", 0b11, 0b011, 0b1110, 0b1000, 0b111>;
1386 def : RWSysReg<"PMEVCNTR8_EL0", 0b11, 0b011, 0b1110, 0b1001, 0b000>;
1387 def : RWSysReg<"PMEVCNTR9_EL0", 0b11, 0b011, 0b1110, 0b1001, 0b001>;
1388 def : RWSysReg<"PMEVCNTR10_EL0", 0b11, 0b011, 0b1110, 0b1001, 0b010>;
1389 def : RWSysReg<"PMEVCNTR11_EL0", 0b11, 0b011, 0b1110, 0b1001, 0b011>;
1390 def : RWSysReg<"PMEVCNTR12_EL0", 0b11, 0b011, 0b1110, 0b1001, 0b100>;
1391 def : RWSysReg<"PMEVCNTR13_EL0", 0b11, 0b011, 0b1110, 0b1001, 0b101>;
1392 def : RWSysReg<"PMEVCNTR14_EL0", 0b11, 0b011, 0b1110, 0b1001, 0b110>;
1393 def : RWSysReg<"PMEVCNTR15_EL0", 0b11, 0b011, 0b1110, 0b1001, 0b111>;
1394 def : RWSysReg<"PMEVCNTR16_EL0", 0b11, 0b011, 0b1110, 0b1010, 0b000>;
1395 def : RWSysReg<"PMEVCNTR17_EL0", 0b11, 0b011, 0b1110, 0b1010, 0b001>;
1396 def : RWSysReg<"PMEVCNTR18_EL0", 0b11, 0b011, 0b1110, 0b1010, 0b010>;
1397 def : RWSysReg<"PMEVCNTR19_EL0", 0b11, 0b011, 0b1110, 0b1010, 0b011>;
1398 def : RWSysReg<"PMEVCNTR20_EL0", 0b11, 0b011, 0b1110, 0b1010, 0b100>;
1399 def : RWSysReg<"PMEVCNTR21_EL0", 0b11, 0b011, 0b1110, 0b1010, 0b101>;
1400 def : RWSysReg<"PMEVCNTR22_EL0", 0b11, 0b011, 0b1110, 0b1010, 0b110>;
1401 def : RWSysReg<"PMEVCNTR23_EL0", 0b11, 0b011, 0b1110, 0b1010, 0b111>;
1402 def : RWSysReg<"PMEVCNTR24_EL0", 0b11, 0b011, 0b1110, 0b1011, 0b000>;
1403 def : RWSysReg<"PMEVCNTR25_EL0", 0b11, 0b011, 0b1110, 0b1011, 0b001>;
1404 def : RWSysReg<"PMEVCNTR26_EL0", 0b11, 0b011, 0b1110, 0b1011, 0b010>;
1405 def : RWSysReg<"PMEVCNTR27_EL0", 0b11, 0b011, 0b1110, 0b1011, 0b011>;
1406 def : RWSysReg<"PMEVCNTR28_EL0", 0b11, 0b011, 0b1110, 0b1011, 0b100>;
1407 def : RWSysReg<"PMEVCNTR29_EL0", 0b11, 0b011, 0b1110, 0b1011, 0b101>;
1408 def : RWSysReg<"PMEVCNTR30_EL0", 0b11, 0b011, 0b1110, 0b1011, 0b110>;
1409 def : RWSysReg<"PMCCFILTR_EL0", 0b11, 0b011, 0b1110, 0b1111, 0b111>;
1410 def : RWSysReg<"PMEVTYPER0_EL0", 0b11, 0b011, 0b1110, 0b1100, 0b000>;
1411 def : RWSysReg<"PMEVTYPER1_EL0", 0b11, 0b011, 0b1110, 0b1100, 0b001>;
1412 def : RWSysReg<"PMEVTYPER2_EL0", 0b11, 0b011, 0b1110, 0b1100, 0b010>;
1413 def : RWSysReg<"PMEVTYPER3_EL0", 0b11, 0b011, 0b1110, 0b1100, 0b011>;
1414 def : RWSysReg<"PMEVTYPER4_EL0", 0b11, 0b011, 0b1110, 0b1100, 0b100>;
1415 def : RWSysReg<"PMEVTYPER5_EL0", 0b11, 0b011, 0b1110, 0b1100, 0b101>;
1416 def : RWSysReg<"PMEVTYPER6_EL0", 0b11, 0b011, 0b1110, 0b1100, 0b110>;
1417 def : RWSysReg<"PMEVTYPER7_EL0", 0b11, 0b011, 0b1110, 0b1100, 0b111>;
1418 def : RWSysReg<"PMEVTYPER8_EL0", 0b11, 0b011, 0b1110, 0b1101, 0b000>;
1419 def : RWSysReg<"PMEVTYPER9_EL0", 0b11, 0b011, 0b1110, 0b1101, 0b001>;
1420 def : RWSysReg<"PMEVTYPER10_EL0", 0b11, 0b011, 0b1110, 0b1101, 0b010>;
1421 def : RWSysReg<"PMEVTYPER11_EL0", 0b11, 0b011, 0b1110, 0b1101, 0b011>;
1422 def : RWSysReg<"PMEVTYPER12_EL0", 0b11, 0b011, 0b1110, 0b1101, 0b100>;
1423 def : RWSysReg<"PMEVTYPER13_EL0", 0b11, 0b011, 0b1110, 0b1101, 0b101>;
1424 def : RWSysReg<"PMEVTYPER14_EL0", 0b11, 0b011, 0b1110, 0b1101, 0b110>;
1425 def : RWSysReg<"PMEVTYPER15_EL0", 0b11, 0b011, 0b1110, 0b1101, 0b111>;
1426 def : RWSysReg<"PMEVTYPER16_EL0", 0b11, 0b011, 0b1110, 0b1110, 0b000>;
1427 def : RWSysReg<"PMEVTYPER17_EL0", 0b11, 0b011, 0b1110, 0b1110, 0b001>;
1428 def : RWSysReg<"PMEVTYPER18_EL0", 0b11, 0b011, 0b1110, 0b1110, 0b010>;
1429 def : RWSysReg<"PMEVTYPER19_EL0", 0b11, 0b011, 0b1110, 0b1110, 0b011>;
1430 def : RWSysReg<"PMEVTYPER20_EL0", 0b11, 0b011, 0b1110, 0b1110, 0b100>;
1431 def : RWSysReg<"PMEVTYPER21_EL0", 0b11, 0b011, 0b1110, 0b1110, 0b101>;
1432 def : RWSysReg<"PMEVTYPER22_EL0", 0b11, 0b011, 0b1110, 0b1110, 0b110>;
1433 def : RWSysReg<"PMEVTYPER23_EL0", 0b11, 0b011, 0b1110, 0b1110, 0b111>;
1434 def : RWSysReg<"PMEVTYPER24_EL0", 0b11, 0b011, 0b1110, 0b1111, 0b000>;
1435 def : RWSysReg<"PMEVTYPER25_EL0", 0b11, 0b011, 0b1110, 0b1111, 0b001>;
1436 def : RWSysReg<"PMEVTYPER26_EL0", 0b11, 0b011, 0b1110, 0b1111, 0b010>;
1437 def : RWSysReg<"PMEVTYPER27_EL0", 0b11, 0b011, 0b1110, 0b1111, 0b011>;
1438 def : RWSysReg<"PMEVTYPER28_EL0", 0b11, 0b011, 0b1110, 0b1111, 0b100>;
1439 def : RWSysReg<"PMEVTYPER29_EL0", 0b11, 0b011, 0b1110, 0b1111, 0b101>;
1440 def : RWSysReg<"PMEVTYPER30_EL0", 0b11, 0b011, 0b1110, 0b1111, 0b110>;
1443 // Op0 Op1 CRn CRm Op2
1444 def : RWSysReg<"TRCPRGCTLR", 0b10, 0b001, 0b0000, 0b0001, 0b000>;
1445 def : RWSysReg<"TRCPROCSELR", 0b10, 0b001, 0b0000, 0b0010, 0b000>;
1446 def : RWSysReg<"TRCCONFIGR", 0b10, 0b001, 0b0000, 0b0100, 0b000>;
1447 def : RWSysReg<"TRCAUXCTLR", 0b10, 0b001, 0b0000, 0b0110, 0b000>;
1448 def : RWSysReg<"TRCEVENTCTL0R", 0b10, 0b001, 0b0000, 0b1000, 0b000>;
1449 def : RWSysReg<"TRCEVENTCTL1R", 0b10, 0b001, 0b0000, 0b1001, 0b000>;
1450 def : RWSysReg<"TRCSTALLCTLR", 0b10, 0b001, 0b0000, 0b1011, 0b000>;
1451 def : RWSysReg<"TRCTSCTLR", 0b10, 0b001, 0b0000, 0b1100, 0b000>;
1452 def : RWSysReg<"TRCSYNCPR", 0b10, 0b001, 0b0000, 0b1101, 0b000>;
1453 def : RWSysReg<"TRCCCCTLR", 0b10, 0b001, 0b0000, 0b1110, 0b000>;
1454 def : RWSysReg<"TRCBBCTLR", 0b10, 0b001, 0b0000, 0b1111, 0b000>;
1455 def : RWSysReg<"TRCTRACEIDR", 0b10, 0b001, 0b0000, 0b0000, 0b001>;
1456 def : RWSysReg<"TRCQCTLR", 0b10, 0b001, 0b0000, 0b0001, 0b001>;
1457 def : RWSysReg<"TRCVICTLR", 0b10, 0b001, 0b0000, 0b0000, 0b010>;
1458 def : RWSysReg<"TRCVIIECTLR", 0b10, 0b001, 0b0000, 0b0001, 0b010>;
1459 def : RWSysReg<"TRCVISSCTLR", 0b10, 0b001, 0b0000, 0b0010, 0b010>;
1460 def : RWSysReg<"TRCVIPCSSCTLR", 0b10, 0b001, 0b0000, 0b0011, 0b010>;
1461 def : RWSysReg<"TRCVDCTLR", 0b10, 0b001, 0b0000, 0b1000, 0b010>;
1462 def : RWSysReg<"TRCVDSACCTLR", 0b10, 0b001, 0b0000, 0b1001, 0b010>;
1463 def : RWSysReg<"TRCVDARCCTLR", 0b10, 0b001, 0b0000, 0b1010, 0b010>;
1464 def : RWSysReg<"TRCSEQEVR0", 0b10, 0b001, 0b0000, 0b0000, 0b100>;
1465 def : RWSysReg<"TRCSEQEVR1", 0b10, 0b001, 0b0000, 0b0001, 0b100>;
1466 def : RWSysReg<"TRCSEQEVR2", 0b10, 0b001, 0b0000, 0b0010, 0b100>;
1467 def : RWSysReg<"TRCSEQRSTEVR", 0b10, 0b001, 0b0000, 0b0110, 0b100>;
1468 def : RWSysReg<"TRCSEQSTR", 0b10, 0b001, 0b0000, 0b0111, 0b100>;
1469 def : RWSysReg<"TRCEXTINSELR", 0b10, 0b001, 0b0000, 0b1000, 0b100>;
1470 def : RWSysReg<"TRCCNTRLDVR0", 0b10, 0b001, 0b0000, 0b0000, 0b101>;
1471 def : RWSysReg<"TRCCNTRLDVR1", 0b10, 0b001, 0b0000, 0b0001, 0b101>;
1472 def : RWSysReg<"TRCCNTRLDVR2", 0b10, 0b001, 0b0000, 0b0010, 0b101>;
1473 def : RWSysReg<"TRCCNTRLDVR3", 0b10, 0b001, 0b0000, 0b0011, 0b101>;
1474 def : RWSysReg<"TRCCNTCTLR0", 0b10, 0b001, 0b0000, 0b0100, 0b101>;
1475 def : RWSysReg<"TRCCNTCTLR1", 0b10, 0b001, 0b0000, 0b0101, 0b101>;
1476 def : RWSysReg<"TRCCNTCTLR2", 0b10, 0b001, 0b0000, 0b0110, 0b101>;
1477 def : RWSysReg<"TRCCNTCTLR3", 0b10, 0b001, 0b0000, 0b0111, 0b101>;
1478 def : RWSysReg<"TRCCNTVR0", 0b10, 0b001, 0b0000, 0b1000, 0b101>;
1479 def : RWSysReg<"TRCCNTVR1", 0b10, 0b001, 0b0000, 0b1001, 0b101>;
1480 def : RWSysReg<"TRCCNTVR2", 0b10, 0b001, 0b0000, 0b1010, 0b101>;
1481 def : RWSysReg<"TRCCNTVR3", 0b10, 0b001, 0b0000, 0b1011, 0b101>;
1482 def : RWSysReg<"TRCIMSPEC0", 0b10, 0b001, 0b0000, 0b0000, 0b111>;
1483 def : RWSysReg<"TRCIMSPEC1", 0b10, 0b001, 0b0000, 0b0001, 0b111>;
1484 def : RWSysReg<"TRCIMSPEC2", 0b10, 0b001, 0b0000, 0b0010, 0b111>;
1485 def : RWSysReg<"TRCIMSPEC3", 0b10, 0b001, 0b0000, 0b0011, 0b111>;
1486 def : RWSysReg<"TRCIMSPEC4", 0b10, 0b001, 0b0000, 0b0100, 0b111>;
1487 def : RWSysReg<"TRCIMSPEC5", 0b10, 0b001, 0b0000, 0b0101, 0b111>;
1488 def : RWSysReg<"TRCIMSPEC6", 0b10, 0b001, 0b0000, 0b0110, 0b111>;
1489 def : RWSysReg<"TRCIMSPEC7", 0b10, 0b001, 0b0000, 0b0111, 0b111>;
1490 def : RWSysReg<"TRCRSCTLR2", 0b10, 0b001, 0b0001, 0b0010, 0b000>;
1491 def : RWSysReg<"TRCRSCTLR3", 0b10, 0b001, 0b0001, 0b0011, 0b000>;
1492 def : RWSysReg<"TRCRSCTLR4", 0b10, 0b001, 0b0001, 0b0100, 0b000>;
1493 def : RWSysReg<"TRCRSCTLR5", 0b10, 0b001, 0b0001, 0b0101, 0b000>;
1494 def : RWSysReg<"TRCRSCTLR6", 0b10, 0b001, 0b0001, 0b0110, 0b000>;
1495 def : RWSysReg<"TRCRSCTLR7", 0b10, 0b001, 0b0001, 0b0111, 0b000>;
1496 def : RWSysReg<"TRCRSCTLR8", 0b10, 0b001, 0b0001, 0b1000, 0b000>;
1497 def : RWSysReg<"TRCRSCTLR9", 0b10, 0b001, 0b0001, 0b1001, 0b000>;
1498 def : RWSysReg<"TRCRSCTLR10", 0b10, 0b001, 0b0001, 0b1010, 0b000>;
1499 def : RWSysReg<"TRCRSCTLR11", 0b10, 0b001, 0b0001, 0b1011, 0b000>;
1500 def : RWSysReg<"TRCRSCTLR12", 0b10, 0b001, 0b0001, 0b1100, 0b000>;
1501 def : RWSysReg<"TRCRSCTLR13", 0b10, 0b001, 0b0001, 0b1101, 0b000>;
1502 def : RWSysReg<"TRCRSCTLR14", 0b10, 0b001, 0b0001, 0b1110, 0b000>;
1503 def : RWSysReg<"TRCRSCTLR15", 0b10, 0b001, 0b0001, 0b1111, 0b000>;
1504 def : RWSysReg<"TRCRSCTLR16", 0b10, 0b001, 0b0001, 0b0000, 0b001>;
1505 def : RWSysReg<"TRCRSCTLR17", 0b10, 0b001, 0b0001, 0b0001, 0b001>;
1506 def : RWSysReg<"TRCRSCTLR18", 0b10, 0b001, 0b0001, 0b0010, 0b001>;
1507 def : RWSysReg<"TRCRSCTLR19", 0b10, 0b001, 0b0001, 0b0011, 0b001>;
1508 def : RWSysReg<"TRCRSCTLR20", 0b10, 0b001, 0b0001, 0b0100, 0b001>;
1509 def : RWSysReg<"TRCRSCTLR21", 0b10, 0b001, 0b0001, 0b0101, 0b001>;
1510 def : RWSysReg<"TRCRSCTLR22", 0b10, 0b001, 0b0001, 0b0110, 0b001>;
1511 def : RWSysReg<"TRCRSCTLR23", 0b10, 0b001, 0b0001, 0b0111, 0b001>;
1512 def : RWSysReg<"TRCRSCTLR24", 0b10, 0b001, 0b0001, 0b1000, 0b001>;
1513 def : RWSysReg<"TRCRSCTLR25", 0b10, 0b001, 0b0001, 0b1001, 0b001>;
1514 def : RWSysReg<"TRCRSCTLR26", 0b10, 0b001, 0b0001, 0b1010, 0b001>;
1515 def : RWSysReg<"TRCRSCTLR27", 0b10, 0b001, 0b0001, 0b1011, 0b001>;
1516 def : RWSysReg<"TRCRSCTLR28", 0b10, 0b001, 0b0001, 0b1100, 0b001>;
1517 def : RWSysReg<"TRCRSCTLR29", 0b10, 0b001, 0b0001, 0b1101, 0b001>;
1518 def : RWSysReg<"TRCRSCTLR30", 0b10, 0b001, 0b0001, 0b1110, 0b001>;
1519 def : RWSysReg<"TRCRSCTLR31", 0b10, 0b001, 0b0001, 0b1111, 0b001>;
1520 def : RWSysReg<"TRCSSCCR0", 0b10, 0b001, 0b0001, 0b0000, 0b010>;
1521 def : RWSysReg<"TRCSSCCR1", 0b10, 0b001, 0b0001, 0b0001, 0b010>;
1522 def : RWSysReg<"TRCSSCCR2", 0b10, 0b001, 0b0001, 0b0010, 0b010>;
1523 def : RWSysReg<"TRCSSCCR3", 0b10, 0b001, 0b0001, 0b0011, 0b010>;
1524 def : RWSysReg<"TRCSSCCR4", 0b10, 0b001, 0b0001, 0b0100, 0b010>;
1525 def : RWSysReg<"TRCSSCCR5", 0b10, 0b001, 0b0001, 0b0101, 0b010>;
1526 def : RWSysReg<"TRCSSCCR6", 0b10, 0b001, 0b0001, 0b0110, 0b010>;
1527 def : RWSysReg<"TRCSSCCR7", 0b10, 0b001, 0b0001, 0b0111, 0b010>;
1528 def : RWSysReg<"TRCSSCSR0", 0b10, 0b001, 0b0001, 0b1000, 0b010>;
1529 def : RWSysReg<"TRCSSCSR1", 0b10, 0b001, 0b0001, 0b1001, 0b010>;
1530 def : RWSysReg<"TRCSSCSR2", 0b10, 0b001, 0b0001, 0b1010, 0b010>;
1531 def : RWSysReg<"TRCSSCSR3", 0b10, 0b001, 0b0001, 0b1011, 0b010>;
1532 def : RWSysReg<"TRCSSCSR4", 0b10, 0b001, 0b0001, 0b1100, 0b010>;
1533 def : RWSysReg<"TRCSSCSR5", 0b10, 0b001, 0b0001, 0b1101, 0b010>;
1534 def : RWSysReg<"TRCSSCSR6", 0b10, 0b001, 0b0001, 0b1110, 0b010>;
1535 def : RWSysReg<"TRCSSCSR7", 0b10, 0b001, 0b0001, 0b1111, 0b010>;
1536 def : RWSysReg<"TRCSSPCICR0", 0b10, 0b001, 0b0001, 0b0000, 0b011>;
1537 def : RWSysReg<"TRCSSPCICR1", 0b10, 0b001, 0b0001, 0b0001, 0b011>;
1538 def : RWSysReg<"TRCSSPCICR2", 0b10, 0b001, 0b0001, 0b0010, 0b011>;
1539 def : RWSysReg<"TRCSSPCICR3", 0b10, 0b001, 0b0001, 0b0011, 0b011>;
1540 def : RWSysReg<"TRCSSPCICR4", 0b10, 0b001, 0b0001, 0b0100, 0b011>;
1541 def : RWSysReg<"TRCSSPCICR5", 0b10, 0b001, 0b0001, 0b0101, 0b011>;
1542 def : RWSysReg<"TRCSSPCICR6", 0b10, 0b001, 0b0001, 0b0110, 0b011>;
1543 def : RWSysReg<"TRCSSPCICR7", 0b10, 0b001, 0b0001, 0b0111, 0b011>;
1544 def : RWSysReg<"TRCPDCR", 0b10, 0b001, 0b0001, 0b0100, 0b100>;
1545 def : RWSysReg<"TRCACVR0", 0b10, 0b001, 0b0010, 0b0000, 0b000>;
1546 def : RWSysReg<"TRCACVR1", 0b10, 0b001, 0b0010, 0b0010, 0b000>;
1547 def : RWSysReg<"TRCACVR2", 0b10, 0b001, 0b0010, 0b0100, 0b000>;
1548 def : RWSysReg<"TRCACVR3", 0b10, 0b001, 0b0010, 0b0110, 0b000>;
1549 def : RWSysReg<"TRCACVR4", 0b10, 0b001, 0b0010, 0b1000, 0b000>;
1550 def : RWSysReg<"TRCACVR5", 0b10, 0b001, 0b0010, 0b1010, 0b000>;
1551 def : RWSysReg<"TRCACVR6", 0b10, 0b001, 0b0010, 0b1100, 0b000>;
1552 def : RWSysReg<"TRCACVR7", 0b10, 0b001, 0b0010, 0b1110, 0b000>;
1553 def : RWSysReg<"TRCACVR8", 0b10, 0b001, 0b0010, 0b0000, 0b001>;
1554 def : RWSysReg<"TRCACVR9", 0b10, 0b001, 0b0010, 0b0010, 0b001>;
1555 def : RWSysReg<"TRCACVR10", 0b10, 0b001, 0b0010, 0b0100, 0b001>;
1556 def : RWSysReg<"TRCACVR11", 0b10, 0b001, 0b0010, 0b0110, 0b001>;
1557 def : RWSysReg<"TRCACVR12", 0b10, 0b001, 0b0010, 0b1000, 0b001>;
1558 def : RWSysReg<"TRCACVR13", 0b10, 0b001, 0b0010, 0b1010, 0b001>;
1559 def : RWSysReg<"TRCACVR14", 0b10, 0b001, 0b0010, 0b1100, 0b001>;
1560 def : RWSysReg<"TRCACVR15", 0b10, 0b001, 0b0010, 0b1110, 0b001>;
1561 def : RWSysReg<"TRCACATR0", 0b10, 0b001, 0b0010, 0b0000, 0b010>;
1562 def : RWSysReg<"TRCACATR1", 0b10, 0b001, 0b0010, 0b0010, 0b010>;
1563 def : RWSysReg<"TRCACATR2", 0b10, 0b001, 0b0010, 0b0100, 0b010>;
1564 def : RWSysReg<"TRCACATR3", 0b10, 0b001, 0b0010, 0b0110, 0b010>;
1565 def : RWSysReg<"TRCACATR4", 0b10, 0b001, 0b0010, 0b1000, 0b010>;
1566 def : RWSysReg<"TRCACATR5", 0b10, 0b001, 0b0010, 0b1010, 0b010>;
1567 def : RWSysReg<"TRCACATR6", 0b10, 0b001, 0b0010, 0b1100, 0b010>;
1568 def : RWSysReg<"TRCACATR7", 0b10, 0b001, 0b0010, 0b1110, 0b010>;
1569 def : RWSysReg<"TRCACATR8", 0b10, 0b001, 0b0010, 0b0000, 0b011>;
1570 def : RWSysReg<"TRCACATR9", 0b10, 0b001, 0b0010, 0b0010, 0b011>;
1571 def : RWSysReg<"TRCACATR10", 0b10, 0b001, 0b0010, 0b0100, 0b011>;
1572 def : RWSysReg<"TRCACATR11", 0b10, 0b001, 0b0010, 0b0110, 0b011>;
1573 def : RWSysReg<"TRCACATR12", 0b10, 0b001, 0b0010, 0b1000, 0b011>;
1574 def : RWSysReg<"TRCACATR13", 0b10, 0b001, 0b0010, 0b1010, 0b011>;
1575 def : RWSysReg<"TRCACATR14", 0b10, 0b001, 0b0010, 0b1100, 0b011>;
1576 def : RWSysReg<"TRCACATR15", 0b10, 0b001, 0b0010, 0b1110, 0b011>;
1577 def : RWSysReg<"TRCDVCVR0", 0b10, 0b001, 0b0010, 0b0000, 0b100>;
1578 def : RWSysReg<"TRCDVCVR1", 0b10, 0b001, 0b0010, 0b0100, 0b100>;
1579 def : RWSysReg<"TRCDVCVR2", 0b10, 0b001, 0b0010, 0b1000, 0b100>;
1580 def : RWSysReg<"TRCDVCVR3", 0b10, 0b001, 0b0010, 0b1100, 0b100>;
1581 def : RWSysReg<"TRCDVCVR4", 0b10, 0b001, 0b0010, 0b0000, 0b101>;
1582 def : RWSysReg<"TRCDVCVR5", 0b10, 0b001, 0b0010, 0b0100, 0b101>;
1583 def : RWSysReg<"TRCDVCVR6", 0b10, 0b001, 0b0010, 0b1000, 0b101>;
1584 def : RWSysReg<"TRCDVCVR7", 0b10, 0b001, 0b0010, 0b1100, 0b101>;
1585 def : RWSysReg<"TRCDVCMR0", 0b10, 0b001, 0b0010, 0b0000, 0b110>;
1586 def : RWSysReg<"TRCDVCMR1", 0b10, 0b001, 0b0010, 0b0100, 0b110>;
1587 def : RWSysReg<"TRCDVCMR2", 0b10, 0b001, 0b0010, 0b1000, 0b110>;
1588 def : RWSysReg<"TRCDVCMR3", 0b10, 0b001, 0b0010, 0b1100, 0b110>;
1589 def : RWSysReg<"TRCDVCMR4", 0b10, 0b001, 0b0010, 0b0000, 0b111>;
1590 def : RWSysReg<"TRCDVCMR5", 0b10, 0b001, 0b0010, 0b0100, 0b111>;
1591 def : RWSysReg<"TRCDVCMR6", 0b10, 0b001, 0b0010, 0b1000, 0b111>;
1592 def : RWSysReg<"TRCDVCMR7", 0b10, 0b001, 0b0010, 0b1100, 0b111>;
1593 def : RWSysReg<"TRCCIDCVR0", 0b10, 0b001, 0b0011, 0b0000, 0b000>;
1594 def : RWSysReg<"TRCCIDCVR1", 0b10, 0b001, 0b0011, 0b0010, 0b000>;
1595 def : RWSysReg<"TRCCIDCVR2", 0b10, 0b001, 0b0011, 0b0100, 0b000>;
1596 def : RWSysReg<"TRCCIDCVR3", 0b10, 0b001, 0b0011, 0b0110, 0b000>;
1597 def : RWSysReg<"TRCCIDCVR4", 0b10, 0b001, 0b0011, 0b1000, 0b000>;
1598 def : RWSysReg<"TRCCIDCVR5", 0b10, 0b001, 0b0011, 0b1010, 0b000>;
1599 def : RWSysReg<"TRCCIDCVR6", 0b10, 0b001, 0b0011, 0b1100, 0b000>;
1600 def : RWSysReg<"TRCCIDCVR7", 0b10, 0b001, 0b0011, 0b1110, 0b000>;
1601 def : RWSysReg<"TRCVMIDCVR0", 0b10, 0b001, 0b0011, 0b0000, 0b001>;
1602 def : RWSysReg<"TRCVMIDCVR1", 0b10, 0b001, 0b0011, 0b0010, 0b001>;
1603 def : RWSysReg<"TRCVMIDCVR2", 0b10, 0b001, 0b0011, 0b0100, 0b001>;
1604 def : RWSysReg<"TRCVMIDCVR3", 0b10, 0b001, 0b0011, 0b0110, 0b001>;
1605 def : RWSysReg<"TRCVMIDCVR4", 0b10, 0b001, 0b0011, 0b1000, 0b001>;
1606 def : RWSysReg<"TRCVMIDCVR5", 0b10, 0b001, 0b0011, 0b1010, 0b001>;
1607 def : RWSysReg<"TRCVMIDCVR6", 0b10, 0b001, 0b0011, 0b1100, 0b001>;
1608 def : RWSysReg<"TRCVMIDCVR7", 0b10, 0b001, 0b0011, 0b1110, 0b001>;
1609 def : RWSysReg<"TRCCIDCCTLR0", 0b10, 0b001, 0b0011, 0b0000, 0b010>;
1610 def : RWSysReg<"TRCCIDCCTLR1", 0b10, 0b001, 0b0011, 0b0001, 0b010>;
1611 def : RWSysReg<"TRCVMIDCCTLR0", 0b10, 0b001, 0b0011, 0b0010, 0b010>;
1612 def : RWSysReg<"TRCVMIDCCTLR1", 0b10, 0b001, 0b0011, 0b0011, 0b010>;
1613 def : RWSysReg<"TRCITCTRL", 0b10, 0b001, 0b0111, 0b0000, 0b100>;
1614 def : RWSysReg<"TRCCLAIMSET", 0b10, 0b001, 0b0111, 0b1000, 0b110>;
1615 def : RWSysReg<"TRCCLAIMCLR", 0b10, 0b001, 0b0111, 0b1001, 0b110>;
1618 // Op0 Op1 CRn CRm Op2
1619 def : RWSysReg<"ICC_BPR1_EL1", 0b11, 0b000, 0b1100, 0b1100, 0b011>;
1620 def : RWSysReg<"ICC_BPR0_EL1", 0b11, 0b000, 0b1100, 0b1000, 0b011>;
1621 def : RWSysReg<"ICC_PMR_EL1", 0b11, 0b000, 0b0100, 0b0110, 0b000>;
1622 def : RWSysReg<"ICC_CTLR_EL1", 0b11, 0b000, 0b1100, 0b1100, 0b100>;
1623 def : RWSysReg<"ICC_CTLR_EL3", 0b11, 0b110, 0b1100, 0b1100, 0b100>;
1624 def : RWSysReg<"ICC_SRE_EL1", 0b11, 0b000, 0b1100, 0b1100, 0b101>;
1625 def : RWSysReg<"ICC_SRE_EL2", 0b11, 0b100, 0b1100, 0b1001, 0b101>;
1626 def : RWSysReg<"ICC_SRE_EL3", 0b11, 0b110, 0b1100, 0b1100, 0b101>;
1627 def : RWSysReg<"ICC_IGRPEN0_EL1", 0b11, 0b000, 0b1100, 0b1100, 0b110>;
1628 def : RWSysReg<"ICC_IGRPEN1_EL1", 0b11, 0b000, 0b1100, 0b1100, 0b111>;
1629 def : RWSysReg<"ICC_IGRPEN1_EL3", 0b11, 0b110, 0b1100, 0b1100, 0b111>;
1630 def : RWSysReg<"ICC_AP0R0_EL1", 0b11, 0b000, 0b1100, 0b1000, 0b100>;
1631 def : RWSysReg<"ICC_AP0R1_EL1", 0b11, 0b000, 0b1100, 0b1000, 0b101>;
1632 def : RWSysReg<"ICC_AP0R2_EL1", 0b11, 0b000, 0b1100, 0b1000, 0b110>;
1633 def : RWSysReg<"ICC_AP0R3_EL1", 0b11, 0b000, 0b1100, 0b1000, 0b111>;
1634 def : RWSysReg<"ICC_AP1R0_EL1", 0b11, 0b000, 0b1100, 0b1001, 0b000>;
1635 def : RWSysReg<"ICC_AP1R1_EL1", 0b11, 0b000, 0b1100, 0b1001, 0b001>;
1636 def : RWSysReg<"ICC_AP1R2_EL1", 0b11, 0b000, 0b1100, 0b1001, 0b010>;
1637 def : RWSysReg<"ICC_AP1R3_EL1", 0b11, 0b000, 0b1100, 0b1001, 0b011>;
1638 def : RWSysReg<"ICH_AP0R0_EL2", 0b11, 0b100, 0b1100, 0b1000, 0b000>;
1639 def : RWSysReg<"ICH_AP0R1_EL2", 0b11, 0b100, 0b1100, 0b1000, 0b001>;
1640 def : RWSysReg<"ICH_AP0R2_EL2", 0b11, 0b100, 0b1100, 0b1000, 0b010>;
1641 def : RWSysReg<"ICH_AP0R3_EL2", 0b11, 0b100, 0b1100, 0b1000, 0b011>;
1642 def : RWSysReg<"ICH_AP1R0_EL2", 0b11, 0b100, 0b1100, 0b1001, 0b000>;
1643 def : RWSysReg<"ICH_AP1R1_EL2", 0b11, 0b100, 0b1100, 0b1001, 0b001>;
1644 def : RWSysReg<"ICH_AP1R2_EL2", 0b11, 0b100, 0b1100, 0b1001, 0b010>;
1645 def : RWSysReg<"ICH_AP1R3_EL2", 0b11, 0b100, 0b1100, 0b1001, 0b011>;
1646 def : RWSysReg<"ICH_HCR_EL2", 0b11, 0b100, 0b1100, 0b1011, 0b000>;
1647 def : ROSysReg<"ICH_MISR_EL2", 0b11, 0b100, 0b1100, 0b1011, 0b010>;
1648 def : RWSysReg<"ICH_VMCR_EL2", 0b11, 0b100, 0b1100, 0b1011, 0b111>;
1649 def : RWSysReg<"ICH_LR0_EL2", 0b11, 0b100, 0b1100, 0b1100, 0b000>;
1650 def : RWSysReg<"ICH_LR1_EL2", 0b11, 0b100, 0b1100, 0b1100, 0b001>;
1651 def : RWSysReg<"ICH_LR2_EL2", 0b11, 0b100, 0b1100, 0b1100, 0b010>;
1652 def : RWSysReg<"ICH_LR3_EL2", 0b11, 0b100, 0b1100, 0b1100, 0b011>;
1653 def : RWSysReg<"ICH_LR4_EL2", 0b11, 0b100, 0b1100, 0b1100, 0b100>;
1654 def : RWSysReg<"ICH_LR5_EL2", 0b11, 0b100, 0b1100, 0b1100, 0b101>;
1655 def : RWSysReg<"ICH_LR6_EL2", 0b11, 0b100, 0b1100, 0b1100, 0b110>;
1656 def : RWSysReg<"ICH_LR7_EL2", 0b11, 0b100, 0b1100, 0b1100, 0b111>;
1657 def : RWSysReg<"ICH_LR8_EL2", 0b11, 0b100, 0b1100, 0b1101, 0b000>;
1658 def : RWSysReg<"ICH_LR9_EL2", 0b11, 0b100, 0b1100, 0b1101, 0b001>;
1659 def : RWSysReg<"ICH_LR10_EL2", 0b11, 0b100, 0b1100, 0b1101, 0b010>;
1660 def : RWSysReg<"ICH_LR11_EL2", 0b11, 0b100, 0b1100, 0b1101, 0b011>;
1661 def : RWSysReg<"ICH_LR12_EL2", 0b11, 0b100, 0b1100, 0b1101, 0b100>;
1662 def : RWSysReg<"ICH_LR13_EL2", 0b11, 0b100, 0b1100, 0b1101, 0b101>;
1663 def : RWSysReg<"ICH_LR14_EL2", 0b11, 0b100, 0b1100, 0b1101, 0b110>;
1664 def : RWSysReg<"ICH_LR15_EL2", 0b11, 0b100, 0b1100, 0b1101, 0b111>;
1666 // v8r system registers
1667 let Requires = [{ {AArch64::HasV8_0rOps} }] in {
1668 //Virtualization System Control Register
1669 // Op0 Op1 CRn CRm Op2
1670 def : RWSysReg<"VSCTLR_EL2", 0b11, 0b100, 0b0010, 0b0000, 0b000>;
1673 // Op0 Op1 CRn CRm Op2
1674 def : RWSysReg<"MPUIR_EL1", 0b11, 0b000, 0b0000, 0b0000, 0b100>;
1675 def : RWSysReg<"MPUIR_EL2", 0b11, 0b100, 0b0000, 0b0000, 0b100>;
1677 //Protection Region Enable Register
1678 // Op0 Op1 CRn CRm Op2
1679 def : RWSysReg<"PRENR_EL1", 0b11, 0b000, 0b0110, 0b0001, 0b001>;
1680 def : RWSysReg<"PRENR_EL2", 0b11, 0b100, 0b0110, 0b0001, 0b001>;
1682 //Protection Region Selection Register
1683 // Op0 Op1 CRn CRm Op2
1684 def : RWSysReg<"PRSELR_EL1", 0b11, 0b000, 0b0110, 0b0010, 0b001>;
1685 def : RWSysReg<"PRSELR_EL2", 0b11, 0b100, 0b0110, 0b0010, 0b001>;
1687 //Protection Region Base Address Register
1688 // Op0 Op1 CRn CRm Op2
1689 def : RWSysReg<"PRBAR_EL1", 0b11, 0b000, 0b0110, 0b1000, 0b000>;
1690 def : RWSysReg<"PRBAR_EL2", 0b11, 0b100, 0b0110, 0b1000, 0b000>;
1692 //Protection Region Limit Address Register
1693 // Op0 Op1 CRn CRm Op2
1694 def : RWSysReg<"PRLAR_EL1", 0b11, 0b000, 0b0110, 0b1000, 0b001>;
1695 def : RWSysReg<"PRLAR_EL2", 0b11, 0b100, 0b0110, 0b1000, 0b001>;
1697 foreach n = 1-15 in {
1698 foreach x = 1-2 in {
1699 //Direct acces to Protection Region Base Address Register for n th MPU region
1700 def : RWSysReg<!strconcat("PRBAR"#n, "_EL"#x),
1701 0b11, 0b000, 0b0110, 0b1000, 0b000>{
1702 let Encoding{5-2} = n;
1703 let Encoding{13} = !add(x,-1);
1706 def : RWSysReg<!strconcat("PRLAR"#n, "_EL"#x),
1707 0b11, 0b000, 0b0110, 0b1000, 0b001>{
1708 let Encoding{5-2} = n;
1709 let Encoding{13} = !add(x,-1);
1711 } //foreach x = 1-2 in
1712 } //foreach n = 1-15 in
1713 } //let Requires = [{ {AArch64::HasV8_0rOps} }] in
1715 // v8.1a "Privileged Access Never" extension-specific system registers
1716 let Requires = [{ {AArch64::FeaturePAN} }] in
1717 def : RWSysReg<"PAN", 0b11, 0b000, 0b0100, 0b0010, 0b011>;
1719 // v8.1a "Limited Ordering Regions" extension-specific system registers
1720 // Op0 Op1 CRn CRm Op2
1721 let Requires = [{ {AArch64::FeatureLOR} }] in {
1722 def : RWSysReg<"LORSA_EL1", 0b11, 0b000, 0b1010, 0b0100, 0b000>;
1723 def : RWSysReg<"LOREA_EL1", 0b11, 0b000, 0b1010, 0b0100, 0b001>;
1724 def : RWSysReg<"LORN_EL1", 0b11, 0b000, 0b1010, 0b0100, 0b010>;
1725 def : RWSysReg<"LORC_EL1", 0b11, 0b000, 0b1010, 0b0100, 0b011>;
1728 // v8.1a "Virtualization Host extensions" system registers
1729 // Op0 Op1 CRn CRm Op2
1730 let Requires = [{ {AArch64::FeatureVH} }] in {
1731 def : RWSysReg<"TTBR1_EL2", 0b11, 0b100, 0b0010, 0b0000, 0b001>;
1732 def : RWSysReg<"CNTHV_TVAL_EL2", 0b11, 0b100, 0b1110, 0b0011, 0b000>;
1733 def : RWSysReg<"CNTHV_CVAL_EL2", 0b11, 0b100, 0b1110, 0b0011, 0b010>;
1734 def : RWSysReg<"CNTHV_CTL_EL2", 0b11, 0b100, 0b1110, 0b0011, 0b001>;
1735 def : RWSysReg<"SCTLR_EL12", 0b11, 0b101, 0b0001, 0b0000, 0b000>;
1736 def : RWSysReg<"CPACR_EL12", 0b11, 0b101, 0b0001, 0b0000, 0b010>;
1737 def : RWSysReg<"TTBR0_EL12", 0b11, 0b101, 0b0010, 0b0000, 0b000>;
1738 def : RWSysReg<"TTBR1_EL12", 0b11, 0b101, 0b0010, 0b0000, 0b001>;
1739 def : RWSysReg<"TCR_EL12", 0b11, 0b101, 0b0010, 0b0000, 0b010>;
1740 def : RWSysReg<"AFSR0_EL12", 0b11, 0b101, 0b0101, 0b0001, 0b000>;
1741 def : RWSysReg<"AFSR1_EL12", 0b11, 0b101, 0b0101, 0b0001, 0b001>;
1742 def : RWSysReg<"ESR_EL12", 0b11, 0b101, 0b0101, 0b0010, 0b000>;
1743 def : RWSysReg<"FAR_EL12", 0b11, 0b101, 0b0110, 0b0000, 0b000>;
1744 def : RWSysReg<"MAIR_EL12", 0b11, 0b101, 0b1010, 0b0010, 0b000>;
1745 def : RWSysReg<"AMAIR_EL12", 0b11, 0b101, 0b1010, 0b0011, 0b000>;
1746 def : RWSysReg<"VBAR_EL12", 0b11, 0b101, 0b1100, 0b0000, 0b000>;
1747 def : RWSysReg<"CONTEXTIDR_EL12", 0b11, 0b101, 0b1101, 0b0000, 0b001>;
1748 def : RWSysReg<"CNTKCTL_EL12", 0b11, 0b101, 0b1110, 0b0001, 0b000>;
1749 def : RWSysReg<"CNTP_TVAL_EL02", 0b11, 0b101, 0b1110, 0b0010, 0b000>;
1750 def : RWSysReg<"CNTP_CTL_EL02", 0b11, 0b101, 0b1110, 0b0010, 0b001>;
1751 def : RWSysReg<"CNTP_CVAL_EL02", 0b11, 0b101, 0b1110, 0b0010, 0b010>;
1752 def : RWSysReg<"CNTV_TVAL_EL02", 0b11, 0b101, 0b1110, 0b0011, 0b000>;
1753 def : RWSysReg<"CNTV_CTL_EL02", 0b11, 0b101, 0b1110, 0b0011, 0b001>;
1754 def : RWSysReg<"CNTV_CVAL_EL02", 0b11, 0b101, 0b1110, 0b0011, 0b010>;
1755 def : RWSysReg<"SPSR_EL12", 0b11, 0b101, 0b0100, 0b0000, 0b000>;
1756 def : RWSysReg<"ELR_EL12", 0b11, 0b101, 0b0100, 0b0000, 0b001>;
1757 let Requires = [{ {AArch64::FeatureCONTEXTIDREL2} }] in {
1758 def : RWSysReg<"CONTEXTIDR_EL2", 0b11, 0b100, 0b1101, 0b0000, 0b001>;
1762 // Op0 Op1 CRn CRm Op2
1763 let Requires = [{ {AArch64::FeaturePsUAO} }] in
1764 def : RWSysReg<"UAO", 0b11, 0b000, 0b0100, 0b0010, 0b100>;
1766 // v8.2a "Statistical Profiling extension" registers
1767 // Op0 Op1 CRn CRm Op2
1768 let Requires = [{ {AArch64::FeatureSPE} }] in {
1769 def : RWSysReg<"PMBLIMITR_EL1", 0b11, 0b000, 0b1001, 0b1010, 0b000>;
1770 def : RWSysReg<"PMBPTR_EL1", 0b11, 0b000, 0b1001, 0b1010, 0b001>;
1771 def : RWSysReg<"PMBSR_EL1", 0b11, 0b000, 0b1001, 0b1010, 0b011>;
1772 def : ROSysReg<"PMBIDR_EL1", 0b11, 0b000, 0b1001, 0b1010, 0b111>;
1773 def : RWSysReg<"PMSCR_EL2", 0b11, 0b100, 0b1001, 0b1001, 0b000>;
1774 def : RWSysReg<"PMSCR_EL12", 0b11, 0b101, 0b1001, 0b1001, 0b000>;
1775 def : RWSysReg<"PMSCR_EL1", 0b11, 0b000, 0b1001, 0b1001, 0b000>;
1776 def : RWSysReg<"PMSICR_EL1", 0b11, 0b000, 0b1001, 0b1001, 0b010>;
1777 def : RWSysReg<"PMSIRR_EL1", 0b11, 0b000, 0b1001, 0b1001, 0b011>;
1778 def : RWSysReg<"PMSFCR_EL1", 0b11, 0b000, 0b1001, 0b1001, 0b100>;
1779 def : RWSysReg<"PMSEVFR_EL1", 0b11, 0b000, 0b1001, 0b1001, 0b101>;
1780 def : RWSysReg<"PMSLATFR_EL1", 0b11, 0b000, 0b1001, 0b1001, 0b110>;
1781 def : ROSysReg<"PMSIDR_EL1", 0b11, 0b000, 0b1001, 0b1001, 0b111>;
1784 // v8.2a "RAS extension" registers
1785 // Op0 Op1 CRn CRm Op2
1786 let Requires = [{ {AArch64::FeatureRAS} }] in {
1787 def : RWSysReg<"ERRSELR_EL1", 0b11, 0b000, 0b0101, 0b0011, 0b001>;
1788 def : RWSysReg<"ERXCTLR_EL1", 0b11, 0b000, 0b0101, 0b0100, 0b001>;
1789 def : RWSysReg<"ERXSTATUS_EL1", 0b11, 0b000, 0b0101, 0b0100, 0b010>;
1790 def : RWSysReg<"ERXADDR_EL1", 0b11, 0b000, 0b0101, 0b0100, 0b011>;
1791 def : RWSysReg<"ERXMISC0_EL1", 0b11, 0b000, 0b0101, 0b0101, 0b000>;
1792 def : RWSysReg<"ERXMISC1_EL1", 0b11, 0b000, 0b0101, 0b0101, 0b001>;
1793 def : RWSysReg<"DISR_EL1", 0b11, 0b000, 0b1100, 0b0001, 0b001>;
1794 def : RWSysReg<"VDISR_EL2", 0b11, 0b100, 0b1100, 0b0001, 0b001>;
1795 def : RWSysReg<"VSESR_EL2", 0b11, 0b100, 0b0101, 0b0010, 0b011>;
1798 // v8.3a "Pointer authentication extension" registers
1799 // Op0 Op1 CRn CRm Op2
1800 let Requires = [{ {AArch64::FeaturePAuth} }] in {
1801 def : RWSysReg<"APIAKeyLo_EL1", 0b11, 0b000, 0b0010, 0b0001, 0b000>;
1802 def : RWSysReg<"APIAKeyHi_EL1", 0b11, 0b000, 0b0010, 0b0001, 0b001>;
1803 def : RWSysReg<"APIBKeyLo_EL1", 0b11, 0b000, 0b0010, 0b0001, 0b010>;
1804 def : RWSysReg<"APIBKeyHi_EL1", 0b11, 0b000, 0b0010, 0b0001, 0b011>;
1805 def : RWSysReg<"APDAKeyLo_EL1", 0b11, 0b000, 0b0010, 0b0010, 0b000>;
1806 def : RWSysReg<"APDAKeyHi_EL1", 0b11, 0b000, 0b0010, 0b0010, 0b001>;
1807 def : RWSysReg<"APDBKeyLo_EL1", 0b11, 0b000, 0b0010, 0b0010, 0b010>;
1808 def : RWSysReg<"APDBKeyHi_EL1", 0b11, 0b000, 0b0010, 0b0010, 0b011>;
1809 def : RWSysReg<"APGAKeyLo_EL1", 0b11, 0b000, 0b0010, 0b0011, 0b000>;
1810 def : RWSysReg<"APGAKeyHi_EL1", 0b11, 0b000, 0b0010, 0b0011, 0b001>;
1813 // v8.4 "Secure Exception Level 2 extension"
1814 let Requires = [{ {AArch64::FeatureSEL2} }] in {
1815 // v8.4a "Virtualization secure second stage translation" registers
1816 // Op0 Op1 CRn CRm Op2
1817 def : RWSysReg<"VSTCR_EL2" , 0b11, 0b100, 0b0010, 0b0110, 0b010>;
1818 def : RWSysReg<"VSTTBR_EL2", 0b11, 0b100, 0b0010, 0b0110, 0b000> {
1819 let Requires = [{ {AArch64::HasV8_0aOps} }];
1822 // v8.4a "Virtualization timer" registers
1823 // Op0 Op1 CRn CRm Op2
1824 def : RWSysReg<"CNTHVS_TVAL_EL2", 0b11, 0b100, 0b1110, 0b0100, 0b000>;
1825 def : RWSysReg<"CNTHVS_CVAL_EL2", 0b11, 0b100, 0b1110, 0b0100, 0b010>;
1826 def : RWSysReg<"CNTHVS_CTL_EL2", 0b11, 0b100, 0b1110, 0b0100, 0b001>;
1827 def : RWSysReg<"CNTHPS_TVAL_EL2", 0b11, 0b100, 0b1110, 0b0101, 0b000>;
1828 def : RWSysReg<"CNTHPS_CVAL_EL2", 0b11, 0b100, 0b1110, 0b0101, 0b010>;
1829 def : RWSysReg<"CNTHPS_CTL_EL2", 0b11, 0b100, 0b1110, 0b0101, 0b001>;
1831 // v8.4a "Virtualization debug state" registers
1832 // Op0 Op1 CRn CRm Op2
1833 def : RWSysReg<"SDER32_EL2", 0b11, 0b100, 0b0001, 0b0011, 0b001>;
1836 // v8.4a RAS registers
1837 // Op0 Op1 CRn CRm Op2
1838 def : RWSysReg<"ERXPFGCTL_EL1", 0b11, 0b000, 0b0101, 0b0100, 0b101>;
1839 def : RWSysReg<"ERXPFGCDN_EL1", 0b11, 0b000, 0b0101, 0b0100, 0b110>;
1840 def : RWSysReg<"ERXMISC2_EL1", 0b11, 0b000, 0b0101, 0b0101, 0b010>;
1841 def : RWSysReg<"ERXMISC3_EL1", 0b11, 0b000, 0b0101, 0b0101, 0b011>;
1842 def : ROSysReg<"ERXPFGF_EL1", 0b11, 0b000, 0b0101, 0b0100, 0b100>;
1844 // v8.4a MPAM registers
1845 // Op0 Op1 CRn CRm Op2
1846 let Requires = [{ {AArch64::FeatureMPAM} }] in {
1847 def : RWSysReg<"MPAM0_EL1", 0b11, 0b000, 0b1010, 0b0101, 0b001>;
1848 def : RWSysReg<"MPAM1_EL1", 0b11, 0b000, 0b1010, 0b0101, 0b000>;
1849 def : RWSysReg<"MPAM2_EL2", 0b11, 0b100, 0b1010, 0b0101, 0b000>;
1850 def : RWSysReg<"MPAM3_EL3", 0b11, 0b110, 0b1010, 0b0101, 0b000>;
1851 def : RWSysReg<"MPAM1_EL12", 0b11, 0b101, 0b1010, 0b0101, 0b000>;
1852 def : RWSysReg<"MPAMHCR_EL2", 0b11, 0b100, 0b1010, 0b0100, 0b000>;
1853 def : RWSysReg<"MPAMVPMV_EL2", 0b11, 0b100, 0b1010, 0b0100, 0b001>;
1854 def : RWSysReg<"MPAMVPM0_EL2", 0b11, 0b100, 0b1010, 0b0110, 0b000>;
1855 def : RWSysReg<"MPAMVPM1_EL2", 0b11, 0b100, 0b1010, 0b0110, 0b001>;
1856 def : RWSysReg<"MPAMVPM2_EL2", 0b11, 0b100, 0b1010, 0b0110, 0b010>;
1857 def : RWSysReg<"MPAMVPM3_EL2", 0b11, 0b100, 0b1010, 0b0110, 0b011>;
1858 def : RWSysReg<"MPAMVPM4_EL2", 0b11, 0b100, 0b1010, 0b0110, 0b100>;
1859 def : RWSysReg<"MPAMVPM5_EL2", 0b11, 0b100, 0b1010, 0b0110, 0b101>;
1860 def : RWSysReg<"MPAMVPM6_EL2", 0b11, 0b100, 0b1010, 0b0110, 0b110>;
1861 def : RWSysReg<"MPAMVPM7_EL2", 0b11, 0b100, 0b1010, 0b0110, 0b111>;
1862 def : ROSysReg<"MPAMIDR_EL1", 0b11, 0b000, 0b1010, 0b0100, 0b100>;
1865 // v8.4a Activity Monitor registers
1866 // Op0 Op1 CRn CRm Op2
1867 let Requires = [{ {AArch64::FeatureAM} }] in {
1868 def : RWSysReg<"AMCR_EL0", 0b11, 0b011, 0b1101, 0b0010, 0b000>;
1869 def : ROSysReg<"AMCFGR_EL0", 0b11, 0b011, 0b1101, 0b0010, 0b001>;
1870 def : ROSysReg<"AMCGCR_EL0", 0b11, 0b011, 0b1101, 0b0010, 0b010>;
1871 def : RWSysReg<"AMUSERENR_EL0", 0b11, 0b011, 0b1101, 0b0010, 0b011>;
1872 def : RWSysReg<"AMCNTENCLR0_EL0", 0b11, 0b011, 0b1101, 0b0010, 0b100>;
1873 def : RWSysReg<"AMCNTENSET0_EL0", 0b11, 0b011, 0b1101, 0b0010, 0b101>;
1874 def : RWSysReg<"AMEVCNTR00_EL0", 0b11, 0b011, 0b1101, 0b0100, 0b000>;
1875 def : RWSysReg<"AMEVCNTR01_EL0", 0b11, 0b011, 0b1101, 0b0100, 0b001>;
1876 def : RWSysReg<"AMEVCNTR02_EL0", 0b11, 0b011, 0b1101, 0b0100, 0b010>;
1877 def : RWSysReg<"AMEVCNTR03_EL0", 0b11, 0b011, 0b1101, 0b0100, 0b011>;
1878 def : ROSysReg<"AMEVTYPER00_EL0", 0b11, 0b011, 0b1101, 0b0110, 0b000>;
1879 def : ROSysReg<"AMEVTYPER01_EL0", 0b11, 0b011, 0b1101, 0b0110, 0b001>;
1880 def : ROSysReg<"AMEVTYPER02_EL0", 0b11, 0b011, 0b1101, 0b0110, 0b010>;
1881 def : ROSysReg<"AMEVTYPER03_EL0", 0b11, 0b011, 0b1101, 0b0110, 0b011>;
1882 def : RWSysReg<"AMCNTENCLR1_EL0", 0b11, 0b011, 0b1101, 0b0011, 0b000>;
1883 def : RWSysReg<"AMCNTENSET1_EL0", 0b11, 0b011, 0b1101, 0b0011, 0b001>;
1884 def : RWSysReg<"AMEVCNTR10_EL0", 0b11, 0b011, 0b1101, 0b1100, 0b000>;
1885 def : RWSysReg<"AMEVCNTR11_EL0", 0b11, 0b011, 0b1101, 0b1100, 0b001>;
1886 def : RWSysReg<"AMEVCNTR12_EL0", 0b11, 0b011, 0b1101, 0b1100, 0b010>;
1887 def : RWSysReg<"AMEVCNTR13_EL0", 0b11, 0b011, 0b1101, 0b1100, 0b011>;
1888 def : RWSysReg<"AMEVCNTR14_EL0", 0b11, 0b011, 0b1101, 0b1100, 0b100>;
1889 def : RWSysReg<"AMEVCNTR15_EL0", 0b11, 0b011, 0b1101, 0b1100, 0b101>;
1890 def : RWSysReg<"AMEVCNTR16_EL0", 0b11, 0b011, 0b1101, 0b1100, 0b110>;
1891 def : RWSysReg<"AMEVCNTR17_EL0", 0b11, 0b011, 0b1101, 0b1100, 0b111>;
1892 def : RWSysReg<"AMEVCNTR18_EL0", 0b11, 0b011, 0b1101, 0b1101, 0b000>;
1893 def : RWSysReg<"AMEVCNTR19_EL0", 0b11, 0b011, 0b1101, 0b1101, 0b001>;
1894 def : RWSysReg<"AMEVCNTR110_EL0", 0b11, 0b011, 0b1101, 0b1101, 0b010>;
1895 def : RWSysReg<"AMEVCNTR111_EL0", 0b11, 0b011, 0b1101, 0b1101, 0b011>;
1896 def : RWSysReg<"AMEVCNTR112_EL0", 0b11, 0b011, 0b1101, 0b1101, 0b100>;
1897 def : RWSysReg<"AMEVCNTR113_EL0", 0b11, 0b011, 0b1101, 0b1101, 0b101>;
1898 def : RWSysReg<"AMEVCNTR114_EL0", 0b11, 0b011, 0b1101, 0b1101, 0b110>;
1899 def : RWSysReg<"AMEVCNTR115_EL0", 0b11, 0b011, 0b1101, 0b1101, 0b111>;
1900 def : RWSysReg<"AMEVTYPER10_EL0", 0b11, 0b011, 0b1101, 0b1110, 0b000>;
1901 def : RWSysReg<"AMEVTYPER11_EL0", 0b11, 0b011, 0b1101, 0b1110, 0b001>;
1902 def : RWSysReg<"AMEVTYPER12_EL0", 0b11, 0b011, 0b1101, 0b1110, 0b010>;
1903 def : RWSysReg<"AMEVTYPER13_EL0", 0b11, 0b011, 0b1101, 0b1110, 0b011>;
1904 def : RWSysReg<"AMEVTYPER14_EL0", 0b11, 0b011, 0b1101, 0b1110, 0b100>;
1905 def : RWSysReg<"AMEVTYPER15_EL0", 0b11, 0b011, 0b1101, 0b1110, 0b101>;
1906 def : RWSysReg<"AMEVTYPER16_EL0", 0b11, 0b011, 0b1101, 0b1110, 0b110>;
1907 def : RWSysReg<"AMEVTYPER17_EL0", 0b11, 0b011, 0b1101, 0b1110, 0b111>;
1908 def : RWSysReg<"AMEVTYPER18_EL0", 0b11, 0b011, 0b1101, 0b1111, 0b000>;
1909 def : RWSysReg<"AMEVTYPER19_EL0", 0b11, 0b011, 0b1101, 0b1111, 0b001>;
1910 def : RWSysReg<"AMEVTYPER110_EL0", 0b11, 0b011, 0b1101, 0b1111, 0b010>;
1911 def : RWSysReg<"AMEVTYPER111_EL0", 0b11, 0b011, 0b1101, 0b1111, 0b011>;
1912 def : RWSysReg<"AMEVTYPER112_EL0", 0b11, 0b011, 0b1101, 0b1111, 0b100>;
1913 def : RWSysReg<"AMEVTYPER113_EL0", 0b11, 0b011, 0b1101, 0b1111, 0b101>;
1914 def : RWSysReg<"AMEVTYPER114_EL0", 0b11, 0b011, 0b1101, 0b1111, 0b110>;
1915 def : RWSysReg<"AMEVTYPER115_EL0", 0b11, 0b011, 0b1101, 0b1111, 0b111>;
1918 // v8.4a Trace Extension registers
1920 // Please note that the 8.4 spec also defines these registers:
1921 // TRCIDR1, ID_DFR0_EL1, ID_AA64DFR0_EL1, MDSCR_EL1, MDCR_EL2, and MDCR_EL3,
1922 // but they are already defined above.
1924 // Op0 Op1 CRn CRm Op2
1925 let Requires = [{ {AArch64::FeatureTRACEV8_4} }] in {
1926 def : RWSysReg<"TRFCR_EL1", 0b11, 0b000, 0b0001, 0b0010, 0b001>;
1927 def : RWSysReg<"TRFCR_EL2", 0b11, 0b100, 0b0001, 0b0010, 0b001>;
1928 def : RWSysReg<"TRFCR_EL12", 0b11, 0b101, 0b0001, 0b0010, 0b001>;
1929 } //FeatureTRACEV8_4
1931 // v8.4a Timing insensitivity of data processing instructions
1932 // DIT: Data Independent Timing instructions
1933 // Op0 Op1 CRn CRm Op2
1934 let Requires = [{ {AArch64::FeatureDIT} }] in {
1935 def : RWSysReg<"DIT", 0b11, 0b011, 0b0100, 0b0010, 0b101>;
1938 // v8.4a Enhanced Support for Nested Virtualization
1939 // Op0 Op1 CRn CRm Op2
1940 let Requires = [{ {AArch64::FeatureNV} }] in {
1941 def : RWSysReg<"VNCR_EL2", 0b11, 0b100, 0b0010, 0b0010, 0b000>;
1944 // SVE control registers
1945 // Op0 Op1 CRn CRm Op2
1946 let Requires = [{ {AArch64::FeatureSVE} }] in {
1947 def : RWSysReg<"ZCR_EL1", 0b11, 0b000, 0b0001, 0b0010, 0b000>;
1948 def : RWSysReg<"ZCR_EL2", 0b11, 0b100, 0b0001, 0b0010, 0b000>;
1949 def : RWSysReg<"ZCR_EL3", 0b11, 0b110, 0b0001, 0b0010, 0b000>;
1950 def : RWSysReg<"ZCR_EL12", 0b11, 0b101, 0b0001, 0b0010, 0b000>;
1953 // V8.5a Spectre mitigation SSBS register
1954 // Op0 Op1 CRn CRm Op2
1955 let Requires = [{ {AArch64::FeatureSSBS} }] in
1956 def : RWSysReg<"SSBS", 0b11, 0b011, 0b0100, 0b0010, 0b110>;
1958 // v8.5a Memory Tagging Extension
1959 // Op0 Op1 CRn CRm Op2
1960 let Requires = [{ {AArch64::FeatureMTE} }] in {
1961 def : RWSysReg<"TCO", 0b11, 0b011, 0b0100, 0b0010, 0b111>;
1962 def : RWSysReg<"GCR_EL1", 0b11, 0b000, 0b0001, 0b0000, 0b110>;
1963 def : RWSysReg<"RGSR_EL1", 0b11, 0b000, 0b0001, 0b0000, 0b101>;
1964 def : RWSysReg<"TFSR_EL1", 0b11, 0b000, 0b0101, 0b0110, 0b000>;
1965 def : RWSysReg<"TFSR_EL2", 0b11, 0b100, 0b0101, 0b0110, 0b000>;
1966 def : RWSysReg<"TFSR_EL3", 0b11, 0b110, 0b0101, 0b0110, 0b000>;
1967 def : RWSysReg<"TFSR_EL12", 0b11, 0b101, 0b0101, 0b0110, 0b000>;
1968 def : RWSysReg<"TFSRE0_EL1", 0b11, 0b000, 0b0101, 0b0110, 0b001>;
1969 def : ROSysReg<"GMID_EL1", 0b11, 0b001, 0b0000, 0b0000, 0b100>;
1972 // Embedded Trace Extension R/W System registers
1973 let Requires = [{ {AArch64::FeatureETE} }] in {
1974 // Name Op0 Op1 CRn CRm Op2
1975 def : RWSysReg<"TRCRSR", 0b10, 0b001, 0b0000, 0b1010, 0b000>;
1976 // TRCEXTINSELR0 has the same encoding as ETM TRCEXTINSELR
1977 def : RWSysReg<"TRCEXTINSELR0", 0b10, 0b001, 0b0000, 0b1000, 0b100>;
1978 def : RWSysReg<"TRCEXTINSELR1", 0b10, 0b001, 0b0000, 0b1001, 0b100>;
1979 def : RWSysReg<"TRCEXTINSELR2", 0b10, 0b001, 0b0000, 0b1010, 0b100>;
1980 def : RWSysReg<"TRCEXTINSELR3", 0b10, 0b001, 0b0000, 0b1011, 0b100>;
1983 // Trace Buffer Extension System registers
1984 let Requires = [{ {AArch64::FeatureTRBE} }] in {
1985 // Name Op0 Op1 CRn CRm Op2
1986 def : RWSysReg<"TRBLIMITR_EL1", 0b11, 0b000, 0b1001, 0b1011, 0b000>;
1987 def : RWSysReg<"TRBPTR_EL1", 0b11, 0b000, 0b1001, 0b1011, 0b001>;
1988 def : RWSysReg<"TRBBASER_EL1", 0b11, 0b000, 0b1001, 0b1011, 0b010>;
1989 def : RWSysReg<"TRBSR_EL1", 0b11, 0b000, 0b1001, 0b1011, 0b011>;
1990 def : RWSysReg<"TRBMAR_EL1", 0b11, 0b000, 0b1001, 0b1011, 0b100>;
1991 def : RWSysReg<"TRBMPAM_EL1", 0b11, 0b000, 0b1001, 0b1011, 0b101>;
1992 def : RWSysReg<"TRBTRG_EL1", 0b11, 0b000, 0b1001, 0b1011, 0b110>;
1993 def : ROSysReg<"TRBIDR_EL1", 0b11, 0b000, 0b1001, 0b1011, 0b111>;
1997 // v8.6a Activity Monitors Virtualization Support
1998 let Requires = [{ {AArch64::FeatureAMVS} }] in {
1999 // Name Op0 Op1 CRn CRm Op2
2000 def : ROSysReg<"AMCG1IDR_EL0", 0b11, 0b011, 0b1101, 0b0010, 0b110>;
2001 foreach n = 0-15 in {
2002 foreach x = 0-1 in {
2003 def : RWSysReg<"AMEVCNTVOFF"#x#n#"_EL2",
2004 0b11, 0b100, 0b1101, 0b1000, 0b000>{
2005 let Encoding{4} = x;
2006 let Encoding{3-0} = n;
2012 // v8.6a Fine Grained Virtualization Traps
2013 // Op0 Op1 CRn CRm Op2
2014 let Requires = [{ {AArch64::FeatureFineGrainedTraps} }] in {
2015 def : RWSysReg<"HFGRTR_EL2", 0b11, 0b100, 0b0001, 0b0001, 0b100>;
2016 def : RWSysReg<"HFGWTR_EL2", 0b11, 0b100, 0b0001, 0b0001, 0b101>;
2017 def : RWSysReg<"HFGITR_EL2", 0b11, 0b100, 0b0001, 0b0001, 0b110>;
2018 def : RWSysReg<"HDFGRTR_EL2", 0b11, 0b100, 0b0011, 0b0001, 0b100>;
2019 def : RWSysReg<"HDFGWTR_EL2", 0b11, 0b100, 0b0011, 0b0001, 0b101>;
2020 def : RWSysReg<"HAFGRTR_EL2", 0b11, 0b100, 0b0011, 0b0001, 0b110>;
2022 // v8.9a/v9.4a additions to Fine Grained Traps (FEAT_FGT2)
2023 // Op0 Op1 CRn CRm Op2
2024 def : RWSysReg<"HDFGRTR2_EL2", 0b11, 0b100, 0b0011, 0b0001, 0b000>;
2025 def : RWSysReg<"HDFGWTR2_EL2", 0b11, 0b100, 0b0011, 0b0001, 0b001>;
2026 def : RWSysReg<"HFGRTR2_EL2", 0b11, 0b100, 0b0011, 0b0001, 0b010>;
2027 def : RWSysReg<"HFGWTR2_EL2", 0b11, 0b100, 0b0011, 0b0001, 0b011>;
2028 def : RWSysReg<"HFGITR2_EL2", 0b11, 0b100, 0b0011, 0b0001, 0b111>;
2031 // v8.6a Enhanced Counter Virtualization
2032 // Op0 Op1 CRn CRm Op2
2033 let Requires = [{ {AArch64::FeatureEnhancedCounterVirtualization} }] in {
2034 def : RWSysReg<"CNTSCALE_EL2", 0b11, 0b100, 0b1110, 0b0000, 0b100>;
2035 def : RWSysReg<"CNTISCALE_EL2", 0b11, 0b100, 0b1110, 0b0000, 0b101>;
2036 def : RWSysReg<"CNTPOFF_EL2", 0b11, 0b100, 0b1110, 0b0000, 0b110>;
2037 def : RWSysReg<"CNTVFRQ_EL2", 0b11, 0b100, 0b1110, 0b0000, 0b111>;
2038 def : ROSysReg<"CNTPCTSS_EL0", 0b11, 0b011, 0b1110, 0b0000, 0b101>;
2039 def : ROSysReg<"CNTVCTSS_EL0", 0b11, 0b011, 0b1110, 0b0000, 0b110>;
2042 // v8.7a LD64B/ST64B Accelerator Extension system register
2043 let Requires = [{ {AArch64::FeatureLS64} }] in
2044 def : RWSysReg<"ACCDATA_EL1", 0b11, 0b000, 0b1101, 0b0000, 0b101>;
2046 // Branch Record Buffer system registers
2047 let Requires = [{ {AArch64::FeatureBRBE} }] in {
2048 def : RWSysReg<"BRBCR_EL1", 0b10, 0b001, 0b1001, 0b0000, 0b000>;
2049 def : RWSysReg<"BRBCR_EL12", 0b10, 0b101, 0b1001, 0b0000, 0b000>;
2050 def : RWSysReg<"BRBCR_EL2", 0b10, 0b100, 0b1001, 0b0000, 0b000>;
2051 def : RWSysReg<"BRBFCR_EL1", 0b10, 0b001, 0b1001, 0b0000, 0b001>;
2052 def : ROSysReg<"BRBIDR0_EL1", 0b10, 0b001, 0b1001, 0b0010, 0b000>;
2053 def : RWSysReg<"BRBINFINJ_EL1", 0b10, 0b001, 0b1001, 0b0001, 0b000>;
2054 def : RWSysReg<"BRBSRCINJ_EL1", 0b10, 0b001, 0b1001, 0b0001, 0b001>;
2055 def : RWSysReg<"BRBTGTINJ_EL1", 0b10, 0b001, 0b1001, 0b0001, 0b010>;
2056 def : RWSysReg<"BRBTS_EL1", 0b10, 0b001, 0b1001, 0b0000, 0b010>;
2057 foreach n = 0-31 in {
2058 defvar nb = !cast<bits<5>>(n);
2059 def : ROSysReg<"BRBINF"#n#"_EL1", 0b10, 0b001, 0b1000, nb{3-0}, {nb{4},0b00}>;
2060 def : ROSysReg<"BRBSRC"#n#"_EL1", 0b10, 0b001, 0b1000, nb{3-0}, {nb{4},0b01}>;
2061 def : ROSysReg<"BRBTGT"#n#"_EL1", 0b10, 0b001, 0b1000, nb{3-0}, {nb{4},0b10}>;
2065 // Statistical Profiling Extension system register
2066 let Requires = [{ {AArch64::FeatureSPE_EEF} }] in
2067 def : RWSysReg<"PMSNEVFR_EL1", 0b11, 0b000, 0b1001, 0b1001, 0b001>;
2069 // Scalable Matrix Extension (SME)
2070 // Op0 Op1 CRn CRm Op2
2071 let Requires = [{ {AArch64::FeatureSME} }] in {
2072 def : RWSysReg<"SMCR_EL1", 0b11, 0b000, 0b0001, 0b0010, 0b110>;
2073 def : RWSysReg<"SMCR_EL2", 0b11, 0b100, 0b0001, 0b0010, 0b110>;
2074 def : RWSysReg<"SMCR_EL3", 0b11, 0b110, 0b0001, 0b0010, 0b110>;
2075 def : RWSysReg<"SMCR_EL12", 0b11, 0b101, 0b0001, 0b0010, 0b110>;
2076 def : RWSysReg<"SVCR", 0b11, 0b011, 0b0100, 0b0010, 0b010>;
2077 def : RWSysReg<"SMPRI_EL1", 0b11, 0b000, 0b0001, 0b0010, 0b100>;
2078 def : RWSysReg<"SMPRIMAP_EL2", 0b11, 0b100, 0b0001, 0b0010, 0b101>;
2079 def : ROSysReg<"SMIDR_EL1", 0b11, 0b001, 0b0000, 0b0000, 0b110>;
2080 def : RWSysReg<"TPIDR2_EL0", 0b11, 0b011, 0b1101, 0b0000, 0b101>;
2083 // v8.4a MPAM and SME registers
2084 // Op0 Op1 CRn CRm Op2
2085 let Requires = [{ {AArch64::FeatureMPAM, AArch64::FeatureSME} }] in {
2086 def : RWSysReg<"MPAMSM_EL1", 0b11, 0b000, 0b1010, 0b0101, 0b011>;
2087 } // HasMPAM, HasSME
2089 // v8.8a Non-Maskable Interrupts
2090 let Requires = [{ {AArch64::FeatureNMI} }] in {
2091 // Op0 Op1 CRn CRm Op2
2092 def : RWSysReg<"ALLINT", 0b11, 0b000, 0b0100, 0b0011, 0b000>;
2093 def : ROSysReg<"ICC_NMIAR1_EL1", 0b11, 0b000, 0b1100, 0b1001, 0b101>; // FEAT_GICv3_NMI
2096 // v9.4a Guarded Control Stack Extension (GCS)
2097 // Op0 Op1 CRn CRm Op2
2098 def : RWSysReg<"GCSCR_EL1", 0b11, 0b000, 0b0010, 0b0101, 0b000>;
2099 def : RWSysReg<"GCSPR_EL1", 0b11, 0b000, 0b0010, 0b0101, 0b001>;
2100 def : RWSysReg<"GCSCRE0_EL1", 0b11, 0b000, 0b0010, 0b0101, 0b010>;
2101 def : RWSysReg<"GCSPR_EL0", 0b11, 0b011, 0b0010, 0b0101, 0b001>;
2102 def : RWSysReg<"GCSCR_EL2", 0b11, 0b100, 0b0010, 0b0101, 0b000>;
2103 def : RWSysReg<"GCSPR_EL2", 0b11, 0b100, 0b0010, 0b0101, 0b001>;
2104 def : RWSysReg<"GCSCR_EL12", 0b11, 0b101, 0b0010, 0b0101, 0b000>;
2105 def : RWSysReg<"GCSPR_EL12", 0b11, 0b101, 0b0010, 0b0101, 0b001>;
2106 def : RWSysReg<"GCSCR_EL3", 0b11, 0b110, 0b0010, 0b0101, 0b000>;
2107 def : RWSysReg<"GCSPR_EL3", 0b11, 0b110, 0b0010, 0b0101, 0b001>;
2109 // v8.9a/v9.4a Memory Attribute Index Enhancement (FEAT_AIE)
2110 // Op0 Op1 CRn CRm Op2
2111 def : RWSysReg<"AMAIR2_EL1", 0b11, 0b000, 0b1010, 0b0011, 0b001>;
2112 def : RWSysReg<"AMAIR2_EL12", 0b11, 0b101, 0b1010, 0b0011, 0b001>;
2113 def : RWSysReg<"AMAIR2_EL2", 0b11, 0b100, 0b1010, 0b0011, 0b001>;
2114 def : RWSysReg<"AMAIR2_EL3", 0b11, 0b110, 0b1010, 0b0011, 0b001>;
2115 def : RWSysReg<"MAIR2_EL1", 0b11, 0b000, 0b1010, 0b0010, 0b001>;
2116 def : RWSysReg<"MAIR2_EL12", 0b11, 0b101, 0b1010, 0b0010, 0b001>;
2117 def : RWSysReg<"MAIR2_EL2", 0b11, 0b100, 0b1010, 0b0001, 0b001>;
2118 def : RWSysReg<"MAIR2_EL3", 0b11, 0b110, 0b1010, 0b0001, 0b001>;
2120 // v8.9a/9.4a Stage 1 Permission Indirection Extension (FEAT_S1PIE)
2121 // Op0 Op1 CRn CRm Op2
2122 def : RWSysReg<"PIRE0_EL1", 0b11, 0b000, 0b1010, 0b0010, 0b010>;
2123 def : RWSysReg<"PIRE0_EL12", 0b11, 0b101, 0b1010, 0b0010, 0b010>;
2124 def : RWSysReg<"PIRE0_EL2", 0b11, 0b100, 0b1010, 0b0010, 0b010>;
2125 def : RWSysReg<"PIR_EL1", 0b11, 0b000, 0b1010, 0b0010, 0b011>;
2126 def : RWSysReg<"PIR_EL12", 0b11, 0b101, 0b1010, 0b0010, 0b011>;
2127 def : RWSysReg<"PIR_EL2", 0b11, 0b100, 0b1010, 0b0010, 0b011>;
2128 def : RWSysReg<"PIR_EL3", 0b11, 0b110, 0b1010, 0b0010, 0b011>;
2130 // v8.9a/v9.4a Stage 2 Permission Indirection Extension (FEAT_S2PIE)
2131 // Op0 Op1 CRn CRm Op2
2132 def : RWSysReg<"S2PIR_EL2", 0b11, 0b100, 0b1010, 0b0010, 0b101>;
2134 // v8.9a/v9.4a Stage 1 Permission Overlay Extension (FEAT_S1POE)
2135 // Op0 Op1 CRn CRm Op2
2136 def : RWSysReg<"POR_EL0", 0b11, 0b011, 0b1010, 0b0010, 0b100>;
2137 def : RWSysReg<"POR_EL1", 0b11, 0b000, 0b1010, 0b0010, 0b100>;
2138 def : RWSysReg<"POR_EL12", 0b11, 0b101, 0b1010, 0b0010, 0b100>;
2139 def : RWSysReg<"POR_EL2", 0b11, 0b100, 0b1010, 0b0010, 0b100>;
2140 def : RWSysReg<"POR_EL3", 0b11, 0b110, 0b1010, 0b0010, 0b100>;
2142 // v8.9a/v9.4a Stage 2 Permission Overlay Extension (FEAT_S2POE)
2143 // Op0 Op1 CRn CRm Op2
2144 def : RWSysReg<"S2POR_EL1", 0b11, 0b000, 0b1010, 0b0010, 0b101>;
2146 // v8.9a/v9.4a Extension to System Control Registers (FEAT_SCTLR2)
2147 // Op0 Op1 CRn CRm Op2
2148 def : RWSysReg<"SCTLR2_EL1", 0b11, 0b000, 0b0001, 0b0000, 0b011>;
2149 def : RWSysReg<"SCTLR2_EL12", 0b11, 0b101, 0b0001, 0b0000, 0b011>;
2150 def : RWSysReg<"SCTLR2_EL2", 0b11, 0b100, 0b0001, 0b0000, 0b011>;
2151 def : RWSysReg<"SCTLR2_EL3", 0b11, 0b110, 0b0001, 0b0000, 0b011>;
2153 // v8.9a/v9.4a Extension to Translation Control Registers (FEAT_TCR2)
2154 // Op0 Op1 CRn CRm Op2
2155 def : RWSysReg<"TCR2_EL1", 0b11, 0b000, 0b0010, 0b0000, 0b011>;
2156 def : RWSysReg<"TCR2_EL12", 0b11, 0b101, 0b0010, 0b0000, 0b011>;
2157 def : RWSysReg<"TCR2_EL2", 0b11, 0b100, 0b0010, 0b0000, 0b011>;
2159 // v8.9a/9.4a Translation Hardening Extension (FEAT_THE)
2160 // Op0 Op1 CRn CRm Op2
2161 let Requires = [{ {AArch64::FeatureTHE} }] in {
2162 def : RWSysReg<"RCWMASK_EL1", 0b11, 0b000, 0b1101, 0b0000, 0b110>;
2163 def : RWSysReg<"RCWSMASK_EL1", 0b11, 0b000, 0b1101, 0b0000, 0b011>;
2166 // v8.9a/9.4a new Debug feature (FEAT_DEBUGv8p9)
2167 // Op0 Op1 CRn CRm Op2
2168 def : RWSysReg<"MDSELR_EL1", 0b10, 0b000, 0b0000, 0b0100, 0b010>;
2170 // v8.9a/9.4a new Performance Monitors Extension (FEAT_PMUv3p9)
2171 // Op0 Op1 CRn CRm Op2
2172 def : RWSysReg<"PMUACR_EL1", 0b11, 0b000, 0b1001, 0b1110, 0b100>;
2174 // v8.9a/9.4a PMU Snapshot Extension (FEAT_PMUv3_SS)
2175 // Op0 Op1 CRn CRm Op2
2176 def : ROSysReg<"PMCCNTSVR_EL1", 0b10, 0b000, 0b1110, 0b1011, 0b111>;
2177 def : ROSysReg<"PMICNTSVR_EL1", 0b10, 0b000, 0b1110, 0b1100, 0b000>;
2178 def : RWSysReg<"PMSSCR_EL1", 0b11, 0b000, 0b1001, 0b1101, 0b011>;
2179 foreach n = 0-30 in {
2180 defvar nb = !cast<bits<5>>(n);
2181 def : ROSysReg<"PMEVCNTSVR"#n#"_EL1", 0b10, 0b000, 0b1110, {0b10,nb{4-3}}, nb{2-0}>;
2184 // v8.9a/v9.4a PMUv3 Fixed-function instruction counter (FEAT_PMUv3_ICNTR)
2185 // Op0 Op1 CRn CRm Op2
2186 def : RWSysReg<"PMICNTR_EL0", 0b11, 0b011, 0b1001, 0b0100, 0b000>;
2187 def : RWSysReg<"PMICFILTR_EL0", 0b11, 0b011, 0b1001, 0b0110, 0b000>;
2189 // v8.9a/v9.4a PMUv3 Performance Monitors Zero with Mask (FEAT_PMUv3p9/FEAT_PMUv3_ICNTR)
2190 // Op0 Op1 CRn CRm Op2
2191 def : WOSysReg<"PMZR_EL0", 0b11, 0b011, 0b1001, 0b1101, 0b100>;
2193 // v8.9a/9.4a Synchronous-Exception-Based Event Profiling extension (FEAT_SEBEP)
2194 // Op0 Op1 CRn CRm Op2
2195 def : RWSysReg<"PMECR_EL1", 0b11, 0b000, 0b1001, 0b1110, 0b101>;
2196 def : RWSysReg<"PMIAR_EL1", 0b11, 0b000, 0b1001, 0b1110, 0b111>;
2198 // v8.9a/9.4a System Performance Monitors Extension (FEAT_SPMU)
2199 // Op0 Op1 CRn CRm Op2
2200 def : RWSysReg<"SPMACCESSR_EL1", 0b10, 0b000, 0b1001, 0b1101, 0b011>;
2201 def : RWSysReg<"SPMACCESSR_EL12", 0b10, 0b101, 0b1001, 0b1101, 0b011>;
2202 def : RWSysReg<"SPMACCESSR_EL2", 0b10, 0b100, 0b1001, 0b1101, 0b011>;
2203 def : RWSysReg<"SPMACCESSR_EL3", 0b10, 0b110, 0b1001, 0b1101, 0b011>;
2204 def : RWSysReg<"SPMCNTENCLR_EL0", 0b10, 0b011, 0b1001, 0b1100, 0b010>;
2205 def : RWSysReg<"SPMCNTENSET_EL0", 0b10, 0b011, 0b1001, 0b1100, 0b001>;
2206 def : RWSysReg<"SPMCR_EL0", 0b10, 0b011, 0b1001, 0b1100, 0b000>;
2207 def : ROSysReg<"SPMDEVAFF_EL1", 0b10, 0b000, 0b1001, 0b1101, 0b110>;
2208 def : ROSysReg<"SPMDEVARCH_EL1", 0b10, 0b000, 0b1001, 0b1101, 0b101>;
2209 foreach n = 0-15 in {
2210 defvar nb = !cast<bits<4>>(n);
2211 // Op0 Op1 CRn CRm Op2
2212 def : RWSysReg<"SPMEVCNTR"#n#"_EL0", 0b10, 0b011, 0b1110, {0b000,nb{3}}, nb{2-0}>;
2213 def : RWSysReg<"SPMEVFILT2R"#n#"_EL0", 0b10, 0b011, 0b1110, {0b011,nb{3}}, nb{2-0}>;
2214 def : RWSysReg<"SPMEVFILTR"#n#"_EL0", 0b10, 0b011, 0b1110, {0b010,nb{3}}, nb{2-0}>;
2215 def : RWSysReg<"SPMEVTYPER"#n#"_EL0", 0b10, 0b011, 0b1110, {0b001,nb{3}}, nb{2-0}>;
2217 // Op0 Op1 CRn CRm Op2
2218 def : ROSysReg<"SPMIIDR_EL1", 0b10, 0b000, 0b1001, 0b1101, 0b100>;
2219 def : RWSysReg<"SPMINTENCLR_EL1", 0b10, 0b000, 0b1001, 0b1110, 0b010>;
2220 def : RWSysReg<"SPMINTENSET_EL1", 0b10, 0b000, 0b1001, 0b1110, 0b001>;
2221 def : RWSysReg<"SPMOVSCLR_EL0", 0b10, 0b011, 0b1001, 0b1100, 0b011>;
2222 def : RWSysReg<"SPMOVSSET_EL0", 0b10, 0b011, 0b1001, 0b1110, 0b011>;
2223 def : RWSysReg<"SPMSELR_EL0", 0b10, 0b011, 0b1001, 0b1100, 0b101>;
2224 def : ROSysReg<"SPMCGCR0_EL1", 0b10, 0b000, 0b1001, 0b1101, 0b000>;
2225 def : ROSysReg<"SPMCGCR1_EL1", 0b10, 0b000, 0b1001, 0b1101, 0b001>;
2226 def : ROSysReg<"SPMCFGR_EL1", 0b10, 0b000, 0b1001, 0b1101, 0b111>;
2227 def : RWSysReg<"SPMROOTCR_EL3", 0b10, 0b110, 0b1001, 0b1110, 0b111>;
2228 def : RWSysReg<"SPMSCR_EL1", 0b10, 0b111, 0b1001, 0b1110, 0b111>;
2230 // v8.9a/9.4a Instrumentation Extension (FEAT_ITE)
2231 // Op0 Op1 CRn CRm Op2
2232 let Requires = [{ {AArch64::FeatureITE} }] in {
2233 def : RWSysReg<"TRCITEEDCR", 0b10, 0b001, 0b0000, 0b0010, 0b001>;
2234 def : RWSysReg<"TRCITECR_EL1", 0b11, 0b000, 0b0001, 0b0010, 0b011>;
2235 def : RWSysReg<"TRCITECR_EL12", 0b11, 0b101, 0b0001, 0b0010, 0b011>;
2236 def : RWSysReg<"TRCITECR_EL2", 0b11, 0b100, 0b0001, 0b0010, 0b011>;
2239 // v8.9a/9.4a SPE Data Source Filtering (FEAT_SPE_FDS)
2240 // Op0 Op1 CRn CRm Op2
2241 def : RWSysReg<"PMSDSFR_EL1", 0b11, 0b000, 0b1001, 0b1010, 0b100>;
2243 // v8.9a/9.4a RASv2 (FEAT_RASv2)
2244 // Op0 Op1 CRn CRm Op2
2245 let Requires = [{ {AArch64::FeatureRASv2} }] in
2246 def : ROSysReg<"ERXGSR_EL1", 0b11, 0b000, 0b0101, 0b0011, 0b010>;
2248 // v8.9a/9.4a Physical Fault Address (FEAT_PFAR)
2249 // Op0 Op1 CRn CRm Op2
2250 def : RWSysReg<"PFAR_EL1", 0b11, 0b000, 0b0110, 0b0000, 0b101>;
2251 def : RWSysReg<"PFAR_EL12", 0b11, 0b101, 0b0110, 0b0000, 0b101>;
2252 def : RWSysReg<"PFAR_EL2", 0b11, 0b100, 0b0110, 0b0000, 0b101>;
2254 // v9.4a Exception-based event profiling (FEAT_EBEP)
2255 // Op0 Op1 CRn CRm Op2
2256 def : RWSysReg<"PM", 0b11, 0b000, 0b0100, 0b0011, 0b001>;
2258 // 2023 ISA Extension
2259 // AArch64 Floating-point Mode Register controls behaviors of the FP8
2260 // instructions (FEAT_FPMR)
2261 // Op0 Op1 CRn CRm Op2
2262 def : ROSysReg<"ID_AA64FPFR0_EL1", 0b11, 0b000, 0b0000, 0b0100, 0b111>;
2263 def : RWSysReg<"FPMR", 0b11, 0b011, 0b0100, 0b0100, 0b010>;
2265 // v9.5a Software Stepping Enhancements (FEAT_STEP2)
2266 // Op0 Op1 CRn CRm Op2
2267 def : RWSysReg<"MDSTEPOP_EL1", 0b10, 0b000, 0b0000, 0b0101, 0b010>;
2269 // v9.5a System PMU zero register (FEAT_SPMU2)
2270 // Op0 Op1 CRn CRm Op2
2271 def : WOSysReg<"SPMZR_EL0", 0b10, 0b011, 0b1001, 0b1100, 0b100>;
2273 // v9.5a Delegated SError exceptions for EL3 (FEAT_E3DSE)
2274 // Op0 Op1 CRn CRm Op2
2275 def : RWSysReg<"VDISR_EL3", 0b11, 0b110, 0b1100, 0b0001, 0b001>;
2276 def : RWSysReg<"VSESR_EL3", 0b11, 0b110, 0b0101, 0b0010, 0b011>;
2278 // v9.5a Hardware Dirty State Tracking Structure (FEAT_HDBSS)
2279 // Op0 Op1 CRn CRm Op2
2280 def : RWSysReg<"HDBSSBR_EL2", 0b11, 0b100, 0b0010, 0b0011, 0b010>;
2281 def : RWSysReg<"HDBSSPROD_EL2", 0b11, 0b100, 0b0010, 0b0011, 0b011>;
2283 // v9.5a Hardware Accelerator for Cleaning Dirty State (FEAT_HACDBS)
2284 // Op0 Op1 CRn CRm Op2
2285 def : RWSysReg<"HACDBSBR_EL2", 0b11, 0b100, 0b0010, 0b0011, 0b100>;
2286 def : RWSysReg<"HACDBSCONS_EL2", 0b11, 0b100, 0b0010, 0b0011, 0b101>;
2288 // v9.5a Fine Grained Write Trap EL3 (FEAT_FGWTE3)
2289 // Op0 Op1 CRn CRm Op2
2290 def : RWSysReg<"FGWTE3_EL3", 0b11, 0b110, 0b0001, 0b0001, 0b101>;
2292 // v9.6a Memory partitioning and monitoring (FEAT_MPAM) registers
2293 // Op0 Op1 CRn CRm Op2
2294 def : ROSysReg<"MPAMBWIDR_EL1", 0b11, 0b000, 0b1010, 0b0100, 0b101>;
2295 def : RWSysReg<"MPAMBW3_EL3", 0b11, 0b110, 0b1010, 0b0101, 0b100>;
2296 def : RWSysReg<"MPAMBW2_EL2", 0b11, 0b100, 0b1010, 0b0101, 0b100>;
2297 def : RWSysReg<"MPAMBW1_EL1", 0b11, 0b000, 0b1010, 0b0101, 0b100>;
2298 def : RWSysReg<"MPAMBW1_EL12", 0b11, 0b101, 0b1010, 0b0101, 0b100>;
2299 def : RWSysReg<"MPAMBW0_EL1", 0b11, 0b000, 0b1010, 0b0101, 0b101>;
2300 def : RWSysReg<"MPAMBWCAP_EL2", 0b11, 0b100, 0b1010, 0b0101, 0b110>;
2301 def : RWSysReg<"MPAMBWSM_EL1", 0b11, 0b000, 0b1010, 0b0101, 0b111>;
2303 //===----------------------------------------------------------------------===//
2304 // FEAT_SRMASK v9.6a registers
2305 //===----------------------------------------------------------------------===//
2306 def : RWSysReg<"SCTLRMASK_EL1", 0b11, 0b000, 0b0001, 0b0100, 0b000>;
2307 def : RWSysReg<"SCTLRMASK_EL2", 0b11, 0b100, 0b0001, 0b0100, 0b000>;
2308 def : RWSysReg<"SCTLRMASK_EL12", 0b11, 0b101, 0b0001, 0b0100, 0b000>;
2309 def : RWSysReg<"CPACRMASK_EL1", 0b11, 0b000, 0b0001, 0b0100, 0b010>;
2310 def : RWSysReg<"CPTRMASK_EL2", 0b11, 0b100, 0b0001, 0b0100, 0b010>;
2311 def : RWSysReg<"CPACRMASK_EL12", 0b11, 0b101, 0b0001, 0b0100, 0b010>;
2312 def : RWSysReg<"SCTLR2MASK_EL1", 0b11, 0b000, 0b0001, 0b0100, 0b011>;
2313 def : RWSysReg<"SCTLR2MASK_EL2", 0b11, 0b100, 0b0001, 0b0100, 0b011>;
2314 def : RWSysReg<"SCTLR2MASK_EL12", 0b11, 0b101, 0b0001, 0b0100, 0b011>;
2315 def : RWSysReg<"CPACRALIAS_EL1", 0b11, 0b000, 0b0001, 0b0100, 0b100>;
2316 def : RWSysReg<"SCTLRALIAS_EL1", 0b11, 0b000, 0b0001, 0b0100, 0b110>;
2317 def : RWSysReg<"SCTLR2ALIAS_EL1", 0b11, 0b000, 0b0001, 0b0100, 0b111>;
2318 def : RWSysReg<"TCRMASK_EL1", 0b11, 0b000, 0b0010, 0b0111, 0b010>;
2319 def : RWSysReg<"TCRMASK_EL2", 0b11, 0b100, 0b0010, 0b0111, 0b010>;
2320 def : RWSysReg<"TCRMASK_EL12", 0b11, 0b101, 0b0010, 0b0111, 0b010>;
2321 def : RWSysReg<"TCR2MASK_EL1", 0b11, 0b000, 0b0010, 0b0111, 0b011>;
2322 def : RWSysReg<"TCR2MASK_EL2", 0b11, 0b100, 0b0010, 0b0111, 0b011>;
2323 def : RWSysReg<"TCR2MASK_EL12", 0b11, 0b101, 0b0010, 0b0111, 0b011>;
2324 def : RWSysReg<"TCRALIAS_EL1", 0b11, 0b000, 0b0010, 0b0111, 0b110>;
2325 def : RWSysReg<"TCR2ALIAS_EL1", 0b11, 0b000, 0b0010, 0b0111, 0b111>;
2326 def : RWSysReg<"ACTLRMASK_EL1", 0b11, 0b000, 0b0001, 0b0100, 0b001>;
2327 def : RWSysReg<"ACTLRMASK_EL2", 0b11, 0b100, 0b0001, 0b0100, 0b001>;
2328 def : RWSysReg<"ACTLRMASK_EL12", 0b11, 0b101, 0b0001, 0b0100, 0b001>;
2329 def : RWSysReg<"ACTLRALIAS_EL1", 0b11, 0b000, 0b0001, 0b0100, 0b101>;
2331 //===----------------------------------------------------------------------===//
2332 // v9.6a PCDPHINT instruction options.
2333 //===----------------------------------------------------------------------===//
2335 class PHint<bits<2> op0, bits<3> op1, bits<4> crn, bits<4> crm,
2336 bits<3> op2, string name> {
2339 let Encoding{15-14} = op0;
2340 let Encoding{13-11} = op1;
2341 let Encoding{10-7} = crn;
2342 let Encoding{6-3} = crm;
2343 let Encoding{2-0} = op2;
2344 code Requires = [{ {} }];
2347 def PHintValues : GenericEnum {
2348 let FilterClass = "PHint";
2349 let NameField = "Name";
2350 let ValueField = "Encoding";
2353 def PHintsList : GenericTable {
2354 let FilterClass = "PHint";
2355 let Fields = ["Name", "Encoding", "Requires"];
2357 let PrimaryKey = ["Encoding"];
2358 let PrimaryKeyName = "lookupPHintByEncoding";
2361 def lookupPHintByName : SearchIndex {
2362 let Table = PHintsList;
2366 let Requires = [{ {AArch64::FeaturePCDPHINT} }] in {
2367 def KEEP : PHint<0b00, 0b000, 0b0000, 0b0000, 0b000, "keep">;
2368 def STRM : PHint<0b00, 0b000, 0b0000, 0b0000, 0b001, "strm">;
2371 // v9.6a Realm management extension enhancements
2372 def : RWSysReg<"GPCBW_EL3", 0b11, 0b110, 0b0010, 0b0001, 0b101>;
2374 // v9.6a Statistical Profiling Extension exception registers (FEAT_SPE_EXC)
2375 // Op0 Op1 CRn CRm Op2
2376 def : RWSysReg<"PMBMAR_EL1", 0b11, 0b000, 0b1001, 0b1010, 0b101>;
2377 def : RWSysReg<"PMBSR_EL12", 0b11, 0b101, 0b1001, 0b1010, 0b011>;
2378 def : RWSysReg<"PMBSR_EL2", 0b11, 0b100, 0b1001, 0b1010, 0b011>;
2379 def : RWSysReg<"PMBSR_EL3", 0b11, 0b110, 0b1001, 0b1010, 0b011>;
2381 // v9.6a Trace Buffer Management Events exception registers (FEAT_TRBE_EXC)
2382 // Op0 Op1 CRn CRm Op2
2383 def : RWSysReg<"TRBSR_EL12", 0b11, 0b101, 0b1001, 0b1011, 0b011>;
2384 def : RWSysReg<"TRBSR_EL2", 0b11, 0b100, 0b1001, 0b1011, 0b011>;
2385 def : RWSysReg<"TRBSR_EL3", 0b11, 0b110, 0b1001, 0b1011, 0b011>;
2389 let Requires = [{ {AArch64::FeaturePoPS} }] in {
2390 def : DC<"CIGDVAPS", 0b000, 0b0111, 0b1111, 0b101>;
2391 def : DC<"CIVAPS", 0b000, 0b0111, 0b1111, 0b001>;