From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1130) id 16E1B3858C39; Thu, 29 Sep 2022 10:35:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 16E1B3858C39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664447704; bh=4HXjQ/ZahkyKOA/2kZDwH/3ImRbyflzQ4xWu4b/A7cE=; h=From:To:Subject:Date:From; b=RjWJ4a37cJUZ9MArGWgCprkOIRrWvc6iyBwUmP7+/ZJ7Yg3SnViQXqPxIOg7PPSxb rxbGCBAzLWwbBFYIhygldbXfNVIR9U0V1kHa2gUA9vhn9E+lvcN+Tw0/7fQ4n05gQj J1Ns5fAmx0Lh+FsPnHQxxSGkHW36C8UxKz8zdtPs= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Richard Sandiford To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-2948] aarch64: Tweak contents of flags_on/off fields X-Act-Checkin: gcc X-Git-Author: Richard Sandiford X-Git-Refname: refs/heads/trunk X-Git-Oldrev: fed55a60e5b230bc159617f26e33611073c672fd X-Git-Newrev: bb7f43b62a58a0f0326fd3060f0bd43e6f3ef971 Message-Id: <20220929103504.16E1B3858C39@sourceware.org> Date: Thu, 29 Sep 2022 10:35:04 +0000 (GMT) List-Id: https://gcc.gnu.org/g:bb7f43b62a58a0f0326fd3060f0bd43e6f3ef971 commit r13-2948-gbb7f43b62a58a0f0326fd3060f0bd43e6f3ef971 Author: Richard Sandiford Date: Thu Sep 29 11:32:56 2022 +0100 aarch64: Tweak contents of flags_on/off fields After previous changes, it's more convenient if the flags_on and flags_off fields of all_extensions include the feature flag itself. gcc/ * common/config/aarch64/aarch64-common.cc (all_extensions): Include the feature flag in flags_on and flags_off. (aarch64_parse_extension): Update accordingly. (aarch64_get_extension_string_for_isa_flags): Likewise. Diff: --- gcc/common/config/aarch64/aarch64-common.cc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/gcc/common/config/aarch64/aarch64-common.cc b/gcc/common/config/aarch64/aarch64-common.cc index bebcfd4c9d3..ffa83bb478f 100644 --- a/gcc/common/config/aarch64/aarch64-common.cc +++ b/gcc/common/config/aarch64/aarch64-common.cc @@ -137,10 +137,8 @@ struct aarch64_option_extension static constexpr aarch64_option_extension all_extensions[] = { #define AARCH64_OPT_EXTENSION(NAME, IDENT, C, D, E, F) \ - {NAME, AARCH64_FL_##IDENT, \ - feature_deps::IDENT ().explicit_on & ~AARCH64_FL_##IDENT, \ - feature_deps::get_flags_off (feature_deps::root_off_##IDENT) \ - & ~AARCH64_FL_##IDENT}, + {NAME, AARCH64_FL_##IDENT, feature_deps::IDENT ().explicit_on, \ + feature_deps::get_flags_off (feature_deps::root_off_##IDENT)}, #include "config/aarch64/aarch64-option-extensions.def" {NULL, 0, 0, 0} }; @@ -228,9 +226,9 @@ aarch64_parse_extension (const char *str, aarch64_feature_flags *isa_flags, { /* Add or remove the extension. */ if (adding_ext) - *isa_flags |= (opt->flags_on | opt->flag_canonical); + *isa_flags |= opt->flags_on; else - *isa_flags &= ~(opt->flags_off | opt->flag_canonical); + *isa_flags &= ~opt->flags_off; break; } } @@ -304,7 +302,7 @@ aarch64_get_extension_string_for_isa_flags if ((flags & isa_flags & (explicit_flags | ~current_flags)) == flags) { - current_flags |= opt.flag_canonical | opt.flags_on; + current_flags |= opt.flags_on; added |= opt.flag_canonical; } } @@ -319,7 +317,7 @@ aarch64_get_extension_string_for_isa_flags for (auto &opt : all_extensions) if (opt.flag_canonical & current_flags & ~isa_flags) { - current_flags &= ~(opt.flag_canonical | opt.flags_off); + current_flags &= ~opt.flags_off; outstr += "+no"; outstr += opt.name; }