From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2063.outbound.protection.outlook.com [40.107.20.63]) by sourceware.org (Postfix) with ESMTPS id 10E793856967 for ; Wed, 7 Jun 2023 14:01:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 10E793856967 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/mlTUo+lpO85c8wUkVg6VwVySbYH3rAVtVAz3EgD+fQ=; b=KFiptXaRxj0ZY9l5KX3YNS4xp5h1ispVa+X/uLNdspv0iDpo51ufHPum+e52WshjXNdMH3QZ1p2zz+gOwPG4WJ0WIhIi2E4J388yCWZu4pNLXtfLPVtuYLO4oOgwEAkG/5kVv28Jv/oiryvgWpNtBAxj7VP0maVwN8c+quIafJs= Received: from DB6P195CA0003.EURP195.PROD.OUTLOOK.COM (2603:10a6:4:cb::13) by DU0PR08MB7882.eurprd08.prod.outlook.com (2603:10a6:10:3b2::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.31; Wed, 7 Jun 2023 14:01:31 +0000 Received: from DBAEUR03FT054.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:cb:cafe::2) by DB6P195CA0003.outlook.office365.com (2603:10a6:4:cb::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6477.19 via Frontend Transport; Wed, 7 Jun 2023 14:01:31 +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 DBAEUR03FT054.mail.protection.outlook.com (100.127.142.218) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6477.22 via Frontend Transport; Wed, 7 Jun 2023 14:01:31 +0000 Received: ("Tessian outbound 8b05220b4215:v136"); Wed, 07 Jun 2023 14:01:31 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: c94402cd857329c9 X-CR-MTA-TID: 64aa7808 Received: from 93509dcc8fbb.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 464F8B86-99A2-4D45-B163-66B219126EC6.1; Wed, 07 Jun 2023 14:01:25 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 93509dcc8fbb.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 07 Jun 2023 14:01:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=igwCWnXctAS6QikJobabpPe0ckie6HCviZWfBZRVeR18L6YFu3xJhjX6gMg+Hwc11NJ8z2vcHPe/BgwEGT+fVNivlIO64ulzPptPKHkcOqK5uW1Y8hSzNSuG4KyE/zRoARPeAklXIAoyIRGhFpG/fwRqoo3YwkFOVN2+NW5u6PMsysGdJl9jBZEPgbfsnbHKPVbOiS0E5AslA/T56x1+DCJffsfeDrt/kI93pdBwRoxyWLnlz2ww5ldkf0lgZlr0IKW4a5q4e1kr17RTy1/mpE8jZlDloNedMfUU1r0R7+njTLAJg84MeSqR021JhZG9s0zKitD14zsp9mDqB9KX0g== 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=/mlTUo+lpO85c8wUkVg6VwVySbYH3rAVtVAz3EgD+fQ=; b=YSsvZ3W6+8zLg5Ago3H2vNlc0GE13poCDR1k0pCXiM6thdOE6tF+Zja+bufM3K+e6cuvNuB1XPLfqauqK1ullBCqTpctCjut1iq864fzoNV24slV9NSFh7KYfTpfZ0ne0WXnSHj1OwMR9G2wUfiqWO0dMosFDgwYNrnFVOknd6b4ntTQkXdHpUMDkSRwWov4FCap7SZ4yKTMflxHHxDwbRoGXWde73NcufHoKDz1UAS8SD7CVyYy62mAOQUezFlWl73xFKLv3mKFfHhydlEFCJGuKGEiDa47iQxu17sHvF1xWAUmqrDZWXikPyAjFER7NGmU83nl3k2s7J/RzlTr4g== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/mlTUo+lpO85c8wUkVg6VwVySbYH3rAVtVAz3EgD+fQ=; b=KFiptXaRxj0ZY9l5KX3YNS4xp5h1ispVa+X/uLNdspv0iDpo51ufHPum+e52WshjXNdMH3QZ1p2zz+gOwPG4WJ0WIhIi2E4J388yCWZu4pNLXtfLPVtuYLO4oOgwEAkG/5kVv28Jv/oiryvgWpNtBAxj7VP0maVwN8c+quIafJs= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from PAXPR08MB7201.eurprd08.prod.outlook.com (2603:10a6:102:20b::17) by PA4PR08MB5933.eurprd08.prod.outlook.com (2603:10a6:102:f0::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.32; Wed, 7 Jun 2023 14:01:23 +0000 Received: from PAXPR08MB7201.eurprd08.prod.outlook.com ([fe80::5b72:ef2:156a:296a]) by PAXPR08MB7201.eurprd08.prod.outlook.com ([fe80::5b72:ef2:156a:296a%6]) with mapi id 15.20.6455.030; Wed, 7 Jun 2023 14:01:22 +0000 Date: Wed, 7 Jun 2023 15:01:15 +0100 From: Alex Coplan To: gcc-patches@gcc.gnu.org Cc: Richard Earnshaw , Richard Sandiford , Kyrylo Tkachov Subject: [PATCH 3/3] aarch64: Allow compiler to define ls64 builtins [PR110132] Message-ID: Content-Type: multipart/mixed; boundary="Mb37sSoh0s/8A+o8" Content-Disposition: inline Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SA1PR03CA0009.namprd03.prod.outlook.com (2603:10b6:806:2d3::20) To PAXPR08MB7201.eurprd08.prod.outlook.com (2603:10a6:102:20b::17) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: PAXPR08MB7201:EE_|PA4PR08MB5933:EE_|DBAEUR03FT054:EE_|DU0PR08MB7882:EE_ X-MS-Office365-Filtering-Correlation-Id: 7581e663-e136-48eb-7a1d-08db675fb289 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: yU7JxuXbYhmw5atMyRUVH7hoeKii4lVPcfiklLTYQ/pO1rFgjxtWEY9Q4SkP5YO8s6GvempR9AaNcui4fZ4dJCiIG2klt5fo19IeMkWKC/1x6LU67WQ5yCtr+kJH0NiRtWY/AHeOchwGjYpXKOu4lkCg7Co090DfwdmIoAOEBpDPa1EihBjf47fM0pVtSBs8DejzaekBkIhS3jZDQZj+P9KfFWoGaqLCpNoyG1b6LI8S4+c9YCNMRJZyzcW9IDgOMg/n3FkzUqC3jCXvHaSLT85YDJPer50pJ9sf2SdFvX5o3xZyb+VRWQSQqXI88LUMpt2+BDpN9fTWjX1aCDpF0Fjrd1PiYpht62yUvjDeXRx0c97oCh1D25Y+oOyJKkyVirkYQ/gIVkGJ+TEwDdh2LvwqSWhB/+4Sjuz4xiWTFC1KRyiOARug5FVdEUFqMqzNxoYl7hxG1CNvk/1Yqa7j3MAfaEc0QrmuoIXIQE8QikKVhgDi4nuKbcaGgdRDyUh2FgAV9lSu2xnVU4c/VXlPfAB/IgagtdYyb3W1d8fBFpCxOQw4VGr/mtALHr3DP5Z8hOQx2BITq1pmhAiEPg7h3HNk6A+Wxr8hE+FplMs48ENebENOvF02WMNsrw51gcBxmVUWtZFmimXvJG0e7VNKSg== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR08MB7201.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(366004)(376002)(396003)(39860400002)(346002)(451199021)(478600001)(2906002)(6486002)(44144004)(33964004)(36756003)(6666004)(2616005)(83380400001)(86362001)(6512007)(6506007)(38100700002)(26005)(186003)(5660300002)(316002)(8676002)(66946007)(6916009)(8936002)(66556008)(4326008)(66476007)(235185007)(44832011)(54906003)(84970400001)(41300700001)(2700100001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB5933 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: DBAEUR03FT054.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 42b5868c-7d03-4afe-b978-08db675fad20 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 98mSuScmS/dQ+MiWmP/AODDubuDn23PfYGzX3sJMjO3mjOauAl2Ho8GYN7K4FWdR4m4kuI7zkz/GcOugPbZFcgiay13NQLIs5+MXxa4rMnlNARdTJa1Da3lLknOqs13WmxvTdNlRJtLKASq5tr304EeaDKrXYX4tCH1dMEj++8ILepZY9wvUq1+xiqi408I6DbzyJP4r/UutkiO5S+zTLgFZZ+Hzj0JHxqYgLfq0jeyOJs5Lf+7gpZEZmnN5WVCI5AchJ7eRgVeuUjWx1IKB9ovtTAu7mEl/XO7t74iD0AKH+vPgy3WwLkjF5V9griow1oa0z8ughBvFmqPUQQSbBVzA+SbGHP0mx1WtBOEzkvqdaX8YIB5bBC6o3wV9Alr7IJVCFuerFlIGaYMVhjtL6pm7ISY2d11K0ZJw03bZd87WpuVZTgezks/WhUvii2bsgPw5xhw/CeTEAx1mEiWwn3v+3sriH2bT/xO479SwuisuLHUwCBvLq34s94aFAeLuNeUFSdon9shPE+i+sB1Dvfn2LLgKzv/+62bgO5c7M73JstKwD9le4BsbHlMj8hbhSB/dHTMyyMGYzx+QfcJ+H2xtOoKLpBcxvUiiWpgOE5OtHPZeftnFGgbdWTreMEky1xO+PMadlSLNqsYCJZjT5dee/bdQLj2Dbib57LDdwsmfU+ALXthXN9Ili+MwFL8XNB5nQ0rHfcZhnhGt1sPwlB27ALQQpKX1VPog7rxYonVMCMhUn3XCwRRh06RfGqslatBFl3QZGKs8CwuOBrZ9loAgr+QO6fldHcjMycU6DNU= 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:(13230028)(4636009)(136003)(396003)(39860400002)(346002)(376002)(451199021)(46966006)(36840700001)(40470700004)(84970400001)(186003)(6506007)(26005)(6512007)(2616005)(336012)(83380400001)(47076005)(6666004)(6486002)(36756003)(44144004)(82310400005)(82740400003)(36860700001)(33964004)(2906002)(8936002)(8676002)(54906003)(478600001)(40480700001)(6916009)(40460700003)(41300700001)(316002)(4326008)(81166007)(5660300002)(44832011)(356005)(86362001)(70206006)(235185007)(70586007)(2700100001);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2023 14:01:31.7965 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7581e663-e136-48eb-7a1d-08db675fb289 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: DBAEUR03FT054.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB7882 X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,GIT_PATCH_0,KAM_DMARC_NONE,KAM_SHORT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,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 List-Id: --Mb37sSoh0s/8A+o8 Content-Type: text/plain; charset=utf-8; format=fixed Content-Disposition: inline This patch refactors the ls64 builtins to allow the compiler to define them directly instead of having wrapper functions in arm_acle.h. This should be not only easier to maintain, but it makes two important correctness fixes: - It fixes PR110132, where the builtins ended up getting declared with invisible bindings in the C FE, so the FE ended up synthesizing incompatible implicit definitions for these builtins. - It allows the builtins to be used with LTO, which didn't work previously. We also take the opportunity to add test coverage from C++ for these builtins. gcc/ChangeLog: PR target/110132 * config/aarch64/aarch64-builtins.cc (aarch64_general_simulate_builtin): New. Use it ... (aarch64_init_ls64_builtins): ... here. Switch to declaring public ACLE names for builtins. (aarch64_general_init_builtins): Ensure we invoke the arm_acle.h setup if in_lto_p, just like we do for SVE. * config/aarch64/arm_acle.h: (__arm_ld64b): Delete. (__arm_st64b): Delete. (__arm_st64bv): Delete. (__arm_st64bv0): Delete. gcc/testsuite/ChangeLog: PR target/110132 * lib/target-supports.exp (check_effective_target_aarch64_asm_FUNC_ok): Extend to ls64. * g++.target/aarch64/acle/acle.exp: New. * g++.target/aarch64/acle/ls64.C: New test. * g++.target/aarch64/acle/ls64_lto.C: New test. * gcc.target/aarch64/acle/ls64_lto.c: New test. * gcc.target/aarch64/acle/pr110132.c: New test. --- gcc/config/aarch64/aarch64-builtins.cc | 24 ++++++++++--- gcc/config/aarch64/arm_acle.h | 33 ----------------- .../g++.target/aarch64/acle/acle.exp | 35 +++++++++++++++++++ gcc/testsuite/g++.target/aarch64/acle/ls64.C | 10 ++++++ .../g++.target/aarch64/acle/ls64_lto.C | 10 ++++++ .../gcc.target/aarch64/acle/ls64_lto.c | 10 ++++++ .../gcc.target/aarch64/acle/pr110132.c | 15 ++++++++ gcc/testsuite/lib/target-supports.exp | 2 +- 8 files changed, 100 insertions(+), 39 deletions(-) create mode 100644 gcc/testsuite/g++.target/aarch64/acle/acle.exp create mode 100644 gcc/testsuite/g++.target/aarch64/acle/ls64.C create mode 100644 gcc/testsuite/g++.target/aarch64/acle/ls64_lto.C create mode 100644 gcc/testsuite/gcc.target/aarch64/acle/ls64_lto.c create mode 100644 gcc/testsuite/gcc.target/aarch64/acle/pr110132.c --Mb37sSoh0s/8A+o8 Content-Type: text/x-patch; charset=utf-8; name=3 Content-Disposition: attachment; filename=3 Content-Transfer-Encoding: 8bit diff --git a/gcc/config/aarch64/aarch64-builtins.cc b/gcc/config/aarch64/aarch64-builtins.cc index cb5828a70f4..fce95c34a7c 100644 --- a/gcc/config/aarch64/aarch64-builtins.cc +++ b/gcc/config/aarch64/aarch64-builtins.cc @@ -956,6 +956,16 @@ aarch64_general_add_builtin (const char *name, tree type, unsigned int code, NULL, attrs); } +static tree +aarch64_general_simulate_builtin (const char *name, tree fntype, + unsigned int code, + tree attrs = NULL_TREE) +{ + code = (code << AARCH64_BUILTIN_SHIFT) | AARCH64_BUILTIN_GENERAL; + return simulate_builtin_function_decl (input_location, name, fntype, + code, NULL, attrs); +} + static const char * aarch64_mangle_builtin_scalar_type (const_tree type) { @@ -1879,23 +1889,24 @@ aarch64_init_ls64_builtins (void) aarch64_init_ls64_builtins_types (); ls64_builtins_data data[4] = { - {"__builtin_aarch64_ld64b", AARCH64_LS64_BUILTIN_LD64B, + {"__arm_ld64b", AARCH64_LS64_BUILTIN_LD64B, build_function_type_list (ls64_arm_data_t, const_ptr_type_node, NULL_TREE)}, - {"__builtin_aarch64_st64b", AARCH64_LS64_BUILTIN_ST64B, + {"__arm_st64b", AARCH64_LS64_BUILTIN_ST64B, build_function_type_list (void_type_node, ptr_type_node, ls64_arm_data_t, NULL_TREE)}, - {"__builtin_aarch64_st64bv", AARCH64_LS64_BUILTIN_ST64BV, + {"__arm_st64bv", AARCH64_LS64_BUILTIN_ST64BV, build_function_type_list (uint64_type_node, ptr_type_node, ls64_arm_data_t, NULL_TREE)}, - {"__builtin_aarch64_st64bv0", AARCH64_LS64_BUILTIN_ST64BV0, + {"__arm_st64bv0", AARCH64_LS64_BUILTIN_ST64BV0, build_function_type_list (uint64_type_node, ptr_type_node, ls64_arm_data_t, NULL_TREE)}, }; for (size_t i = 0; i < ARRAY_SIZE (data); ++i) aarch64_builtin_decls[data[i].code] - = aarch64_general_add_builtin (data[i].name, data[i].type, data[i].code); + = aarch64_general_simulate_builtin (data[i].name, data[i].type, + data[i].code); } static void @@ -2028,6 +2039,9 @@ aarch64_general_init_builtins (void) if (TARGET_MEMTAG) aarch64_init_memtag_builtins (); + + if (in_lto_p) + handle_arm_acle_h (); } /* Implement TARGET_BUILTIN_DECL for the AARCH64_BUILTIN_GENERAL group. */ diff --git a/gcc/config/aarch64/arm_acle.h b/gcc/config/aarch64/arm_acle.h index e0ac591d2c8..3b6b63e6805 100644 --- a/gcc/config/aarch64/arm_acle.h +++ b/gcc/config/aarch64/arm_acle.h @@ -270,40 +270,7 @@ __ttest (void) #endif #ifdef __ARM_FEATURE_LS64 -#pragma GCC push_options -#pragma GCC target ("+nothing+ls64") - typedef __arm_data512_t data512_t; - -__extension__ extern __inline data512_t -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) -__arm_ld64b (const void *__addr) -{ - return __builtin_aarch64_ld64b (__addr); -} - -__extension__ extern __inline void -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) -__arm_st64b (void *__addr, data512_t __value) -{ - __builtin_aarch64_st64b (__addr, __value); -} - -__extension__ extern __inline uint64_t -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) -__arm_st64bv (void *__addr, data512_t __value) -{ - return __builtin_aarch64_st64bv (__addr, __value); -} - -__extension__ extern __inline uint64_t -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) -__arm_st64bv0 (void *__addr, data512_t __value) -{ - return __builtin_aarch64_st64bv0 (__addr, __value); -} - -#pragma GCC pop_options #endif #pragma GCC push_options diff --git a/gcc/testsuite/g++.target/aarch64/acle/acle.exp b/gcc/testsuite/g++.target/aarch64/acle/acle.exp new file mode 100644 index 00000000000..9e1cbf4a0c6 --- /dev/null +++ b/gcc/testsuite/g++.target/aarch64/acle/acle.exp @@ -0,0 +1,35 @@ +# Copyright (C) 2014-2023 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# . + +# GCC testsuite that uses the `dg.exp' driver. + +# Exit immediately if this isn't an AArch64 target. +if ![istarget aarch64*-*-*] then { + return +} + +# Load support procs. +load_lib g++-dg.exp + +# Initialize `dg'. +dg-init + +# Main loop. +dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cCS\]]] \ + "" "" + +# All done. +dg-finish diff --git a/gcc/testsuite/g++.target/aarch64/acle/ls64.C b/gcc/testsuite/g++.target/aarch64/acle/ls64.C new file mode 100644 index 00000000000..d9002785b57 --- /dev/null +++ b/gcc/testsuite/g++.target/aarch64/acle/ls64.C @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-march=armv8.7-a" } */ +#include +int main() +{ + data512_t d = __arm_ld64b ((const void *)0x1000); + __arm_st64b ((void *)0x2000, d); + uint64_t x = __arm_st64bv ((void *)0x3000, d); + x += __arm_st64bv0 ((void *)0x4000, d); +} diff --git a/gcc/testsuite/g++.target/aarch64/acle/ls64_lto.C b/gcc/testsuite/g++.target/aarch64/acle/ls64_lto.C new file mode 100644 index 00000000000..274a4771e1c --- /dev/null +++ b/gcc/testsuite/g++.target/aarch64/acle/ls64_lto.C @@ -0,0 +1,10 @@ +/* { dg-do link { target aarch64_asm_ls64_ok } } */ +/* { dg-additional-options "-march=armv8.7-a -flto" } */ +#include +int main() +{ + data512_t d = __arm_ld64b ((const void *)0x1000); + __arm_st64b ((void *)0x2000, d); + uint64_t x = __arm_st64bv ((void *)0x3000, d); + x += __arm_st64bv0 ((void *)0x4000, d); +} diff --git a/gcc/testsuite/gcc.target/aarch64/acle/ls64_lto.c b/gcc/testsuite/gcc.target/aarch64/acle/ls64_lto.c new file mode 100644 index 00000000000..8b4f2427771 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/acle/ls64_lto.c @@ -0,0 +1,10 @@ +/* { dg-do link { target aarch64_asm_ls64_ok } } */ +/* { dg-additional-options "-march=armv8.7-a -flto" } */ +#include +int main(void) +{ + data512_t d = __arm_ld64b ((const void *)0x1000); + __arm_st64b ((void *)0x2000, d); + uint64_t x = __arm_st64bv ((void *)0x3000, d); + x += __arm_st64bv0 ((void *)0x4000, d); +} diff --git a/gcc/testsuite/gcc.target/aarch64/acle/pr110132.c b/gcc/testsuite/gcc.target/aarch64/acle/pr110132.c new file mode 100644 index 00000000000..fb88d633dd2 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/acle/pr110132.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-march=armv8.7-a" } */ + +/* Check that ls64 builtins can be invoked using a preprocesed testcase + without triggering bogus builtin warnings, see PR110132. + + Note that this is purely to test GCC internals and user code should + include arm_acle.h to make use of these builtins. */ + +#pragma GCC aarch64 "arm_acle.h" +typedef __arm_data512_t data512_t; +void f(void *p, data512_t d) +{ + __arm_st64b (p, d); +} diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 431a56f0be5..184fafb020f 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -10965,7 +10965,7 @@ proc check_effective_target_aarch64_tiny { } { # various architecture extensions via the .arch_extension pseudo-op. foreach { aarch64_ext } { "fp" "simd" "crypto" "crc" "lse" "dotprod" "sve" - "i8mm" "f32mm" "f64mm" "bf16" "sb" "sve2" } { + "i8mm" "f32mm" "f64mm" "bf16" "sb" "sve2" "ls64" } { eval [string map [list FUNC $aarch64_ext] { proc check_effective_target_aarch64_asm_FUNC_ok { } { if { [istarget aarch64*-*-*] } { --Mb37sSoh0s/8A+o8--