#include "aarch64-cores.def"
{NULL, aarch64_none, aarch64_none, aarch64_no_arch, 0, NULL}
};
+/* Internal representation of system registers. */
+typedef struct {
+ const char *name;
+ /* Stringified sysreg encoding values, represented as
+ s<sn>_<op1>_c<cn>_c<cm>_<op2>. */
+ const char *encoding;
+ /* Flags affecting sysreg usage, such as read/write-only. */
+ unsigned properties;
+ /* Architectural features implied by sysreg. */
+ aarch64_feature_flags arch_reqs;
+} sysreg_t;
+
+/* An aarch64_feature_set initializer for a single feature,
+ AARCH64_FEATURE_<FEAT>. */
+#define AARCH64_FEATURE(FEAT) AARCH64_FL_##FEAT
+
+/* Used by AARCH64_FEATURES. */
+#define AARCH64_OR_FEATURES_1(X, F1) \
+ AARCH64_FEATURE (F1)
+#define AARCH64_OR_FEATURES_2(X, F1, F2) \
+ (AARCH64_FEATURE (F1) | AARCH64_OR_FEATURES_1 (X, F2))
+#define AARCH64_OR_FEATURES_3(X, F1, ...) \
+ (AARCH64_FEATURE (F1) | AARCH64_OR_FEATURES_2 (X, __VA_ARGS__))
+
+/* An aarch64_feature_set initializer for the N features listed in "...". */
+#define AARCH64_FEATURES(N, ...) \
+ AARCH64_OR_FEATURES_##N (0, __VA_ARGS__)
+
+#define AARCH64_NO_FEATURES 0
+
+/* Flags associated with the properties of system registers. It mainly serves
+ to mark particular registers as read or write only. */
+#define F_DEPRECATED (1 << 1)
+#define F_REG_READ (1 << 2)
+#define F_REG_WRITE (1 << 3)
+#define F_ARCHEXT (1 << 4)
+/* Flag indicating register name is alias for another system register. */
+#define F_REG_ALIAS (1 << 5)
+
+/* Database of system registers, their encodings and architectural
+ requirements. */
+const sysreg_t aarch64_sysregs[] =
+{
+#define CPENC(SN, OP1, CN, CM, OP2) "s"#SN"_"#OP1"_c"#CN"_c"#CM"_"#OP2
+#define SYSREG(NAME, ENC, FLAGS, ARCH) \
+ { NAME, ENC, FLAGS, ARCH },
+#include "aarch64-sys-regs.def"
+#undef CPENC
+};
+
+#undef AARCH64_NO_FEATURES
/* The current tuning set. */
struct tune_params aarch64_tune_params = generic_tunings;
#define AARCH64_ISA_SM_ON (aarch64_isa_flags & AARCH64_FL_SM_ON)
#define AARCH64_ISA_ZA_ON (aarch64_isa_flags & AARCH64_FL_ZA_ON)
#define AARCH64_ISA_MODE (aarch64_isa_flags & AARCH64_FL_ISA_MODES)
+#define AARCH64_ISA_V8A (aarch64_isa_flags & AARCH64_FL_V8A)
+#define AARCH64_ISA_V8_1A (aarch64_isa_flags & AARCH64_FL_V8_1A)
#define AARCH64_ISA_CRC (aarch64_isa_flags & AARCH64_FL_CRC)
#define AARCH64_ISA_CRYPTO (aarch64_isa_flags & AARCH64_FL_CRYPTO)
#define AARCH64_ISA_FP (aarch64_isa_flags & AARCH64_FL_FP)
#define AARCH64_ISA_SB (aarch64_isa_flags & AARCH64_FL_SB)
#define AARCH64_ISA_V8R (aarch64_isa_flags & AARCH64_FL_V8R)
#define AARCH64_ISA_PAUTH (aarch64_isa_flags & AARCH64_FL_PAUTH)
+#define AARCH64_ISA_V8_7A (aarch64_isa_flags & AARCH64_FL_V8_7A)
+#define AARCH64_ISA_V8_8A (aarch64_isa_flags & AARCH64_FL_V8_8A)
#define AARCH64_ISA_V9A (aarch64_isa_flags & AARCH64_FL_V9A)
#define AARCH64_ISA_V9_1A (aarch64_isa_flags & AARCH64_FL_V9_1A)
#define AARCH64_ISA_V9_2A (aarch64_isa_flags & AARCH64_FL_V9_2A)
/* PSTATE.ZA is enabled in the current function body. */
#define TARGET_ZA (AARCH64_ISA_ZA_ON)
+/* AARCH64_FL options necessary for system register implementation. */
+
+/* Define AARCH64_FL aliases for architectural features which are protected
+ by -march flags in binutils but which receive no special treatment by GCC.
+
+ Such flags are inherited from the Binutils definition of system registers
+ and are mapped to the architecture in which the feature is implemented. */
+#define AARCH64_FL_RAS AARCH64_FL_V8A
+#define AARCH64_FL_LOR AARCH64_FL_V8_1A
+#define AARCH64_FL_PAN AARCH64_FL_V8_1A
+#define AARCH64_FL_AMU AARCH64_FL_V8_4A
+#define AARCH64_FL_SCXTNUM AARCH64_FL_V8_5A
+#define AARCH64_FL_ID_PFR2 AARCH64_FL_V8_5A
/* Crypto is an optional extension to AdvSIMD. */
#define TARGET_CRYPTO (AARCH64_ISA_CRYPTO)