From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80073.outbound.protection.outlook.com [40.107.8.73]) by sourceware.org (Postfix) with ESMTPS id 2C0FD3858413 for ; Wed, 25 May 2022 16:18:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2C0FD3858413 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=K1ox4F+2hKwXDfg6CODSXIaQTgIk6/tR68zPfCvMoj/K4jdnyW49nuIJSoXjcOTl0szpMWlNJ04cyr1rUPFCSV5x8g00HN1eIVZAnEA7IMg8hXWAp3oOXGYMo9lpYdhHF6hboha4GSLa9TnP5+x+x+6C6X45/5Tn71hJed7clqN7PqWoIADvMHSRdjcsJSm+Og1HV1DffIfCEgoNX1o/D4I+Bs8Mv4CH/PvE5XoBTEAPCQpVfsIRHEwPg0HxgNYPkrvFC3U++G3nL9ZZwuJWAvtlwFFpgEWJ5f34Ncu+U4iPf5nHs4EW6IQnHgcNrqSeb0MvT7xpTPZy4DuoxVKGeA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=l5WfVeiQ2cFbkEA8c7YMbziT4yoLDtqHhr1XxrP2E90=; b=OQPPovRFV+TUDzvfqSAj4gCiGYpm//gPHTWW8wgfQYttxZzYQChfEKqJTq3U+EA2dJHY3Q8KlZILDqNT3ejOaCTG46BbrbPRAyeUBs8OV/cfsHl6J4WBk/greeaDbKBvVqxHRYbdjB6njpj5fTWOYjc5bKdxqMpgufrnJYyOwjn2c21cwU4u0DoTd/nU8O7Fqrvwv4e9wwsM0KYPAT+t13wSliSh91djzkvH/+9mo7/2EWwhkQI9k5FIF1Qdr8QxhBcY9yJEBjhngCbJp2uuXehfjLhWmblJqLRU6zKXKATem2/22fKZjeF9YJhlglVUwRMjLGtLf+z3KJyUMIipKw== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) Received: from AM6P192CA0070.EURP192.PROD.OUTLOOK.COM (2603:10a6:209:82::47) by PAXPR08MB7599.eurprd08.prod.outlook.com (2603:10a6:102:23e::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.22; Wed, 25 May 2022 16:18:55 +0000 Received: from AM5EUR03FT040.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:82:cafe::90) by AM6P192CA0070.outlook.office365.com (2603:10a6:209:82::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.13 via Frontend Transport; Wed, 25 May 2022 16:18:55 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT040.mail.protection.outlook.com (10.152.17.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.13 via Frontend Transport; Wed, 25 May 2022 16:18:55 +0000 Received: ("Tessian outbound 32b886dfa5b9:v119"); Wed, 25 May 2022 16:18:55 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: d37ad5d6844f7d20 X-CR-MTA-TID: 64aa7808 Received: from bf224bce56ea.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id A93EC08E-80D4-49DA-8699-2A5504A044DB.1; Wed, 25 May 2022 16:18:48 +0000 Received: from EUR02-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id bf224bce56ea.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 25 May 2022 16:18:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y4DNnLa2BMsuJxqvq8jOJrA443siY2tdSROkfwoRemsdjosQV0xFjZLT/qg9SHoPGetVZdJA3VJ4/NbhKJAQeLNLjH08m0P6zSOdZLX/BMxr9b6dwAyXZB4qdYJ4TvaAp/5ISNEPvlt0g868kfQlj83bPvlZJfgzvx3NpzhJFrm1QRlKtsnUsrzYxXxhMhsUuPQU+SMj/p30+gfdNhparWsoOs/xEzYSU26BPYc6J2XUvF9FETXx8kRRdKtStS80i5M3SS++oQEoPInfZslYN+YNdc7N/qdB4m1oUt9mC8G8VdKKr3Fl9YPhTdzZC4oDQ/W9baDmizVdfFW9PSbxVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=l5WfVeiQ2cFbkEA8c7YMbziT4yoLDtqHhr1XxrP2E90=; b=oCsNlMzyxSA2+FR8WxB0z0biDqczNR0C0g9wwKILnHAZFKVW90q6ym+7PVIexFNztcUiGs+OxrrkytecDbJ/rD2lh98ak+b4SXpe0Lj3rAXB23B0GSRtoxVo/NzHavAhfdV3FayLNHsfmSFltFBL4Zo6CHNHS8TsaNpYFAk0pEFBopchGy6TpTsgVl1dAUScsUUIFWfzVdY4zTbUWBaT7iUXt7ai4jHoGCe3nfwipyTt54/Uvs9TBNPtdr0AEHQ3PXCd2tXl3/U7Ez4/xyIxkjxSpis8m8mEJX4NDZiJoc+4INzJt5aUhJuazrtkt+6q/NWLBF+lo++oY6U7BmtwZg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none Received: from DB6PR0801MB1879.eurprd08.prod.outlook.com (2603:10a6:4:73::9) by HE1PR0801MB1770.eurprd08.prod.outlook.com (2603:10a6:3:7d::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.16; Wed, 25 May 2022 16:18:45 +0000 Received: from DB6PR0801MB1879.eurprd08.prod.outlook.com ([fe80::4c79:5ff3:ff33:7ee1]) by DB6PR0801MB1879.eurprd08.prod.outlook.com ([fe80::4c79:5ff3:ff33:7ee1%11]) with mapi id 15.20.5273.023; Wed, 25 May 2022 16:18:40 +0000 From: Wilco Dijkstra To: Richard Sandiford , Kyrylo Tkachov CC: GCC Patches Subject: [PATCH] AArch64: Cleanup option processing code Thread-Topic: [PATCH] AArch64: Cleanup option processing code Thread-Index: AQHYcFKkd6zyqAVHSkqyngC6q1kh7w== Date: Wed, 25 May 2022 16:18:40 +0000 Message-ID: Accept-Language: en-GB, en-US Content-Language: en-GB X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-MS-Office365-Filtering-Correlation-Id: 8a1715fd-44dc-4297-a424-08da3e6a43ee x-ms-traffictypediagnostic: HE1PR0801MB1770:EE_|AM5EUR03FT040:EE_|PAXPR08MB7599:EE_ X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: UeZJYz6LTafdS3jxK2K3TtcGT0mJzDoW5qAoGyMjsp5id6fzWVBxXMzFppNSpNR0Pr0O/GU1vxlyTnh0MLbjKIr+hK6Llb5zLV1e0zNmiFBADp59bRV+ohg74Zn7eDfaLiLmNJeZA+AMzgwhSSxZFt/a8CTxuvzT2tbpqH5Jh2tWSHpHljRXnBt8KSmbjXdXCIHf/nDium9iGgsWf/Fa1VCnVyQ8qWYueMAve1jCWsf7Ni9nL1YSoJbsbzhMu2+kKir0a6GyoDompOoaaWaX2VwwgdQPBfA1ZT2GZyPKBFbMxhA/448oQoAiepTPP672sqZ5EQ4UNI/Bw8VevnrgYZL4keWP8OEHQpfZ41bek4UKMMK4h1mxZxQzzSP6DaEzOVuI2CUbMHi5vJdGUUX9TmmWJGDcY1D6Gl2Zkj2CxktXrvmUxFOpaSDErrFQFXZu12/PFXXiosJUSWVsHmYDtIn0DfR5jCROmpOmFPYBdZ88WhpbACLFAP0bGB32ks7krQihAeioPY/AYOrmkBziE8xwK0R+ZonRkspcTf39cZ++juT2KwSMoEeT+Lf77zrgYc/WuaHHj9iS72k9kXWPOxAyg8gvI/oULgDdW2O+B2nanLrSG1YfjZZKK+bK0zgNx02o3zC2eLjHWffMlxOBHjGBrABO7IQuUc7dC+U+80UsRjhhV5Ozt0cOR4qrXll8tChtQxTYEqcNb3OfF1xhMQ== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0801MB1879.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(33656002)(316002)(7696005)(55016003)(508600001)(26005)(38100700002)(30864003)(8936002)(38070700005)(5660300002)(2906002)(186003)(52536014)(83380400001)(110136005)(6636002)(9686003)(86362001)(66556008)(66476007)(64756008)(76116006)(66446008)(4326008)(66946007)(91956017)(8676002)(122000001)(71200400001)(6506007); DIR:OUT; SFP:1101; Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0801MB1770 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT040.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 7a0cdfce-6831-43a8-64fb-08da3e6a3af6 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Pme58XTuuSJydLb18i9oh0xtKkjQ7IxLUvlTAo1OSCrkHII8ZcinmTaanQup/jgxJNGG4VJxIiNCishfxmEay2ukfW94oMgfOP3L810bez22I+w7t4O/Z3AHyjdDusUjC6bPQZCiTNSt7ISGa7r0snjdwQAzHFNfzStI4MgqMYTE1vRaen52m/wdW/MQb13sy4XwzoZkg9dpwJT8Fg3hPnJfTeisNrSmftDg2wyHdGb+b52KDhYTIomoJuGjL+bPWwj/l0J5lsaSXA/4EBtH2Yhs7dl+nB2B+z/5RMuvj03dRl27rqkDcns9auropwm9PA67dNxdNhDm90Wga06EegosazcSnmRwrh+Ba8/lwy5VH6YJABL9nKGbLONcpG/fqBfzCWj5ek9GQGuIkSnUxIYby3dFcqLy2f6ZkB+jjkil1FWidiHUkx4bJLDQmZWqNgP41mRcINlZlEp/NXSI3j2OsllBbVCrhvEdjv7iJPFC8VVTetcvSdqDYEevI7EhvPoUKErhcZBlDL5wq5PVgxOYOvM66v+j6WHENtkREm7xVzlUxm/cGHCli61zW5uQjxGhZyzr048EHOPs8d8j6pkYY58ib6f493wmzdnpKDcKRB2eYi3A7IJzccddzaU86yCUxlfhw/ilX9Sn+wcA3zunA1fXn9V0fSP/JDTgeeWun+Xk6jqvrI99LZne+2uV X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230001)(4636009)(36840700001)(40470700004)(46966006)(83380400001)(8936002)(52536014)(316002)(70206006)(8676002)(356005)(86362001)(33656002)(4326008)(36860700001)(55016003)(2906002)(70586007)(40460700003)(508600001)(26005)(9686003)(6636002)(186003)(82310400005)(47076005)(110136005)(7696005)(336012)(30864003)(81166007)(5660300002)(6506007); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 May 2022 16:18:55.2733 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8a1715fd-44dc-4297-a424-08da3e6a43ee X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM5EUR03FT040.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB7599 X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, KAM_LOTSOFHASH, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2022 16:19:01 -0000 =0A= Further cleanup option processing. Remove the duplication of global=0A= variables for CPU and tune settings so that CPU option processing is=0A= simplified even further. Move global variables that need save and =0A= restore due to target option processing into aarch64.opt. This removes=0A= the need for explicit saving/restoring and unnecessary reparsing of=0A= options.=0A= =0A= Bootstrap OK, regress pass, OK for commit?=0A= =0A= gcc/=0A= * config/aarch64/aarch64.opt (explicit_tune_core): Rename to=0A= selected_tune.=0A= (explicit_arch): Rename to selected_arch.=0A= (x_aarch64_override_tune_string): Remove.=0A= (aarch64_ra_sign_key): Add as TargetVariable so it gets saved/resto= red.=0A= (aarch64_override_tune_string): Add Save so it gets saved/restored.= =0A= * config/aarch64/aarch64.h (aarch64_architecture_version): Remove.= =0A= * config/aarch64/aarch64.cc (aarch64_architecture_version): Remove.= =0A= (processor): Remove archtecture_version field.=0A= (selected_arch): Remove global.=0A= (selected_cpu): Remove global.=0A= (selected_tune): Remove global.=0A= (aarch64_ra_sign_key): Move global to aarch64.opt so it is saved.= =0A= (aarch64_override_options_internal): Use aarch64_get_tune_cpu.=0A= (aarch64_override_options): Further simplify code to only set=0A= selected_arch and selected_tune globals.=0A= (aarch64_option_save): Remove now that target options are saved.=0A= (aarch64_option_restore): Remove redundant target option restores.= =0A= * config/aarch64/aarch64-c.cc (aarch64_update_cpp_builtins): Use=0A= AARCH64_ISA_V9.=0A= * config/aarch64/aarch64-opts.h (aarch64_key_type): Add, moved from= ...=0A= * config/aarch64/aarch64-protos.h (aarch64_key_type): Remove.=0A= (aarch64_ra_sign_key): Remove.=0A= =0A= ---=0A= =0A= diff --git a/gcc/config/aarch64/aarch64-c.cc b/gcc/config/aarch64/aarch64-c= .cc=0A= index 767ee0c763c56a022089a647c7425afb00644644..3d2fb5ec2ef33e66aaa59d216c5= 3a29737262794 100644=0A= --- a/gcc/config/aarch64/aarch64-c.cc=0A= +++ b/gcc/config/aarch64/aarch64-c.cc=0A= @@ -82,7 +82,7 @@ aarch64_update_cpp_builtins (cpp_reader *pfile)=0A= {=0A= aarch64_def_or_undef (flag_unsafe_math_optimizations, "__ARM_FP_FAST", p= file);=0A= =0A= - builtin_define_with_int_value ("__ARM_ARCH", aarch64_architecture_versio= n);=0A= + builtin_define_with_int_value ("__ARM_ARCH", AARCH64_ISA_V9 ? 9 : 8);=0A= =0A= builtin_define_with_int_value ("__ARM_SIZEOF_MINIMAL_ENUM",=0A= flag_short_enums ? 1 : 4);=0A= diff --git a/gcc/config/aarch64/aarch64-opts.h b/gcc/config/aarch64/aarch64= -opts.h=0A= index 93572fe8330218568435f485a366101eb2c58da9..421648a156a02cc1f43660eddc5= de38c2f366a72 100644=0A= --- a/gcc/config/aarch64/aarch64-opts.h=0A= +++ b/gcc/config/aarch64/aarch64-opts.h=0A= @@ -98,4 +98,10 @@ enum stack_protector_guard {=0A= SSP_GLOBAL /* global canary */=0A= };=0A= =0A= +/* The key type that -msign-return-address should use. */=0A= +enum aarch64_key_type {=0A= + AARCH64_KEY_A,=0A= + AARCH64_KEY_B=0A= +};=0A= +=0A= #endif=0A= diff --git a/gcc/config/aarch64/aarch64-protos.h b/gcc/config/aarch64/aarch= 64-protos.h=0A= index df311812e8d4b87c0ad8692adacedcd79a8e0f64..dabd047d7ba2c532238720d59ec= d59f0f5ba822f 100644=0A= --- a/gcc/config/aarch64/aarch64-protos.h=0A= +++ b/gcc/config/aarch64/aarch64-protos.h=0A= @@ -672,14 +672,6 @@ enum simd_immediate_check {=0A= AARCH64_CHECK_MOV =3D AARCH64_CHECK_ORR | AARCH64_CHECK_BIC=0A= };=0A= =0A= -/* The key type that -msign-return-address should use. */=0A= -enum aarch64_key_type {=0A= - AARCH64_KEY_A,=0A= - AARCH64_KEY_B=0A= -};=0A= -=0A= -extern enum aarch64_key_type aarch64_ra_sign_key;=0A= -=0A= extern struct tune_params aarch64_tune_params;=0A= =0A= /* The available SVE predicate patterns, known in the ACLE as "svpattern".= */=0A= diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h=0A= index f835da33b72f36bbf25a0e1328135411bd8ab4f6..80cfe4b740798072ed2a3d08089= ff889943f916a 100644=0A= --- a/gcc/config/aarch64/aarch64.h=0A= +++ b/gcc/config/aarch64/aarch64.h=0A= @@ -148,9 +148,6 @@=0A= =0A= #define PCC_BITFIELD_TYPE_MATTERS 1=0A= =0A= -/* Major revision number of the ARM Architecture implemented by the target= . */=0A= -extern unsigned aarch64_architecture_version;=0A= -=0A= /* Instruction tuning/selection flags. */=0A= =0A= /* Bit values used to identify processor capabilities. */=0A= diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc= =0A= index 060c67a93b95b717563ed063509e3e31c978d891..6bdfd55bcd6308c71fb6cfccb59= 22b71830c7c4f 100644=0A= --- a/gcc/config/aarch64/aarch64.cc=0A= +++ b/gcc/config/aarch64/aarch64.cc=0A= @@ -306,9 +306,6 @@ static bool aarch64_print_address_internal (FILE*, mach= ine_mode, rtx,=0A= aarch64_addr_query_type);=0A= static HOST_WIDE_INT aarch64_clamp_to_uimm12_shift (HOST_WIDE_INT val);=0A= =0A= -/* Major revision number of the ARM Architecture implemented by the target= . */=0A= -unsigned aarch64_architecture_version;=0A= -=0A= /* The processor for which instructions should be scheduled. */=0A= enum aarch64_processor aarch64_tune =3D cortexa53;=0A= =0A= @@ -2677,7 +2674,6 @@ struct processor=0A= enum aarch64_processor ident;=0A= enum aarch64_processor sched_core;=0A= enum aarch64_arch arch;=0A= - unsigned architecture_version;=0A= const uint64_t flags;=0A= const struct tune_params *const tune;=0A= };=0A= @@ -2686,9 +2682,9 @@ struct processor=0A= static const struct processor all_architectures[] =3D=0A= {=0A= #define AARCH64_ARCH(NAME, CORE, ARCH_IDENT, ARCH_REV, FLAGS) \=0A= - {NAME, CORE, CORE, AARCH64_ARCH_##ARCH_IDENT, ARCH_REV, FLAGS, NULL},=0A= + {NAME, CORE, CORE, AARCH64_ARCH_##ARCH_IDENT, FLAGS, NULL},=0A= #include "aarch64-arches.def"=0A= - {NULL, aarch64_none, aarch64_none, aarch64_no_arch, 0, 0, NULL}=0A= + {NULL, aarch64_none, aarch64_none, aarch64_no_arch, 0, NULL}=0A= };=0A= =0A= /* Processor cores implementing AArch64. */=0A= @@ -2696,23 +2692,13 @@ static const struct processor all_cores[] =3D=0A= {=0A= #define AARCH64_CORE(NAME, IDENT, SCHED, ARCH, FLAGS, COSTS, IMP, PART, VA= RIANT) \=0A= {NAME, IDENT, SCHED, AARCH64_ARCH_##ARCH, \=0A= - all_architectures[AARCH64_ARCH_##ARCH].architecture_version, \=0A= FLAGS, &COSTS##_tunings},=0A= #include "aarch64-cores.def"=0A= - {"generic", generic, cortexa53, AARCH64_ARCH_8A, 8,=0A= + {"generic", generic, cortexa53, AARCH64_ARCH_8A,=0A= AARCH64_FL_FOR_ARCH8, &generic_tunings},=0A= - {NULL, aarch64_none, aarch64_none, aarch64_no_arch, 0, 0, NULL}=0A= + {NULL, aarch64_none, aarch64_none, aarch64_no_arch, 0, NULL}=0A= };=0A= =0A= -=0A= -/* Target specification. These are populated by the -march, -mtune, -mcpu= =0A= - handling code or by target attributes. */=0A= -static const struct processor *selected_arch;=0A= -static const struct processor *selected_cpu;=0A= -static const struct processor *selected_tune;=0A= -=0A= -enum aarch64_key_type aarch64_ra_sign_key =3D AARCH64_KEY_A;=0A= -=0A= /* The current tuning set. */=0A= struct tune_params aarch64_tune_params =3D generic_tunings;=0A= =0A= @@ -10353,8 +10339,8 @@ aarch64_case_values_threshold (void)=0A= /* Use the specified limit for the number of cases before using jump=0A= tables at higher optimization levels. */=0A= if (optimize > 2=0A= - && selected_cpu->tune->max_case_values !=3D 0)=0A= - return selected_cpu->tune->max_case_values;=0A= + && aarch64_tune_params.max_case_values !=3D 0)=0A= + return aarch64_tune_params.max_case_values;=0A= else=0A= return optimize_size ? 8 : 11;=0A= }=0A= @@ -17415,6 +17401,26 @@ initialize_aarch64_tls_size (struct gcc_options *o= pts)=0A= return;=0A= }=0A= =0A= +/* Return the CPU corresponding to the enum CPU. */=0A= +=0A= +static const struct processor *=0A= +aarch64_get_tune_cpu (enum aarch64_processor cpu)=0A= +{=0A= + gcc_assert (cpu !=3D aarch64_none);=0A= +=0A= + return &all_cores[cpu];=0A= +}=0A= +=0A= +/* Return the architecture corresponding to the enum ARCH. */=0A= +=0A= +static const struct processor *=0A= +aarch64_get_arch (enum aarch64_arch arch)=0A= +{=0A= + gcc_assert (arch !=3D aarch64_no_arch);=0A= +=0A= + return &all_architectures[arch];=0A= +}=0A= +=0A= /* Parse STRING looking for options in the format:=0A= string :: option:string=0A= option :: name=3Dsubstring=0A= @@ -17525,18 +17531,18 @@ aarch64_override_options_after_change_1 (struct g= cc_options *opts)=0A= void=0A= aarch64_override_options_internal (struct gcc_options *opts)=0A= {=0A= - aarch64_tune_flags =3D selected_tune->flags;=0A= - aarch64_tune =3D selected_tune->sched_core;=0A= + const struct processor *tune =3D aarch64_get_tune_cpu (opts->x_selected_= tune);=0A= + aarch64_tune_flags =3D tune->flags;=0A= + aarch64_tune =3D tune->sched_core;=0A= /* Make a copy of the tuning parameters attached to the core, which=0A= we may later overwrite. */=0A= - aarch64_tune_params =3D *(selected_tune->tune);=0A= - aarch64_architecture_version =3D selected_arch->architecture_version;=0A= - if (selected_tune->tune =3D=3D &generic_tunings)=0A= + aarch64_tune_params =3D *(tune->tune);=0A= + if (tune->tune =3D=3D &generic_tunings)=0A= aarch64_adjust_generic_arch_tuning (aarch64_tune_params);=0A= =0A= if (opts->x_aarch64_override_tune_string)=0A= aarch64_parse_override_string (opts->x_aarch64_override_tune_string,= =0A= - &aarch64_tune_params);=0A= + &aarch64_tune_params);=0A= =0A= /* This target defaults to strict volatile bitfields. */=0A= if (opts->x_flag_strict_volatile_bitfields < 0 && abi_version_at_least (= 2))=0A= @@ -17697,13 +17703,6 @@ aarch64_override_options_internal (struct gcc_opti= ons *opts)=0A= && opts->x_optimize >=3D aarch64_tune_params.prefetch->default_opt_l= evel)=0A= opts->x_flag_prefetch_loop_arrays =3D 1;=0A= =0A= - if (opts->x_aarch64_arch_string =3D=3D NULL)=0A= - opts->x_aarch64_arch_string =3D selected_arch->name;=0A= - if (opts->x_aarch64_cpu_string =3D=3D NULL)=0A= - opts->x_aarch64_cpu_string =3D selected_cpu->name;=0A= - if (opts->x_aarch64_tune_string =3D=3D NULL)=0A= - opts->x_aarch64_tune_string =3D selected_tune->name;=0A= -=0A= aarch64_override_options_after_change_1 (opts);=0A= }=0A= =0A= @@ -18055,26 +18054,6 @@ aarch64_validate_mtune (const char *str, const str= uct processor **res)=0A= return false;=0A= }=0A= =0A= -/* Return the CPU corresponding to the enum CPU. */=0A= -=0A= -static const struct processor *=0A= -aarch64_get_tune_cpu (enum aarch64_processor cpu)=0A= -{=0A= - gcc_assert (cpu !=3D aarch64_none);=0A= -=0A= - return &all_cores[cpu];=0A= -}=0A= -=0A= -/* Return the architecture corresponding to the enum ARCH. */=0A= -=0A= -static const struct processor *=0A= -aarch64_get_arch (enum aarch64_arch arch)=0A= -{=0A= - gcc_assert (arch !=3D aarch64_no_arch);=0A= -=0A= - return &all_architectures[arch];=0A= -}=0A= -=0A= /* Return the VG value associated with -msve-vector-bits=3D value VALUE. = */=0A= =0A= static poly_uint16=0A= @@ -18110,9 +18089,9 @@ aarch64_override_options (void)=0A= uint64_t arch_isa =3D 0;=0A= aarch64_isa_flags =3D 0;=0A= =0A= - selected_cpu =3D NULL;=0A= - selected_arch =3D NULL;=0A= - selected_tune =3D NULL;=0A= + const struct processor *cpu =3D NULL;=0A= + const struct processor *arch =3D NULL;=0A= + const struct processor *tune =3D NULL;=0A= =0A= if (aarch64_harden_sls_string)=0A= aarch64_validate_sls_mitigation (aarch64_harden_sls_string);=0A= @@ -18124,56 +18103,52 @@ aarch64_override_options (void)=0A= If either of -march or -mtune is given, they override their=0A= respective component of -mcpu. */=0A= if (aarch64_cpu_string)=0A= - aarch64_validate_mcpu (aarch64_cpu_string, &selected_cpu, &cpu_isa);= =0A= + aarch64_validate_mcpu (aarch64_cpu_string, &cpu, &cpu_isa);=0A= =0A= if (aarch64_arch_string)=0A= - aarch64_validate_march (aarch64_arch_string, &selected_arch, &arch_isa= );=0A= + aarch64_validate_march (aarch64_arch_string, &arch, &arch_isa);=0A= =0A= if (aarch64_tune_string)=0A= - aarch64_validate_mtune (aarch64_tune_string, &selected_tune);=0A= + aarch64_validate_mtune (aarch64_tune_string, &tune);=0A= =0A= #ifdef SUBTARGET_OVERRIDE_OPTIONS=0A= SUBTARGET_OVERRIDE_OPTIONS;=0A= #endif=0A= =0A= - if (selected_cpu && selected_arch)=0A= + if (cpu && arch)=0A= {=0A= /* If both -mcpu and -march are specified, warn if they are not=0A= architecturally compatible and prefer the -march ISA flags. */=0A= - if (selected_arch->arch !=3D selected_cpu->arch)=0A= + if (arch->arch !=3D cpu->arch)=0A= {=0A= warning (0, "switch %<-mcpu=3D%s%> conflicts with %<-march=3D%s%> switc= h",=0A= aarch64_cpu_string,=0A= aarch64_arch_string);=0A= }=0A= =0A= + selected_arch =3D arch->arch;=0A= aarch64_isa_flags =3D arch_isa;=0A= }=0A= - else if (selected_cpu)=0A= + else if (cpu)=0A= {=0A= - selected_arch =3D &all_architectures[selected_cpu->arch];=0A= + selected_arch =3D cpu->arch;=0A= aarch64_isa_flags =3D cpu_isa;=0A= }=0A= - else if (selected_arch)=0A= + else if (arch)=0A= {=0A= - selected_cpu =3D &all_cores[selected_arch->ident];=0A= + cpu =3D &all_cores[arch->ident];=0A= + selected_arch =3D arch->arch;=0A= aarch64_isa_flags =3D arch_isa;=0A= }=0A= else=0A= {=0A= /* No -mcpu or -march specified, so use the default CPU. */=0A= - selected_cpu =3D &all_cores[TARGET_CPU_DEFAULT];=0A= - selected_arch =3D &all_architectures[selected_cpu->arch];=0A= - aarch64_isa_flags =3D selected_cpu->flags;=0A= + cpu =3D &all_cores[TARGET_CPU_DEFAULT];=0A= + selected_arch =3D cpu->arch;=0A= + aarch64_isa_flags =3D cpu->flags;=0A= }=0A= =0A= - explicit_arch =3D selected_arch->arch;=0A= - if (!selected_tune)=0A= - selected_tune =3D selected_cpu;=0A= - explicit_tune_core =3D selected_tune->ident;=0A= -=0A= - gcc_assert (explicit_tune_core !=3D aarch64_none);=0A= - gcc_assert (explicit_arch !=3D aarch64_no_arch);=0A= + selected_tune =3D tune ? tune->ident : cpu->ident;=0A= =0A= if (aarch64_enable_bti =3D=3D 2)=0A= {=0A= @@ -18292,38 +18267,14 @@ initialize_aarch64_code_model (struct gcc_options= *opts)=0A= }=0A= }=0A= =0A= -/* Implement TARGET_OPTION_SAVE. */=0A= -=0A= -static void=0A= -aarch64_option_save (struct cl_target_option *ptr, struct gcc_options *opt= s,=0A= - struct gcc_options */* opts_set */)=0A= -{=0A= - ptr->x_aarch64_override_tune_string =3D opts->x_aarch64_override_tune_st= ring;=0A= - ptr->x_aarch64_branch_protection_string=0A= - =3D opts->x_aarch64_branch_protection_string;=0A= -}=0A= -=0A= /* Implements TARGET_OPTION_RESTORE. Restore the backend codegen decision= s=0A= using the information saved in PTR. */=0A= =0A= static void=0A= aarch64_option_restore (struct gcc_options *opts,=0A= - struct gcc_options */* opts_set */,=0A= - struct cl_target_option *ptr)=0A= + struct gcc_options * /* opts_set */,=0A= + struct cl_target_option * /* ptr */)=0A= {=0A= - opts->x_explicit_arch =3D ptr->x_explicit_arch;=0A= - selected_arch =3D aarch64_get_arch (ptr->x_explicit_arch);=0A= - opts->x_explicit_tune_core =3D ptr->x_explicit_tune_core;=0A= - selected_tune =3D aarch64_get_tune_cpu (ptr->x_explicit_tune_core);=0A= - opts->x_aarch64_override_tune_string =3D ptr->x_aarch64_override_tune_st= ring;=0A= - opts->x_aarch64_branch_protection_string=0A= - =3D ptr->x_aarch64_branch_protection_string;=0A= - if (opts->x_aarch64_branch_protection_string)=0A= - {=0A= - aarch64_parse_branch_protection (opts->x_aarch64_branch_protection_s= tring,=0A= - NULL);=0A= - }=0A= -=0A= aarch64_override_options_internal (opts);=0A= }=0A= =0A= @@ -18333,11 +18284,11 @@ static void=0A= aarch64_option_print (FILE *file, int indent, struct cl_target_option *ptr= )=0A= {=0A= const struct processor *cpu=0A= - =3D aarch64_get_tune_cpu (ptr->x_explicit_tune_core);=0A= - uint64_t isa_flags =3D ptr->x_aarch64_isa_flags;=0A= - const struct processor *arch =3D aarch64_get_arch (ptr->x_explicit_arch)= ;=0A= + =3D aarch64_get_tune_cpu (ptr->x_selected_tune);=0A= + const struct processor *arch =3D aarch64_get_arch (ptr->x_selected_arch)= ;=0A= std::string extension=0A= - =3D aarch64_get_extension_string_for_isa_flags (isa_flags, arch->flags= );=0A= + =3D aarch64_get_extension_string_for_isa_flags (ptr->x_aarch64_isa_fla= gs,=0A= + arch->flags);=0A= =0A= fprintf (file, "%*sselected tune =3D %s\n", indent, "", cpu->name);=0A= fprintf (file, "%*sselected arch =3D %s%s\n", indent, "",=0A= @@ -18450,8 +18401,7 @@ aarch64_handle_attr_arch (const char *str)=0A= if (parse_res =3D=3D AARCH64_PARSE_OK)=0A= {=0A= gcc_assert (tmp_arch);=0A= - selected_arch =3D tmp_arch;=0A= - explicit_arch =3D selected_arch->arch;=0A= + selected_arch =3D tmp_arch->arch;=0A= return true;=0A= }=0A= =0A= @@ -18489,11 +18439,8 @@ aarch64_handle_attr_cpu (const char *str)=0A= if (parse_res =3D=3D AARCH64_PARSE_OK)=0A= {=0A= gcc_assert (tmp_cpu);=0A= - selected_tune =3D tmp_cpu;=0A= - explicit_tune_core =3D selected_tune->ident;=0A= -=0A= - selected_arch =3D &all_architectures[tmp_cpu->arch];=0A= - explicit_arch =3D selected_arch->arch;=0A= + selected_tune =3D tmp_cpu->ident;=0A= + selected_arch =3D tmp_cpu->arch;=0A= return true;=0A= }=0A= =0A= @@ -18561,8 +18508,7 @@ aarch64_handle_attr_tune (const char *str)=0A= if (parse_res =3D=3D AARCH64_PARSE_OK)=0A= {=0A= gcc_assert (tmp_tune);=0A= - selected_tune =3D tmp_tune;=0A= - explicit_tune_core =3D selected_tune->ident;=0A= + selected_tune =3D tmp_tune->ident;=0A= return true;=0A= }=0A= =0A= @@ -22467,7 +22413,7 @@ aarch64_declare_function_name (FILE *stream, const = char* name,=0A= gcc_assert (targ_options);=0A= =0A= const struct processor *this_arch=0A= - =3D aarch64_get_arch (targ_options->x_explicit_arch);=0A= + =3D aarch64_get_arch (targ_options->x_selected_arch);=0A= =0A= uint64_t isa_flags =3D targ_options->x_aarch64_isa_flags;=0A= std::string extension=0A= @@ -22486,7 +22432,7 @@ aarch64_declare_function_name (FILE *stream, const = char* name,=0A= useful to readers of the generated asm. Do it only when it changes= =0A= from function to function and verbose assembly is requested. */=0A= const struct processor *this_tune=0A= - =3D aarch64_get_tune_cpu (targ_options->x_explicit_tune_core);=0A= + =3D aarch64_get_tune_cpu (targ_options->x_selected_tune);=0A= =0A= if (flag_debug_asm && aarch64_last_printed_tune_string !=3D this_tune->n= ame)=0A= {=0A= @@ -22572,7 +22518,7 @@ aarch64_start_file (void)=0A= =3D TREE_TARGET_OPTION (target_option_default_node);=0A= =0A= const struct processor *default_arch=0A= - =3D aarch64_get_arch (default_options->x_explicit_arch);=0A= + =3D aarch64_get_arch (default_options->x_selected_arch);=0A= uint64_t default_isa_flags =3D default_options->x_aarch64_isa_flags;=0A= std::string extension=0A= =3D aarch64_get_extension_string_for_isa_flags (default_isa_flags,=0A= @@ -27445,9 +27391,6 @@ aarch64_libgcc_floating_mode_supported_p=0A= #undef TARGET_OFFLOAD_OPTIONS=0A= #define TARGET_OFFLOAD_OPTIONS aarch64_offload_options=0A= =0A= -#undef TARGET_OPTION_SAVE=0A= -#define TARGET_OPTION_SAVE aarch64_option_save=0A= -=0A= #undef TARGET_OPTION_RESTORE=0A= #define TARGET_OPTION_RESTORE aarch64_option_restore=0A= =0A= diff --git a/gcc/config/aarch64/aarch64.opt b/gcc/config/aarch64/aarch64.op= t=0A= index 92220b26ee2bf9f95c9a387c3155779596ee5ad5..d8e1f42a3a683c6d2cb7d930a41= ec2e0415e2bf1 100644=0A= --- a/gcc/config/aarch64/aarch64.opt=0A= +++ b/gcc/config/aarch64/aarch64.opt=0A= @@ -22,13 +22,10 @@ HeaderInclude=0A= config/aarch64/aarch64-opts.h=0A= =0A= TargetVariable=0A= -enum aarch64_processor explicit_tune_core =3D aarch64_none=0A= +enum aarch64_processor selected_tune =3D aarch64_none=0A= =0A= TargetVariable=0A= -enum aarch64_arch explicit_arch =3D aarch64_no_arch=0A= -=0A= -TargetSave=0A= -const char *x_aarch64_override_tune_string=0A= +enum aarch64_arch selected_arch =3D aarch64_no_arch=0A= =0A= TargetVariable=0A= uint64_t aarch64_isa_flags =3D 0=0A= @@ -36,6 +33,9 @@ uint64_t aarch64_isa_flags =3D 0=0A= TargetVariable=0A= unsigned aarch64_enable_bti =3D 2=0A= =0A= +TargetVariable=0A= +enum aarch64_key_type aarch64_ra_sign_key =3D AARCH64_KEY_A=0A= +=0A= ; The TLS dialect names to use with -mtls-dialect.=0A= =0A= Enum=0A= @@ -139,7 +139,7 @@ Target RejectNegative Joined Enum(aarch64_abi) Var(aarc= h64_abi) Init(AARCH64_ABI=0A= Generate code that conforms to the specified ABI.=0A= =0A= moverride=3D=0A= -Target RejectNegative ToLower Joined Var(aarch64_override_tune_string)=0A= +Target RejectNegative ToLower Joined Var(aarch64_override_tune_string) Sav= e=0A= -moverride=3D Power users only! Override CPU optimization paramete= rs.=0A= =0A= Enum=0A= =0A=