From patchwork Wed Jun 12 12:35:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Victor Do Nascimento X-Patchwork-Id: 1946837 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=BLhEmfE/; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=BLhEmfE/; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzlQ92zjmz20KL for ; Wed, 12 Jun 2024 22:36:01 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 40A5E3882062 for ; Wed, 12 Jun 2024 12:35:58 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on20601.outbound.protection.outlook.com [IPv6:2a01:111:f403:2613::601]) by sourceware.org (Postfix) with ESMTPS id CEDBF387089F for ; Wed, 12 Jun 2024 12:35:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CEDBF387089F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org CEDBF387089F Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:2613::601 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1718195730; cv=pass; b=a+CRtTGjpq0/5C7EwrPlCxQvnYv1Tg5N733eyO1MhebKm4VWkFL+lndTP/pZLkHO4mBq7VVTai7HY0cs8VCjv4X8Bz5WFgZ/ncpQ7KCOTFhhga5FWxTd3JDYHXSsGIvmSm1pLxg9GJpTP3MUlynklCBIJ0Rg/hvKyfXS8S/V/rw= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1718195730; c=relaxed/simple; bh=LMAgkTQ9flSpxoV2+I5MvwbeGFCb0Z4coRuak1uhWnc=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=kzHEQxbgvqDDCaN4rCY4RS4HJ7cY3AbNjmWO6t0tmdyLFtoSWI/B47k4WsOrvuHn6ZEtfNu3BvU0xHAdc8T28vCURj9JR17w8sgLafL7wGjyQJuwAdkHHcywGy8NDWCIEC2LJqSgY0hOuFDnPsqhHnGNy3jXdDeEW7gxWpRP9Js= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=VsPpd+iPvS9fMLn4xqKItp4i8Yr5SLzx6WX6LUhpeg5keNO0lU5vtJOemtBVokFC7puVXM751KU2uBho/WGCvZr4TZM3QtnpXAN1BSofdAQLAq5Do7RdcuAxhMHs6zW3uPVNPfI8LpRty+ypcOTISAMUmrqv7zz7bUtta9gvh7McOPKZZmJnszjnPRCgLdCwIaWQKfry4a+j8XQjUsqr8IgavFaUJgpQHGNysv3WIR56sPRq3szYBS7ePEO/xPM8/1mmWktbqezsfLfPRQm+oEe5D0KFPTAhVcCKe6n5003VSOrAEqjh6MYt1elm8BzbmEAgvDFn1saAeLiPCj9OEQ== 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=8RrNBvanQJphlZuJhkhrWv+PBhwIh8FYNG8yoP2jURM=; b=VIjTkgm3zcr2GbcCepdZ1r9ssTHYDX6NhB+Uj7U7E5+socOad+Y7EGYNWyyo9++ZRxRMVPdGRuyzzICDKdNUhTCi1Iw/M6G9KI6dg5xkzkzVS2TeOjoUdpY33cZH+0GM7JPexiXEnBOE9XqKrPNR/+DePUpuHbf1xTMNz1me9G+0pf8lGp9RpoEqKX7jo1zb7CV/LhTSMfcDQ1TRJEgWOcS3l4AVAVXRGioCYEQ7CpFBjx1LlpuK1O0L3OA0y7LBoWq8B9k5gcX9W+bduVTeZ13EyhsGp811vvnR/p7WuBC9/Rr3RSfPEJJYZuKxh+wp5Rlc/VW9ezI5nKdtkgRMkA== 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=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8RrNBvanQJphlZuJhkhrWv+PBhwIh8FYNG8yoP2jURM=; b=BLhEmfE/lULGfugpusH/Ugy+xEvMlB8iA42UM7Aa8nKtet+/ii+gGflOGGupfTacyXhKGcFYk72bn++kTFawVR/uJkLcRimHX5QEqf1eo8FHuRz/uP/K6mXum/8rgnrGUzWUtXg4K6m6FJ/ui6kxk4hZIKsQ075tQ190Dp4bfVU= Received: from DU7P194CA0021.EURP194.PROD.OUTLOOK.COM (2603:10a6:10:553::27) by AS8PR08MB9743.eurprd08.prod.outlook.com (2603:10a6:20b:615::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.20; Wed, 12 Jun 2024 12:35:24 +0000 Received: from DU6PEPF0000A7DE.eurprd02.prod.outlook.com (2603:10a6:10:553:cafe::1c) by DU7P194CA0021.outlook.office365.com (2603:10a6:10:553::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.20 via Frontend Transport; Wed, 12 Jun 2024 12:35:24 +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=arm.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 DU6PEPF0000A7DE.mail.protection.outlook.com (10.167.8.38) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7677.15 via Frontend Transport; Wed, 12 Jun 2024 12:35:23 +0000 Received: ("Tessian outbound 0445a89d5280:v332"); Wed, 12 Jun 2024 12:35:23 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: e415d0ca52fc3390 X-CR-MTA-TID: 64aa7808 Received: from 78e4b386e5d4.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id CA226719-33D3-4BC0-B0F1-11942B970A76.1; Wed, 12 Jun 2024 12:35:14 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 78e4b386e5d4.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 12 Jun 2024 12:35:14 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BoCylgEZhQFCgqDwdduf9LDNdKB0oHLNHdDq5uaOvawH9AFa5YrZJxVmaDukhpZ0c3gzlXbWRojVxr9QMOAfnB3YYttmDqfqCsjgXUDS0mE1R7cjGemwXzrs1yI5e1eawn6j9nZhKpC/PolGLEnKVuD6BRk0isCsTI29jdPmsElwFEdp7D2OCkxWpkFg9w5iS/Oiwn7SXl7fWdzFYhIwV63mdQ3junLmN58gM4bCSHHA5EnklsnwiuiDQ+WJIlxKp5EfG5IfGXDgBYZRtPXalQqfpVNtxc1K6iHqL9J2f/igH7tj23E4TZeV2M/L/doQzt2agXaKDLkNfZdSqyRk8w== 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=8RrNBvanQJphlZuJhkhrWv+PBhwIh8FYNG8yoP2jURM=; b=imx5ZEj/OTAfCQyfyG/HgxFXdMAirmxMbXxULlAQqZuQ8z+RZI76lXZRlyvytoMODx6TIQiiDmhAtfYBmoPj5B6VMaqnq/Afv7EmIuzIKWejd10g/tHFlSnhHikvXfbo8xhEjm5AEUXNpU5FTNPNaXGRHiPKlu3PrOTBEljlBCm7B4102LVHCOlYW2Dzl2oAda4f7k9YCzwxjZZZP7XkNCyihCj7mNaer+axP0MV09grUg0DxY9MOwFF6VLkVmPgjswU+nfVMLCDk0gkW1SvkkqOvKXgO2t9TRRNntcMpbqdmyFOiL95uMvyUqLxW/enliugWfZmR5drIuh9Qiffeg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8RrNBvanQJphlZuJhkhrWv+PBhwIh8FYNG8yoP2jURM=; b=BLhEmfE/lULGfugpusH/Ugy+xEvMlB8iA42UM7Aa8nKtet+/ii+gGflOGGupfTacyXhKGcFYk72bn++kTFawVR/uJkLcRimHX5QEqf1eo8FHuRz/uP/K6mXum/8rgnrGUzWUtXg4K6m6FJ/ui6kxk4hZIKsQ075tQ190Dp4bfVU= Received: from AS9PR04CA0135.eurprd04.prod.outlook.com (2603:10a6:20b:48a::10) by VI1PR08MB5504.eurprd08.prod.outlook.com (2603:10a6:803:13b::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.34; Wed, 12 Jun 2024 12:35:11 +0000 Received: from AM2PEPF0001C715.eurprd05.prod.outlook.com (2603:10a6:20b:48a:cafe::ce) by AS9PR04CA0135.outlook.office365.com (2603:10a6:20b:48a::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.20 via Frontend Transport; Wed, 12 Jun 2024 12:35:11 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by AM2PEPF0001C715.mail.protection.outlook.com (10.167.16.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7677.15 via Frontend Transport; Wed, 12 Jun 2024 12:35:11 +0000 Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 12 Jun 2024 12:35:10 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 12 Jun 2024 12:35:10 +0000 Received: from e133397.cambridge.arm.com (10.1.35.180) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Wed, 12 Jun 2024 12:35:10 +0000 From: Victor Do Nascimento To: CC: , , "Victor Do Nascimento" Subject: [PATCH v2] libatomic: Add rcpc3 128-bit atomic operations for AArch64 Date: Wed, 12 Jun 2024 13:35:05 +0100 Message-ID: <20240612123505.837005-1-victor.donascimento@arm.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM2PEPF0001C715:EE_|VI1PR08MB5504:EE_|DU6PEPF0000A7DE:EE_|AS8PR08MB9743:EE_ X-MS-Office365-Filtering-Correlation-Id: 47ac87de-ce51-48ee-efc4-08dc8adc2185 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; ARA:13230032|1800799016|82310400018|376006|36860700005; X-Microsoft-Antispam-Message-Info-Original: QBAxnqvWZRNUdLUz8UUe2pPNQm+fcZnPerul/IsvTbPG+1zD6e2fF3NqTRknngZylHzY3Csh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lAkDYhDMHYKRrqxlWqekl4/OwvVGcwn6juNrQMLqnA5+t2YhavaWSilyHTCm/7SiHa8Ywt+ocv33nFYrOSNQy/3z0tyBWii4EqrQKuDLt1sx1OrrKqcNifYQWXlhcTNvggtrGKGKpdZEA+w4lEAxeKaWZE7m2XV+/L1VoW7Cy47rRyO1O2MKBy1KaA09PnF9ernjo7eTvsJZo81mAIRr91nE1gSzCEZjUYhsqpBdPwHmVxqh2mWITZeHwJm3gsEUoEDbFjjfH2quQQng== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:nebula.arm.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230032)(1800799016)(82310400018)(376006)(36860700005); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB5504 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DU6PEPF0000A7DE.eurprd02.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 6b540785-d041-4c8c-d040-08dc8adc1a09 X-Microsoft-Antispam: BCL:0; ARA:13230032|82310400018|36860700005|35042699014|1800799016|376006; X-Microsoft-Antispam-Message-Info: ZBjpy4gebH0rw58N4zBc6vtBl8IsmmJrFfBU6jT1ITlb6ddm+a3vDp+gg2A5JVQLgePj/qD+KoMlyzfT+qghDNhu5nPTx5efZOB80UOEdPBedzZntTbNSj5CEevamb2sleFWnYp5XQ1Kt4FY9LZOk7mwO0yJDGbPgFaAzI/4UJTBpbI6ivPPf+y6mXkddTFAiTTtZEy2KpAStDWANoG93EClSu6hLqjYOTby3KD77vrVnU2t4EPqerbU8mJq9PuybIpgE4KXzI/53jvj3ZjpQAiCb14G2Hi3wGkiz1aqt1FJuLcvappO/S51rIsFkXd/RzinZIEji34LPelLPGWGsScLpBS/tHLM/kN+Bq/GBU2Uqs39HkSQ+ZERu4Nm13oR4QGooT9peUxtgeCX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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:(13230032)(82310400018)(36860700005)(35042699014)(1800799016)(376006); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jun 2024 12:35:23.9631 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 47ac87de-ce51-48ee-efc4-08dc8adc2185 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: DU6PEPF0000A7DE.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB9743 X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, KAM_NUMSUBJECT, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org The introduction of the optional RCPC3 architectural extension for Armv8.2-A upwards provides additional support for the release consistency model, introducing the Load-Acquire RCpc Pair Ordered, and Store-Release Pair Ordered operations in the form of LDIAPP and STILP. These operations are single-copy atomic on cores which also implement LSE2 and, as such, support for these operations is added to Libatomic and employed accordingly when the LSE2 and RCPC3 features are detected in a given core at runtime. libatomic/ChangeLog: * config/linux/aarch64/atomic_16.S (libat_load_16): Add LRCPC3 variant. (libat_store_16): Likewise. * config/linux/aarch64/host-config.h (HWCAP2_LRCPC3): New. (LSE2_LRCPC3_ATOP): Previously LSE2_ATOP. New ifuncs guarded under it. (has_rcpc3): New. --- libatomic/config/linux/aarch64/atomic_16.S | 46 +++++++++++++++++++- libatomic/config/linux/aarch64/host-config.h | 34 +++++++++++++-- 2 files changed, 74 insertions(+), 6 deletions(-) diff --git a/libatomic/config/linux/aarch64/atomic_16.S b/libatomic/config/linux/aarch64/atomic_16.S index c44c31c6418..5767fba5c03 100644 --- a/libatomic/config/linux/aarch64/atomic_16.S +++ b/libatomic/config/linux/aarch64/atomic_16.S @@ -35,16 +35,21 @@ writes, this will be true when using atomics in actual code. The libat__16 entry points are ARMv8.0. - The libat__16_i1 entry points are used when LSE128 is available. + The libat__16_i1 entry points are used when LSE128 or LRCPC3 is available. The libat__16_i2 entry points are used when LSE2 is available. */ #include "auto-config.h" .arch armv8-a+lse +/* There is overlap in atomic instructions implemented in RCPC3 and LSE2. + Consequently, both _i1 and _i2 suffixes are needed for functions using these. + Elsewhere, all extension-specific implementations are mapped to _i1. */ + +#define LRCPC3(NAME) libat_##NAME##_i1 #define LSE128(NAME) libat_##NAME##_i1 #define LSE(NAME) libat_##NAME##_i1 -#define LSE2(NAME) libat_##NAME##_i1 +#define LSE2(NAME) libat_##NAME##_i2 #define CORE(NAME) libat_##NAME #define ATOMIC(NAME) __atomic_##NAME @@ -513,6 +518,43 @@ END (test_and_set_16) /* ifunc implementations: Carries run-time dependence on the presence of further architectural extensions. */ +ENTRY_FEAT (load_16, LRCPC3) + cbnz w1, 1f + + /* RELAXED. */ + ldp res0, res1, [x0] + ret +1: + cmp w1, SEQ_CST + b.eq 2f + + /* ACQUIRE/CONSUME (Load-AcquirePC semantics). */ + /* ldiapp res0, res1, [x0] */ + .inst 0xd9411800 + ret + + /* SEQ_CST. */ +2: ldar tmp0, [x0] /* Block reordering with Store-Release instr. */ + /* ldiapp res0, res1, [x0] */ + .inst 0xd9411800 + ret +END_FEAT (load_16, LRCPC3) + + +ENTRY_FEAT (store_16, LRCPC3) + cbnz w4, 1f + + /* RELAXED. */ + stp in0, in1, [x0] + ret + + /* RELEASE/SEQ_CST. */ +1: /* stilp in0, in1, [x0] */ + .inst 0xd9031802 + ret +END_FEAT (store_16, LRCPC3) + + ENTRY_FEAT (exchange_16, LSE128) mov tmp0, x0 mov res0, in0 diff --git a/libatomic/config/linux/aarch64/host-config.h b/libatomic/config/linux/aarch64/host-config.h index d05e9eb628f..8adf0563001 100644 --- a/libatomic/config/linux/aarch64/host-config.h +++ b/libatomic/config/linux/aarch64/host-config.h @@ -33,6 +33,9 @@ #ifndef HWCAP_USCAT # define HWCAP_USCAT (1 << 25) #endif +#ifndef HWCAP2_LRCPC3 +# define HWCAP2_LRCPC3 (1UL << 46) +#endif #ifndef HWCAP2_LSE128 # define HWCAP2_LSE128 (1UL << 47) #endif @@ -54,7 +57,7 @@ typedef struct __ifunc_arg_t { #if defined (LAT_CAS_N) # define LSE_ATOP #elif defined (LAT_LOAD_N) || defined (LAT_STORE_N) -# define LSE2_ATOP +# define LSE2_LRCPC3_ATOP #elif defined (LAT_EXCH_N) || defined (LAT_FIOR_N) || defined (LAT_FAND_N) # define LSE128_ATOP #endif @@ -63,9 +66,10 @@ typedef struct __ifunc_arg_t { # if defined (LSE_ATOP) # define IFUNC_NCOND(N) 1 # define IFUNC_COND_1 (hwcap & HWCAP_ATOMICS) -# elif defined (LSE2_ATOP) -# define IFUNC_NCOND(N) 1 -# define IFUNC_COND_1 (has_lse2 (hwcap, features)) +# elif defined (LSE2_LRCPC3_ATOP) +# define IFUNC_NCOND(N) 2 +# define IFUNC_COND_1 (has_rcpc3 (hwcap, features)) +# define IFUNC_COND_2 (has_lse2 (hwcap, features)) # elif defined (LSE128_ATOP) # define IFUNC_NCOND(N) 1 # define IFUNC_COND_1 (has_lse128 (hwcap, features)) @@ -131,6 +135,28 @@ has_lse128 (unsigned long hwcap, const __ifunc_arg_t *features) return false; } +/* LRCPC atomic support encoded in ID_AA64ISAR1_EL1.Atomic, bits[23:20]. The + expected value is 0b0011. Check that. */ + +static inline bool +has_rcpc3 (unsigned long hwcap, const __ifunc_arg_t *features) +{ + if (hwcap & _IFUNC_ARG_HWCAP + && features->_hwcap2 & HWCAP2_LRCPC3) + return true; + /* Try fallback feature check method to guarantee LRCPC3 is not implemented. + + In the absence of HWCAP_CPUID, we are unable to check for RCPC3, return. + If feature check available, check LSE2 prerequisite before proceeding. */ + if (!(hwcap & HWCAP_CPUID) || !(hwcap & HWCAP_USCAT)) + return false; + unsigned long isar1; + asm volatile ("mrs %0, ID_AA64ISAR1_EL1" : "=r" (isar1)); + if (AT_FEAT_FIELD (isar1) >= 3) + return true; + return false; +} + #endif /* HAVE_IFUNC */ /* All 128-bit atomic functions are defined in aarch64/atomic_16.S. */