diff options
author | Andrew Carlotti <andrew.carlotti@arm.com> | 2024-05-10 11:56:57 +0100 |
---|---|---|
committer | Andrew Carlotti <andrew.carlotti@arm.com> | 2024-07-24 16:54:50 +0100 |
commit | 033d9053dae3c1aafae63d22641adb49210301d8 (patch) | |
tree | 571f1c2b4c7c49e71db2df0f741444fa2801521c | |
parent | c0ed0823a6fa35dc074d3323163473a663721441 (diff) | |
download | gcc-033d9053dae3c1aafae63d22641adb49210301d8.zip gcc-033d9053dae3c1aafae63d22641adb49210301d8.tar.gz gcc-033d9053dae3c1aafae63d22641adb49210301d8.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.cc | 11 | ||||
-rw-r--r-- | gcc/config/aarch64/aarch64.h | 11 | ||||
-rw-r--r-- | gcc/config/aarch64/aarch64.opt | 4 |
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 |