aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Carlotti <andrew.carlotti@arm.com>2024-05-10 11:56:57 +0100
committerThomas Koenig <tkoenig@gcc.gnu.org>2024-07-28 19:05:52 +0200
commitaa17619bfd61035c3cccb3ca40c72f2363a64600 (patch)
tree751bc6bf7c112d0d35a040260e2ef414e96775f2
parent7086cefb05fdaf3dc7fb12f009a18b5189c8cc17 (diff)
downloadgcc-aa17619bfd61035c3cccb3ca40c72f2363a64600.zip
gcc-aa17619bfd61035c3cccb3ca40c72f2363a64600.tar.gz
gcc-aa17619bfd61035c3cccb3ca40c72f2363a64600.tar.bz2
aarch64: Decouple feature flag option storage type
The awk scripts that process the .opt files are relatively fragile and only handle a limited set of data types correctly. The unrecognised aarch64_feature_flags type is handled as a uint64_t, which happens to be correct for now. However, that assumption will change when we extend the mask to 128 bits. This patch changes the option members to use uint64_t types, and adds a "_0" suffix to the names (both for future extensibility, and to allow the original name to be used for the full aarch64_feature_flags mask within generator files). gcc/ChangeLog: * common/config/aarch64/aarch64-common.cc (aarch64_set_asm_isa_flags): Reorder, and add suffix to names. * config/aarch64/aarch64.h (aarch64_get_asm_isa_flags): Add "_0" suffix. (aarch64_get_isa_flags): Ditto. (aarch64_asm_isa_flags): Redefine using renamed uint64_t value. (aarch64_isa_flags): Ditto. * config/aarch64/aarch64.opt: (aarch64_asm_isa_flags): Rename to... (aarch64_asm_isa_flags_0): ...this, and change to uint64_t. (aarch64_isa_flags): Rename to... (aarch64_isa_flags_0): ...this, and change to uint64_t.
-rw-r--r--gcc/common/config/aarch64/aarch64-common.cc11
-rw-r--r--gcc/config/aarch64/aarch64.h11
-rw-r--r--gcc/config/aarch64/aarch64.opt4
3 files changed, 16 insertions, 10 deletions
diff --git a/gcc/common/config/aarch64/aarch64-common.cc b/gcc/common/config/aarch64/aarch64-common.cc
index 63c5018..bd0770d 100644
--- a/gcc/common/config/aarch64/aarch64-common.cc
+++ b/gcc/common/config/aarch64/aarch64-common.cc
@@ -66,15 +66,16 @@ static const struct default_options aarch_option_optimization_table[] =
{ OPT_LEVELS_NONE, 0, NULL, 0 }
};
-/* Set OPTS->x_aarch64_asm_isa_flags to FLAGS and update
- OPTS->x_aarch64_isa_flags accordingly. */
+
+/* Set OPTS->x_aarch64_asm_isa_flags_0 to FLAGS and update
+ OPTS->x_aarch64_isa_flags_0 accordingly. */
void
aarch64_set_asm_isa_flags (gcc_options *opts, aarch64_feature_flags flags)
{
- opts->x_aarch64_asm_isa_flags = flags;
- opts->x_aarch64_isa_flags = flags;
+ opts->x_aarch64_asm_isa_flags_0 = flags;
if (opts->x_target_flags & MASK_GENERAL_REGS_ONLY)
- opts->x_aarch64_isa_flags &= ~feature_deps::get_flags_off (AARCH64_FL_FP);
+ flags &= ~feature_deps::get_flags_off (AARCH64_FL_FP);
+ opts->x_aarch64_isa_flags_0 = flags;
}
/* Implement TARGET_HANDLE_OPTION.
diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h
index 193f248..903e708 100644
--- a/gcc/config/aarch64/aarch64.h
+++ b/gcc/config/aarch64/aarch64.h
@@ -23,13 +23,18 @@
#define GCC_AARCH64_H
#define aarch64_get_asm_isa_flags(opts) \
- (aarch64_feature_flags ((opts)->x_aarch64_asm_isa_flags))
+ (aarch64_feature_flags ((opts)->x_aarch64_asm_isa_flags_0))
#define aarch64_get_isa_flags(opts) \
- (aarch64_feature_flags ((opts)->x_aarch64_isa_flags))
+ (aarch64_feature_flags ((opts)->x_aarch64_isa_flags_0))
/* Make these flags read-only so that all uses go via
aarch64_set_asm_isa_flags. */
-#ifndef GENERATOR_FILE
+#ifdef GENERATOR_FILE
+#undef aarch64_asm_isa_flags
+#define aarch64_asm_isa_flags (aarch64_feature_flags (aarch64_asm_isa_flags_0))
+#undef aarch64_isa_flags
+#define aarch64_isa_flags (aarch64_feature_flags (aarch64_isa_flags_0))
+#else
#undef aarch64_asm_isa_flags
#define aarch64_asm_isa_flags (aarch64_get_asm_isa_flags (&global_options))
#undef aarch64_isa_flags
diff --git a/gcc/config/aarch64/aarch64.opt b/gcc/config/aarch64/aarch64.opt
index 6356c41..45aab49 100644
--- a/gcc/config/aarch64/aarch64.opt
+++ b/gcc/config/aarch64/aarch64.opt
@@ -31,10 +31,10 @@ TargetVariable
enum aarch64_arch selected_arch = aarch64_no_arch
TargetVariable
-aarch64_feature_flags aarch64_asm_isa_flags = 0
+uint64_t aarch64_asm_isa_flags_0 = 0
TargetVariable
-aarch64_feature_flags aarch64_isa_flags = 0
+uint64_t aarch64_isa_flags_0 = 0
TargetVariable
unsigned aarch_enable_bti = 2