diff options
author | Andrew Carlotti <andrew.carlotti@arm.com> | 2023-11-24 17:31:51 +0000 |
---|---|---|
committer | Andrew Carlotti <andrew.carlotti@arm.com> | 2023-12-16 00:38:41 +0000 |
commit | 06f64b95bafc06c318efc7b6d7c03cd34fe4be78 (patch) | |
tree | 0aea62739e911cd6a6f91bc1ee494599bc8e6a8b /gcc/common/config/aarch64 | |
parent | 8d30107455f2309854ced3d65fb07dc1f2c357c0 (diff) | |
download | gcc-06f64b95bafc06c318efc7b6d7c03cd34fe4be78.zip gcc-06f64b95bafc06c318efc7b6d7c03cd34fe4be78.tar.gz gcc-06f64b95bafc06c318efc7b6d7c03cd34fe4be78.tar.bz2 |
aarch64: Fix +nopredres, +nols64 and +nomops
For native cpu feature detection, certain features have no entry in
/proc/cpuinfo, so have to be assumed to be present whenever the detected
cpu is supposed to support that feature.
However, the logic for this was mistakenly implemented by excluding
these features from part of aarch64_get_extension_string_for_isa_flags.
This function is also used elsewhere when canonicalising explicit
feature sets, which may require removing features that are normally
implied by the specified architecture version.
This change reenables generation of +nopredres, +nols64 and +nomops
during canonicalisation, by relocating the misplaced native cpu
detection logic.
gcc/ChangeLog:
* common/config/aarch64/aarch64-common.cc
(struct aarch64_option_extension): Remove unused field.
(all_extensions): Ditto.
(aarch64_get_extension_string_for_isa_flags): Remove filtering
of features without native detection.
* config/aarch64/driver-aarch64.cc (host_detect_local_cpu):
Explicitly add expected features that lack cpuinfo detection.
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/options_set_28.c: New test.
Diffstat (limited to 'gcc/common/config/aarch64')
-rw-r--r-- | gcc/common/config/aarch64/aarch64-common.cc | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/gcc/common/config/aarch64/aarch64-common.cc b/gcc/common/config/aarch64/aarch64-common.cc index c2a6d35..4d0431d 100644 --- a/gcc/common/config/aarch64/aarch64-common.cc +++ b/gcc/common/config/aarch64/aarch64-common.cc @@ -149,9 +149,6 @@ struct aarch64_option_extension aarch64_feature_flags flags_on; /* If this feature is turned off, these bits also need to be turned off. */ aarch64_feature_flags flags_off; - /* Indicates whether this feature is taken into account during native cpu - detection. */ - bool native_detect_p; }; /* ISA extensions in AArch64. */ @@ -159,10 +156,9 @@ static constexpr aarch64_option_extension all_extensions[] = { #define AARCH64_OPT_EXTENSION(NAME, IDENT, C, D, E, FEATURE_STRING) \ {NAME, AARCH64_FL_##IDENT, feature_deps::IDENT ().explicit_on, \ - feature_deps::get_flags_off (feature_deps::root_off_##IDENT), \ - FEATURE_STRING[0]}, + feature_deps::get_flags_off (feature_deps::root_off_##IDENT)}, #include "config/aarch64/aarch64-option-extensions.def" - {NULL, 0, 0, 0, false} + {NULL, 0, 0, 0} }; struct processor_name_to_arch @@ -358,8 +354,7 @@ aarch64_get_extension_string_for_isa_flags /* If either crypto flag needs removing here, then both do. */ flags = flags_crypto; - if (opt.native_detect_p - && (flags & current_flags & ~isa_flags)) + if (flags & current_flags & ~isa_flags) { current_flags &= ~opt.flags_off; outstr += "+no"; |