From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50079.outbound.protection.outlook.com [40.107.5.79]) by sourceware.org (Postfix) with ESMTPS id B636B38582BD for ; Thu, 28 Jul 2022 14:30:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B636B38582BD ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=XIZEGrAcIvhJ8xcCLG/hKOYwir/O8c6CrXxFQAOs8uVYqNX1QUB325SNszAVWzFW+exPS29jLlEM83CfeOqWwfLNpOk3B0jZGYHuXnWpIvZZ3tseTphez5waZzSnf3aqtmdHTO/EqWN5QNt/aE559rHIRYaxWfu8Z6Mu4iyHG8h8MhJRnvshlV9p4zgWJcLXfpes/Ncm43gCNKmVZR+yj8OvRBKCD1Js1H0CayD4pO0UR6FCvjtF+ll2/nCoEcVjcoQuni56fEs3+4+GURafNG/E05jHdq94d/fBOd5SA4zfAl62lhxbt/tuG4+7CqcEQxG1/kZXIgXM7iVZ5ZM6UQ== 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=Sbj2Oq/dYqKWxCA50ToygLYZywgURx2jdZ1qU5m0Nhc=; b=hYCVW5DfHHzf93NDQPgOY4snU+J0S8C4Gb0ogSFd0DHdBSEILViV3I3rrnMt3hAHYlh9XJ5/GKbL2QciZx84h/C+AUQyH8IQaq7OPF89llyhjByRDSmgTsl9xIPqbmH1fvNlnKR2Ln0BhWvqLoVIEQjc0tmH+vcRb1RBT6gPq8mSU11OYu8CGShkb6cynCWEfAXB5rG9w+XAuTHtK8LV0ojZypkNn9IB3godya5uYKj1JtWOGqxFh5uXoA6Lia2IOIAFl3ccGKJFRRjt6Tuntp1obNqFBFTgG3Mr/IwKHY3F3dpDjhkv5EVwOPDvQVzXEo6nWVgLPCViTKzheYpSrQ== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=sourceware.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 AM4PR0501CA0048.eurprd05.prod.outlook.com (2603:10a6:200:68::16) by VE1PR08MB4672.eurprd08.prod.outlook.com (2603:10a6:802:a3::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.19; Thu, 28 Jul 2022 14:30:42 +0000 Received: from VE1EUR03FT063.eop-EUR03.prod.protection.outlook.com (2603:10a6:200:68:cafe::9f) by AM4PR0501CA0048.outlook.office365.com (2603:10a6:200:68::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.11 via Frontend Transport; Thu, 28 Jul 2022 14:30:41 +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 VE1EUR03FT063.mail.protection.outlook.com (10.152.18.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.12 via Frontend Transport; Thu, 28 Jul 2022 14:30:41 +0000 Received: ("Tessian outbound fccf984e7173:v123"); Thu, 28 Jul 2022 14:30:41 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 52639f9eb8ac6df7 X-CR-MTA-TID: 64aa7808 Received: from 9e94d7da8cfc.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 5FEEED72-F140-4837-94E5-5F747DB8AE69.1; Thu, 28 Jul 2022 14:30:34 +0000 Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 9e94d7da8cfc.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 28 Jul 2022 14:30:34 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SJxQzGPip7US3T23+FlhnJ3u3yyOlZL74biQ1k8AQPRjnJx0lbxoIaABe5OEZ53uj2vxXZtN/ff/hh9TgBozn2IqxOOrbVpfvVbxkNgoHW5LxjT7X1fcOfwCZPEC8tAItkOn6FkM996+XwD6DBMwjyW7kSSYcQaU4CdWYTaAd6uQunRLBEgtNfIQC1n4yryWTKzVnah+9+advm6MpE3zyWiq5uzvIP9ix8AqlrNKbpl872/aAbPRD0/U4tiIcM/GLhfVL2iVLkHwTc59IuTw/1PAMVbebIr10z/6GXIkfI4ipYZdPIbU/F0vYKZz6DAIUgxvPU3hgIPkWlFj9qGsrA== 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=Sbj2Oq/dYqKWxCA50ToygLYZywgURx2jdZ1qU5m0Nhc=; b=dgXcqNBX149+PJLqjf7lhe7jf9r3r/HP5nF6P3Lwj4S4EbU1J367cFZgEwirRbJXuCEBlSVrHA/upwqUt3+OO4JxbRWUgcgiMTKVh0K5DW4T4WHvJ+VygZsG6wnqIiLOksv0QxJOcJi9x8n+hKo/TUUuW5TduI9ohcvonF6RbMYg/jshP7VNJ5Sztw1j6zc6CULign7413+sCeav9InQOPsVRfGT3vamhz+o98FqcahCQEneUZ24GtHaPbYB4W88wJGIHbDvwJS+flEg2VrOnh4lYFUu4INdV3QyPetkr5c4YpgWP6mDIFKaNzOyYmjJLXpn/nN2vzyzY5Jb09IBVw== 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 AM5PR0801MB1668.eurprd08.prod.outlook.com (2603:10a6:203:3c::14) by DB6PR08MB2631.eurprd08.prod.outlook.com (2603:10a6:6:23::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.10; Thu, 28 Jul 2022 14:30:31 +0000 Received: from AM5PR0801MB1668.eurprd08.prod.outlook.com ([fe80::845f:5b9c:410a:f581]) by AM5PR0801MB1668.eurprd08.prod.outlook.com ([fe80::845f:5b9c:410a:f581%5]) with mapi id 15.20.5482.011; Thu, 28 Jul 2022 14:30:31 +0000 From: Wilco Dijkstra To: 'GNU C Library' Subject: [PATCH] Remove atomic-machine headers Thread-Topic: [PATCH] Remove atomic-machine headers Thread-Index: AQHYoo5VF3NgiY3ysUGfaI8wv0QDOg== Date: Thu, 28 Jul 2022 14:30:30 +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: 2d5cc217-d576-4092-17a0-08da70a5bfe6 x-ms-traffictypediagnostic: DB6PR08MB2631:EE_|VE1EUR03FT063:EE_|VE1PR08MB4672:EE_ 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: 3ngX3tuQWh4nR1Pb+tBMRDGR/TLYG2+wfchmdHuIdIDALgKr/o4MyX9913umdFW7baS/p4xhoinULYTXrXu0zENel0+uKu2IYCf5ZMLoqiCOQQiMEh0lyznOFZ32ufxqk1P/aWRgEt/xei8oxWdVlmiScNMttMXfLHIBNbkWdrhzKzY9BqTZ0bpT90Dbfp7vm0DMopqBqHjGA6LFK62PADGbb9z+OQTD9Cl5bJMGdDHWIrUIoDv441grFXT1fICm8XoGYOyuAkNjMShGWQP4CyFiWTKO/Aci5o8Ha5ts3n93MyG8Ev5ka0Nge3fFaTTR8QWE/HHr0xOB5fAV0nH3y/iFk/tWqk34bUbpA4gCscvzzagk+XOtdIrD2JeqTAJgmrbmbB9Lo+6MaH7Y/7IuZ4kdkFe1w1cGu/IMH11VmI0Vksf6i8cEHkKMLRB+3+irXtSEWHI1Rk23F+WoPmJGPrcv8ZWupwliBj8Us2HIne/J8Phkr5wKWaTjNPj6TuLIocnBOCdGsqBfxSniT9Qt2Lo0+IAmFlGfj0PzrxilDChPU+CpMjbXVgwoZ8F4a+KvoHgN0oCKkT3bzU9N+2NLdI4361+OzA0BKt3aE3ahlaip0BFt7skSPn5CqTYTaXJnkKo6zlW+vdZt+LgD61xKLVUCA4xSOudXMH7EiqbJ9k51w1v5KrtsGhiiC0p6PhSLOLw/mYYIINKJPLOzA76lGcWX1a8dHxlaNRY+SkLJvz54EM/7m0M/8xKG+o+l3aDootIarC4OJZwmTy/U8YuWGXmQtxzG+rTmFG6hUSEHAToQVrhHyoadlXZ1JVzHqGijTxe2bxmJkKlpWoy8CB87hrobuNjtZidGULnV61KaNM0gl/HqIWwmx4rWBDFL/pEn X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM5PR0801MB1668.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(4636009)(366004)(39860400002)(396003)(136003)(346002)(376002)(122000001)(316002)(71200400001)(86362001)(38100700002)(33656002)(41300700001)(186003)(26005)(6506007)(7696005)(6916009)(478600001)(9686003)(30864003)(66446008)(8676002)(2906002)(55016003)(5660300002)(52536014)(66476007)(64756008)(76116006)(66946007)(91956017)(66556008)(8936002)(83380400001)(38070700005)(21314003)(2004002)(579004)(559001); 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: DB6PR08MB2631 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: VE1EUR03FT063.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 3eb75ca8-feb1-4fa1-e0f1-08da70a5b972 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 50m3wuTbv61P69nQ8czWmR6FgChe8BqvlbDAHZmk6MfDgF5pITSUQCqbEFtH64oqYBCb9S/qdh3DbsWv45cKC4Q8cbijGwD/tSG87Ls6m7G95e3tplEZSYqOsTixXCdzd84RzeS7IMBBl4agZT7Ka0bDjRBrWKORTjqxCHM3TXEeYZcBTHYTGKKYPGfYar7rFxl9uAeVDnwAb11pV/7z2ANWWheXLvE8QFyL5KA6heUA2r0FUSAY3sx4NnJ7T7Y59KLJoV0qVidSrUcx2bjzlE4S5kTNjSSE6tA4CmZrdfYqd+Y1ELOiC2CKQoY4uO1HfrIMv7C9s3KITIl3wk1ijo17/sXJLN3Pt6q2qOK83DqFumFAHdgYBoqsqiOnuApaUppb9YvXolqB3rWGwA+mI1IDNxVagSBVHvekw42QLgBL7ygRhPcDgOAsIlUrJmj0U3Zb6gBtcg1a+alXkG5VZo3qAw7iKtoZhIBVcnhxOU2yRoJT775NhoGr+12mqZ3yGm58E6GXv2B/Ce8kdO4mMNGMA26+OgV7W8tkepCHyKKPoBM7RzGykXOUPaoq+6p23bjBt2EPjA85qrE2TQ3rmWo2/wHs5UKdB1oV+fPjlOR84dasOILBq5qRDfWaWIdLlW86PypFh0e9d/GiWKcQ08yMuBjHV46ZjtWe+RcLY9XfK/LoPdFXmDP516uEpnT8UXZPKpDH8DSuh1UakB/9ReEnqQmN2Lw4M2u8qIkRAJa9I7JSaT9iDCTmaqG+WpR7EjEm8MTwnrdZ7UMbSCF2lcUpommKwueWex7yGZLnmOwLbpMH3gizSb68EL6malGcQ//CTip4GgrxX/jwxT0wGVnr4YBalP0AxF3cP9fqG5fd0KkWMgg4u1ao9M2hJOJf 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:(13230016)(4636009)(136003)(396003)(346002)(376002)(39860400002)(36840700001)(40470700004)(46966006)(40480700001)(82310400005)(52536014)(55016003)(2906002)(8936002)(30864003)(5660300002)(70586007)(6916009)(33656002)(70206006)(8676002)(86362001)(7696005)(26005)(9686003)(6506007)(316002)(186003)(478600001)(41300700001)(47076005)(356005)(40460700003)(336012)(81166007)(36860700001)(82740400003)(83380400001)(2004002)(21314003); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2022 14:30:41.5757 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2d5cc217-d576-4092-17a0-08da70a5bfe6 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: VE1EUR03FT063.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB4672 X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_NONE, KAM_LOTSOFHASH, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP, 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: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2022 14:30:55 -0000 Remove the last few unnecessary defines from all the atomic-machine headers= so almost=0A= all can be removed. Set __HAVE_64B_ATOMICS as part of configure - this is n= ot only=0A= simpler but also more correct since it depends on the compiler and settings= . Note that=0A= __atomic_always_lock_free is quite buggy, but the expression used works cor= rectly,=0A= including on LLVM. Remove the odd ATOMIC_EXCHANGE_USES_CAS as it is only us= ed once and=0A= set incorrectly by many targets.=0A= =0A= Passes regress on AArch64 and buildmanyglibc.=0A= =0A= ---=0A= =0A= diff --git a/config.h.in b/config.h.in=0A= index bf316439a03ed23091b6bee6dea25ed61d0b8d0f..83b5a3a4bda77da0a8f582a52db= 78b0bea1725a9 100644=0A= --- a/config.h.in=0A= +++ b/config.h.in=0A= @@ -286,4 +286,7 @@=0A= /* Define if -mmovbe is enabled by default on x86. */=0A= #undef HAVE_X86_MOVBE=0A= =0A= +/* Set to 1 if 64 bit atomics are supported. */=0A= +#define __HAVE_64B_ATOMICS 0=0A= +=0A= #endif=0A= diff --git a/configure b/configure=0A= index ff2c406b3b573484c843742d292fc2e0ee0e3008..3efdf45f99af71a482509f559d9= de90aa294700c 100755=0A= --- a/configure=0A= +++ b/configure=0A= @@ -727,6 +727,7 @@ infodir=0A= docdir=0A= oldincludedir=0A= includedir=0A= +runstatedir=0A= localstatedir=0A= sharedstatedir=0A= sysconfdir=0A= @@ -841,6 +842,7 @@ datadir=3D'${datarootdir}'=0A= sysconfdir=3D'${prefix}/etc'=0A= sharedstatedir=3D'${prefix}/com'=0A= localstatedir=3D'${prefix}/var'=0A= +runstatedir=3D'${localstatedir}/run'=0A= includedir=3D'${prefix}/include'=0A= oldincludedir=3D'/usr/include'=0A= docdir=3D'${datarootdir}/doc/${PACKAGE_TARNAME}'=0A= @@ -1093,6 +1095,15 @@ do=0A= | -silent | --silent | --silen | --sile | --sil)=0A= silent=3Dyes ;;=0A= =0A= + -runstatedir | --runstatedir | --runstatedi | --runstated \=0A= + | --runstate | --runstat | --runsta | --runst | --runs \=0A= + | --run | --ru | --r)=0A= + ac_prev=3Drunstatedir ;;=0A= + -runstatedir=3D* | --runstatedir=3D* | --runstatedi=3D* | --runstated=3D= * \=0A= + | --runstate=3D* | --runstat=3D* | --runsta=3D* | --runst=3D* | --runs= =3D* \=0A= + | --run=3D* | --ru=3D* | --r=3D*)=0A= + runstatedir=3D$ac_optarg ;;=0A= +=0A= -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)=0A= ac_prev=3Dsbindir ;;=0A= -sbindir=3D* | --sbindir=3D* | --sbindi=3D* | --sbind=3D* | --sbin=3D* \= =0A= @@ -1230,7 +1241,7 @@ fi=0A= for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \= =0A= datadir sysconfdir sharedstatedir localstatedir includedir \=0A= oldincludedir docdir infodir htmldir dvidir pdfdir psdir \=0A= - libdir localedir mandir=0A= + libdir localedir mandir runstatedir=0A= do=0A= eval ac_val=3D\$$ac_var=0A= # Remove trailing slashes.=0A= @@ -1383,6 +1394,7 @@ Fine tuning of the installation directories:=0A= --sysconfdir=3DDIR read-only single-machine data [PREFIX/etc]=0A= --sharedstatedir=3DDIR modifiable architecture-independent data [PREF= IX/com]=0A= --localstatedir=3DDIR modifiable single-machine data [PREFIX/var]=0A= + --runstatedir=3DDIR modifiable per-process data [LOCALSTATEDIR/run= ]=0A= --libdir=3DDIR object code libraries [EPREFIX/lib]=0A= --includedir=3DDIR C header files [PREFIX/include]=0A= --oldincludedir=3DDIR C header files for non-gcc [/usr/include]=0A= @@ -6316,6 +6328,44 @@ if test "$libc_cv_gcc_builtin_memset" =3D yes ; then= =0A= =0A= fi=0A= =0A= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit atomic suppor= t" >&5=0A= +$as_echo_n "checking for 64-bit atomic support... " >&6; }=0A= +if ${libc_cv_gcc_has_64b_atomics+:} false; then :=0A= + $as_echo_n "(cached) " >&6=0A= +else=0A= + cat > conftest.c <<\EOF=0A= +typedef struct { long long t; } X;=0A= +extern void has_64b_atomics(void);=0A= +void f(void)=0A= +{=0A= + X x;=0A= + /* Use address of structure with 64-bit type. This avoids incorrect=0A= + implementations which return true even if long long is not 64-bit ali= gned.=0A= + This works on GCC and LLVM - other cases have bugs and they disagree.= */=0A= + if (__atomic_always_lock_free (sizeof (x), &x))=0A= + has_64b_atomics();=0A= +}=0A= +EOF=0A= +if { ac_try=3D'${CC-cc} -O3 -S conftest.c -o - | grep -F "has_64b_atomics"= > /dev/null'=0A= + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5=0A= + (eval $ac_try) 2>&5=0A= + ac_status=3D$?=0A= + $as_echo "$as_me:${as_lineno-$LINENO}: \$? =3D $ac_status" >&5=0A= + test $ac_status =3D 0; }; };=0A= +then=0A= + libc_cv_gcc_has_64b_atomics=3Dyes=0A= +else=0A= + libc_cv_gcc_has_64b_atomics=3Dno=0A= +fi=0A= +rm -f conftest*=0A= +fi=0A= +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_gcc_has_64b_atom= ics" >&5=0A= +$as_echo "$libc_cv_gcc_has_64b_atomics" >&6; }=0A= +if test "$libc_cv_gcc_has_64b_atomics" =3D yes; then=0A= + $as_echo "#define __HAVE_64B_ATOMICS 1" >>confdefs.h=0A= +=0A= +fi=0A= +=0A= { $as_echo "$as_me:${as_lineno-$LINENO}: checking for redirection of built= -in functions" >&5=0A= $as_echo_n "checking for redirection of built-in functions... " >&6; }=0A= if ${libc_cv_gcc_builtin_redirection+:} false; then :=0A= diff --git a/configure.ac b/configure.ac=0A= index eb5bc6a1313acb3f3614645739adeb7638f19617..9e02b82d5215a05ac9ac0aea62d= a33efddab40f4 100644=0A= --- a/configure.ac=0A= +++ b/configure.ac=0A= @@ -1443,6 +1443,32 @@ if test "$libc_cv_gcc_builtin_memset" =3D yes ; then= =0A= AC_DEFINE(HAVE_BUILTIN_MEMSET)=0A= fi=0A= =0A= +AC_CACHE_CHECK(for 64-bit atomic support, libc_cv_gcc_has_64b_atomics, [dn= l=0A= +cat > conftest.c <<\EOF=0A= +typedef struct { long long t; } X;=0A= +extern void has_64b_atomics(void);=0A= +void f(void)=0A= +{=0A= + X x;=0A= + /* Use address of structure with 64-bit type. This avoids incorrect=0A= + implementations which return true even if long long is not 64-bit ali= gned.=0A= + This works on GCC and LLVM - other cases have bugs and they disagree.= */=0A= + if (__atomic_always_lock_free (sizeof (x), &x))=0A= + has_64b_atomics();=0A= +}=0A= +EOF=0A= +dnl=0A= +if AC_TRY_COMMAND([${CC-cc} -O3 -S conftest.c -o - | grep -F "has_64b_atom= ics" > /dev/null]);=0A= +then=0A= + libc_cv_gcc_has_64b_atomics=3Dyes=0A= +else=0A= + libc_cv_gcc_has_64b_atomics=3Dno=0A= +fi=0A= +rm -f conftest* ])=0A= +if test "$libc_cv_gcc_has_64b_atomics" =3D yes; then=0A= + AC_DEFINE(__HAVE_64B_ATOMICS, 1)=0A= +fi=0A= +=0A= AC_CACHE_CHECK(for redirection of built-in functions, libc_cv_gcc_builtin_= redirection, [dnl=0A= cat > conftest.c <<\EOF=0A= extern char *strstr (const char *, const char *) __asm ("my_strstr");=0A= diff --git a/include/atomic.h b/include/atomic.h=0A= index e9ec063228b5aeeccb4c5d14d7c894f00617eefb..48cc222e0325bfdbbfb64b4100e= 7d3c03f47dc05 100644=0A= --- a/include/atomic.h=0A= +++ b/include/atomic.h=0A= @@ -27,11 +27,6 @@=0A= - support functions like barriers. They also have the prefix=0A= "atomic_".=0A= =0A= - Architectures must provide a few lowlevel macros (the compare=0A= - and exchange definitions). All others are optional. They=0A= - should only be provided if the architecture has specific=0A= - support for the operation.=0A= -=0A= As macros are usually heavily nested and often use local=0A= variables to make sure side-effects are evaluated properly, use for=0A= macro local variables a per-macro unique prefix. This file uses=0A= @@ -74,43 +69,18 @@=0A= __atg11_oldval; })=0A= #endif=0A= =0A= -=0A= -/* This is equal to 1 iff the architecture supports 64b atomic operations.= */=0A= -#ifndef __HAVE_64B_ATOMICS=0A= -#error Unable to determine if 64-bit atomics are present.=0A= -#endif=0A= -=0A= /* The following functions are a subset of the atomic operations provided = by=0A= C11. Usually, a function named atomic_OP_MO(args) is equivalent to C11= 's=0A= atomic_OP_explicit(args, memory_order_MO); exceptions noted below. */= =0A= =0A= -=0A= -/* We require 32b atomic operations; some archs also support 64b atomic=0A= - operations. */=0A= +/* Check atomic operations are lock free. Since this doesn't work correct= ly=0A= + on all targets (eg. if uint64_t is 4-byte aligned), use__HAVE_64B_ATOMI= CS=0A= + for 64-bit types. */=0A= void __atomic_link_error (void);=0A= -# if __HAVE_64B_ATOMICS =3D=3D 1=0A= -# define __atomic_check_size(mem) \=0A= - if ((sizeof (*mem) !=3D 4) && (sizeof (*mem) !=3D 8)) \=0A= - __atomic_link_error ();=0A= -# else=0A= -# define __atomic_check_size(mem) \=0A= - if (sizeof (*mem) !=3D 4) \=0A= - __atomic_link_error ();=0A= -# endif=0A= -/* We additionally provide 8b and 16b atomic loads and stores; we do not y= et=0A= - need other atomic operations of such sizes, and restricting the support= to=0A= - loads and stores makes this easier for archs that do not have native=0A= - support for atomic operations to less-than-word-sized data. */=0A= -# if __HAVE_64B_ATOMICS =3D=3D 1=0A= -# define __atomic_check_size_ls(mem) \=0A= - if ((sizeof (*mem) !=3D 1) && (sizeof (*mem) !=3D 2) && (sizeof (*mem) = !=3D 4) \=0A= - && (sizeof (*mem) !=3D 8)) \=0A= - __atomic_link_error ();=0A= -# else=0A= -# define __atomic_check_size_ls(mem) \=0A= - if ((sizeof (*mem) !=3D 1) && (sizeof (*mem) !=3D 2) && sizeof (*mem) != =3D 4) \=0A= - __atomic_link_error ();=0A= -# endif=0A= +#define __atomic_check_size(mem) \=0A= + if (!__atomic_always_lock_free (sizeof (*(mem)), 0) || \=0A= + (sizeof (*(mem)) =3D=3D 8 && __HAVE_64B_ATOMICS =3D=3D 0)) \= =0A= + __atomic_link_error ();=0A= =0A= # define atomic_thread_fence_acquire() \=0A= __atomic_thread_fence (__ATOMIC_ACQUIRE)=0A= @@ -120,20 +90,20 @@ void __atomic_link_error (void);=0A= __atomic_thread_fence (__ATOMIC_SEQ_CST)=0A= =0A= # define atomic_load_relaxed(mem) \=0A= - ({ __atomic_check_size_ls((mem)); \=0A= + ({ __atomic_check_size ((mem)); \=0A= __atomic_load_n ((mem), __ATOMIC_RELAXED); })=0A= # define atomic_load_acquire(mem) \=0A= - ({ __atomic_check_size_ls((mem)); \=0A= + ({ __atomic_check_size ((mem)); \=0A= __atomic_load_n ((mem), __ATOMIC_ACQUIRE); })=0A= =0A= # define atomic_store_relaxed(mem, val) \=0A= do { \=0A= - __atomic_check_size_ls((mem)); \=0A= + __atomic_check_size ((mem)); \=0A= __atomic_store_n ((mem), (val), __ATOMIC_RELAXED); \=0A= } while (0)=0A= # define atomic_store_release(mem, val) \=0A= do { \=0A= - __atomic_check_size_ls((mem)); \=0A= + __atomic_check_size ((mem)); \=0A= __atomic_store_n ((mem), (val), __ATOMIC_RELEASE); \=0A= } while (0)=0A= =0A= @@ -218,12 +188,4 @@ void __atomic_link_error (void);=0A= # define atomic_spin_nop() do { /* nothing */ } while (0)=0A= #endif=0A= =0A= -/* ATOMIC_EXCHANGE_USES_CAS is non-zero if atomic_exchange operations=0A= - are implemented based on a CAS loop; otherwise, this is zero and we ass= ume=0A= - that the atomic_exchange operations could provide better performance=0A= - than a CAS loop. */=0A= -#ifndef ATOMIC_EXCHANGE_USES_CAS=0A= -# error ATOMIC_EXCHANGE_USES_CAS has to be defined.=0A= -#endif=0A= -=0A= #endif /* atomic.h */=0A= diff --git a/nptl/pthread_spin_lock.c b/nptl/pthread_spin_lock.c=0A= index 19d1759f9aa350d5a711ac8abe6f9db1464a1012..9122a260303a4356d7ee68274f0= 4b542090de380 100644=0A= --- a/nptl/pthread_spin_lock.c=0A= +++ b/nptl/pthread_spin_lock.c=0A= @@ -26,29 +26,12 @@ __pthread_spin_lock (pthread_spinlock_t *lock)=0A= int val =3D 0;=0A= =0A= /* We assume that the first try mostly will be successful, thus we use= =0A= - atomic_exchange if it is not implemented by a CAS loop (we also assum= e=0A= - that atomic_exchange can be faster if it succeeds, see=0A= - ATOMIC_EXCHANGE_USES_CAS). Otherwise, we use a weak CAS and not an= =0A= - exchange so we bail out after the first failed attempt to change the= =0A= - state. For the subsequent attempts we use atomic_compare_and_exchang= e=0A= - after we observe that the lock is not acquired.=0A= - See also comment in pthread_spin_trylock.=0A= + atomic_exchange.=0A= We use acquire MO to synchronize-with the release MO store in=0A= pthread_spin_unlock, and thus ensure that prior critical sections=0A= happen-before this critical section. */=0A= -#if ! ATOMIC_EXCHANGE_USES_CAS=0A= - /* Try to acquire the lock with an exchange instruction as this architec= ture=0A= - has such an instruction and we assume it is faster than a CAS.=0A= - The acquisition succeeds if the lock is not in an acquired state. */= =0A= if (__glibc_likely (atomic_exchange_acquire (lock, 1) =3D=3D 0))=0A= return 0;=0A= -#else=0A= - /* Try to acquire the lock with a CAS instruction as this architecture= =0A= - has no exchange instruction. The acquisition succeeds if the lock is= not=0A= - acquired. */=0A= - if (__glibc_likely (atomic_compare_exchange_weak_acquire (lock, &val, 1)= ))=0A= - return 0;=0A= -#endif=0A= =0A= do=0A= {=0A= diff --git a/nptl/pthread_spin_trylock.c b/nptl/pthread_spin_trylock.c=0A= index f2b12f9b4fe34340c9a2e449f2652908a7ff469d..3bd870401cdb336fe05469c3944= b82fa563869be 100644=0A= --- a/nptl/pthread_spin_trylock.c=0A= +++ b/nptl/pthread_spin_trylock.c=0A= @@ -24,57 +24,8 @@=0A= int=0A= __pthread_spin_trylock (pthread_spinlock_t *lock)=0A= {=0A= - /* For the spin try lock, we have the following possibilities:=0A= -=0A= - 1) If we assume that trylock will most likely succeed in practice:=0A= - * We just do an exchange.=0A= -=0A= - 2) If we want to bias towards cases where trylock succeeds, but don't= =0A= - rule out contention:=0A= - * If exchange is not implemented by a CAS loop, and exchange is faste= r=0A= - than CAS, do an exchange.=0A= - * If exchange is implemented by a CAS loop, use a weak CAS and not an= =0A= - exchange so we bail out after the first failed attempt to change the = state.=0A= -=0A= - 3) If we expect contention to be likely:=0A= - * If CAS always brings the cache line into an exclusive state even if= the=0A= - spinlock is already acquired, then load the value first with=0A= - atomic_load_relaxed and test if lock is not acquired. Then do 2).=0A= -=0A= - We assume that 2) is the common case, and that this won't be slower t= han=0A= - 1) in the common case.=0A= -=0A= - We use acquire MO to synchronize-with the release MO store in=0A= - pthread_spin_unlock, and thus ensure that prior critical sections=0A= - happen-before this critical section. */=0A= -#if ! ATOMIC_EXCHANGE_USES_CAS=0A= - /* Try to acquire the lock with an exchange instruction as this architec= ture=0A= - has such an instruction and we assume it is faster than a CAS.=0A= - The acquisition succeeds if the lock is not in an acquired state. */= =0A= if (atomic_exchange_acquire (lock, 1) =3D=3D 0)=0A= return 0;=0A= -#else=0A= - /* Try to acquire the lock with a CAS instruction as this architecture= =0A= - has no exchange instruction. The acquisition succeeds if the lock is= not=0A= - acquired. */=0A= - do=0A= - {=0A= - int val =3D 0;=0A= - if (atomic_compare_exchange_weak_acquire (lock, &val, 1))=0A= - return 0;=0A= - }=0A= - /* atomic_compare_exchange_weak_acquire can fail spuriously. Whereas=0A= - C++11 and C11 make it clear that trylock operations can fail spurious= ly,=0A= - POSIX does not explicitly specify this; it only specifies that failin= g=0A= - synchronization operations do not need to have synchronization effect= s=0A= - themselves, but a spurious failure is something that could contradict= a=0A= - happens-before established earlier (e.g., that we need to observe tha= t=0A= - the lock is acquired). Therefore, we emulate a strong CAS by simply= =0A= - checking with a relaxed MO load that the lock is really acquired befo= re=0A= - returning EBUSY; the additional overhead this may cause is on the slo= w=0A= - path. */=0A= - while (atomic_load_relaxed (lock) =3D=3D 0);=0A= -#endif=0A= =0A= return EBUSY;=0A= }=0A= diff --git a/sysdeps/aarch64/atomic-machine.h b/sysdeps/aarch64/atomic-mach= ine.h=0A= deleted file mode 100644=0A= index 2dc1c524e40e2e805161e6d9b1b385b85c53a5c8..000000000000000000000000000= 0000000000000=0A= --- a/sysdeps/aarch64/atomic-machine.h=0A= +++ /dev/null=0A= @@ -1,25 +0,0 @@=0A= -/* Copyright (C) 2003-2022 Free Software Foundation, Inc.=0A= -=0A= - This file is part of the GNU C Library.=0A= -=0A= - The GNU C Library is free software; you can redistribute it and/or=0A= - modify it under the terms of the GNU Lesser General Public=0A= - License as published by the Free Software Foundation; either=0A= - version 2.1 of the License, or (at your option) any later version.=0A= -=0A= - The GNU C Library is distributed in the hope that it will be useful,=0A= - but WITHOUT ANY WARRANTY; without even the implied warranty of=0A= - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU=0A= - Lesser General Public License for more details.=0A= -=0A= - You should have received a copy of the GNU Lesser General Public=0A= - License along with the GNU C Library. If not, see=0A= - . */=0A= -=0A= -#ifndef _AARCH64_ATOMIC_MACHINE_H=0A= -#define _AARCH64_ATOMIC_MACHINE_H 1=0A= -=0A= -#define __HAVE_64B_ATOMICS 1=0A= -#define ATOMIC_EXCHANGE_USES_CAS 0=0A= -=0A= -#endif=0A= diff --git a/sysdeps/alpha/atomic-machine.h b/sysdeps/alpha/atomic-machine.= h=0A= deleted file mode 100644=0A= index 7fbe5b87eebf323d38fe1349b02aa56fe199cab3..000000000000000000000000000= 0000000000000=0A= --- a/sysdeps/alpha/atomic-machine.h=0A= +++ /dev/null=0A= @@ -1,23 +0,0 @@=0A= -/* Copyright (C) 2003-2022 Free Software Foundation, Inc.=0A= - This file is part of the GNU C Library.=0A= -=0A= - The GNU C Library is free software; you can redistribute it and/or=0A= - modify it under the terms of the GNU Lesser General Public=0A= - License as published by the Free Software Foundation; either=0A= - version 2.1 of the License, or (at your option) any later version.=0A= -=0A= - The GNU C Library is distributed in the hope that it will be useful,=0A= - but WITHOUT ANY WARRANTY; without even the implied warranty of=0A= - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU=0A= - Lesser General Public License for more details.=0A= -=0A= - You should have received a copy of the GNU Lesser General Public=0A= - License along with the GNU C Library. If not, see=0A= - . */=0A= -=0A= -#include =0A= -=0A= -#define __HAVE_64B_ATOMICS 1=0A= -=0A= -/* XXX Is this actually correct? */=0A= -#define ATOMIC_EXCHANGE_USES_CAS 1=0A= diff --git a/sysdeps/arc/atomic-machine.h b/sysdeps/arc/atomic-machine.h=0A= deleted file mode 100644=0A= index 2d519e3bbfa9ce77f4a41e313b67a690569d032e..000000000000000000000000000= 0000000000000=0A= --- a/sysdeps/arc/atomic-machine.h=0A= +++ /dev/null=0A= @@ -1,28 +0,0 @@=0A= -/* Low-level functions for atomic operations. ARC version.=0A= - Copyright (C) 2020-2022 Free Software Foundation, Inc.=0A= - This file is part of the GNU C Library.=0A= -=0A= - The GNU C Library is free software; you can redistribute it and/or=0A= - modify it under the terms of the GNU Lesser General Public=0A= - License as published by the Free Software Foundation; either=0A= - version 2.1 of the License, or (at your option) any later version.=0A= -=0A= - The GNU C Library is distributed in the hope that it will be useful,=0A= - but WITHOUT ANY WARRANTY; without even the implied warranty of=0A= - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU=0A= - Lesser General Public License for more details.=0A= -=0A= - You should have received a copy of the GNU Lesser General Public=0A= - License along with the GNU C Library. If not, see=0A= - . */=0A= -=0A= -#ifndef _ARC_BITS_ATOMIC_H=0A= -#define _ARC_BITS_ATOMIC_H 1=0A= -=0A= -#define __HAVE_64B_ATOMICS 0=0A= -=0A= -/* ARC does have legacy atomic EX reg, [mem] instruction but the micro-arc= h=0A= - is not as optimal as LLOCK/SCOND specially for SMP. */=0A= -#define ATOMIC_EXCHANGE_USES_CAS 1=0A= -=0A= -#endif /* _ARC_BITS_ATOMIC_H */=0A= diff --git a/sysdeps/arm/atomic-machine.h b/sysdeps/arm/atomic-machine.h=0A= deleted file mode 100644=0A= index b172573ae74dc9d6c7618bfdb76f5fb0429469f8..000000000000000000000000000= 0000000000000=0A= --- a/sysdeps/arm/atomic-machine.h=0A= +++ /dev/null=0A= @@ -1,20 +0,0 @@=0A= -/* Atomic operations. Pure ARM version.=0A= - Copyright (C) 2002-2022 Free Software Foundation, Inc.=0A= - This file is part of the GNU C Library.=0A= -=0A= - The GNU C Library is free software; you can redistribute it and/or=0A= - modify it under the terms of the GNU Lesser General Public=0A= - License as published by the Free Software Foundation; either=0A= - version 2.1 of the License, or (at your option) any later version.=0A= -=0A= - The GNU C Library is distributed in the hope that it will be useful,=0A= - but WITHOUT ANY WARRANTY; without even the implied warranty of=0A= - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU=0A= - Lesser General Public License for more details.=0A= -=0A= - You should have received a copy of the GNU Lesser General Public=0A= - License along with the GNU C Library. If not, see=0A= - . */=0A= -=0A= -#define __HAVE_64B_ATOMICS 0=0A= -#define ATOMIC_EXCHANGE_USES_CAS 1=0A= diff --git a/sysdeps/csky/atomic-machine.h b/sysdeps/csky/atomic-machine.h= =0A= deleted file mode 100644=0A= index 4a7dc63be2044990852c52500943c90c898363be..000000000000000000000000000= 0000000000000=0A= --- a/sysdeps/csky/atomic-machine.h=0A= +++ /dev/null=0A= @@ -1,25 +0,0 @@=0A= -/* Atomic operations. C-SKY version.=0A= - Copyright (C) 2018-2022 Free Software Foundation, Inc.=0A= - This file is part of the GNU C Library.=0A= -=0A= - The GNU C Library is free software; you can redistribute it and/or=0A= - modify it under the terms of the GNU Lesser General Public=0A= - License as published by the Free Software Foundation; either=0A= - version 2.1 of the License, or (at your option) any later version.=0A= -=0A= - The GNU C Library is distributed in the hope that it will be useful,=0A= - but WITHOUT ANY WARRANTY; without even the implied warranty of=0A= - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU=0A= - Lesser General Public License for more details.=0A= -=0A= - You should have received a copy of the GNU Lesser General Public=0A= - License along with the GNU C Library. If not, see=0A= - . */=0A= -=0A= -#ifndef __CSKY_ATOMIC_H_=0A= -#define __CSKY_ATOMIC_H_=0A= -=0A= -#define __HAVE_64B_ATOMICS 0=0A= -#define ATOMIC_EXCHANGE_USES_CAS 1=0A= -=0A= -#endif /* atomic-machine.h */=0A= diff --git a/sysdeps/ia64/atomic-machine.h b/sysdeps/ia64/atomic-machine.h= =0A= deleted file mode 100644=0A= index 6f31c7b2eea67b5d8766dea1c38df6eedc168ebf..000000000000000000000000000= 0000000000000=0A= --- a/sysdeps/ia64/atomic-machine.h=0A= +++ /dev/null=0A= @@ -1,23 +0,0 @@=0A= -/* Copyright (C) 2003-2022 Free Software Foundation, Inc.=0A= - This file is part of the GNU C Library.=0A= -=0A= - The GNU C Library is free software; you can redistribute it and/or=0A= - modify it under the terms of the GNU Lesser General Public=0A= - License as published by the Free Software Foundation; either=0A= - version 2.1 of the License, or (at your option) any later version.=0A= -=0A= - The GNU C Library is distributed in the hope that it will be useful,=0A= - but WITHOUT ANY WARRANTY; without even the implied warranty of=0A= - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU=0A= - Lesser General Public License for more details.=0A= -=0A= - You should have received a copy of the GNU Lesser General Public=0A= - License along with the GNU C Library; if not, see=0A= - . */=0A= -=0A= -#include =0A= -=0A= -#define __HAVE_64B_ATOMICS 1=0A= -=0A= -/* XXX Is this actually correct? */=0A= -#define ATOMIC_EXCHANGE_USES_CAS 0=0A= diff --git a/sysdeps/m68k/coldfire/atomic-machine.h b/sysdeps/m68k/coldfire= /atomic-machine.h=0A= deleted file mode 100644=0A= index 1503703ed36b825f6e9f2cb2ed1516cd80bd9947..000000000000000000000000000= 0000000000000=0A= --- a/sysdeps/m68k/coldfire/atomic-machine.h=0A= +++ /dev/null=0A= @@ -1,27 +0,0 @@=0A= -/* Copyright (C) 2003-2022 Free Software Foundation, Inc.=0A= - This file is part of the GNU C Library.=0A= -=0A= - The GNU C Library is free software; you can redistribute it and/or=0A= - modify it under the terms of the GNU Lesser General Public=0A= - License as published by the Free Software Foundation; either=0A= - version 2.1 of the License, or (at your option) any later version.=0A= -=0A= - The GNU C Library is distributed in the hope that it will be useful,=0A= - but WITHOUT ANY WARRANTY; without even the implied warranty of=0A= - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU=0A= - Lesser General Public License for more details.=0A= -=0A= - You should have received a copy of the GNU Lesser General Public=0A= - License along with the GNU C Library. If not, see=0A= - . */=0A= -=0A= -#ifndef _ATOMIC_MACHINE_H=0A= -#define _ATOMIC_MACHINE_H 1=0A= -=0A= -/* If we have just non-atomic operations, we can as well make them wide. = */=0A= -#define __HAVE_64B_ATOMICS 1=0A= -=0A= -/* XXX Is this actually correct? */=0A= -#define ATOMIC_EXCHANGE_USES_CAS 1=0A= -=0A= -#endif=0A= diff --git a/sysdeps/m68k/m680x0/m68020/atomic-machine.h b/sysdeps/m68k/m68= 0x0/m68020/atomic-machine.h=0A= deleted file mode 100644=0A= index d356b55c9f9082db8dde734c254e01a631201206..000000000000000000000000000= 0000000000000=0A= --- a/sysdeps/m68k/m680x0/m68020/atomic-machine.h=0A= +++ /dev/null=0A= @@ -1,22 +0,0 @@=0A= -/* Copyright (C) 2003-2022 Free Software Foundation, Inc.=0A= - This file is part of the GNU C Library.=0A= -=0A= - The GNU C Library is free software; you can redistribute it and/or=0A= - modify it under the terms of the GNU Lesser General Public=0A= - License as published by the Free Software Foundation; either=0A= - version 2.1 of the License, or (at your option) any later version.=0A= -=0A= - The GNU C Library is distributed in the hope that it will be useful,=0A= - but WITHOUT ANY WARRANTY; without even the implied warranty of=0A= - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU=0A= - Lesser General Public License for more details.=0A= -=0A= - You should have received a copy of the GNU Lesser General Public=0A= - License along with the GNU C Library. If not, see=0A= - . */=0A= -=0A= -/* GCC does not support lock-free 64-bit atomic_load/store. */=0A= -#define __HAVE_64B_ATOMICS 0=0A= -=0A= -/* XXX Is this actually correct? */=0A= -#define ATOMIC_EXCHANGE_USES_CAS 1=0A= diff --git a/sysdeps/microblaze/atomic-machine.h b/sysdeps/microblaze/atomi= c-machine.h=0A= deleted file mode 100644=0A= index 4e7ccce21e59453f5233bdf82b22215d9a6d17b3..000000000000000000000000000= 0000000000000=0A= --- a/sysdeps/microblaze/atomic-machine.h=0A= +++ /dev/null=0A= @@ -1,24 +0,0 @@=0A= -/* Copyright (C) 2003-2022 Free Software Foundation, Inc.=0A= -=0A= - This file is part of the GNU C Library.=0A= -=0A= - The GNU C Library is free software; you can redistribute it and/or=0A= - modify it under the terms of the GNU Lesser General Public=0A= - License as published by the Free Software Foundation; either=0A= - version 2.1 of the License, or (at your option) any later version.=0A= -=0A= - The GNU C Library is distributed in the hope that it will be useful,=0A= - but WITHOUT ANY WARRANTY; without even the implied warranty of=0A= - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU=0A= - Lesser General Public License for more details.=0A= -=0A= - You should have received a copy of the GNU Lesser General Public=0A= - License along with the GNU C Library. If not, see=0A= - . */=0A= -=0A= -#include =0A= -=0A= -#define __HAVE_64B_ATOMICS 0=0A= -=0A= -/* XXX Is this actually correct? */=0A= -#define ATOMIC_EXCHANGE_USES_CAS 1=0A= diff --git a/sysdeps/mips/atomic-machine.h b/sysdeps/mips/atomic-machine.h= =0A= deleted file mode 100644=0A= index 1e611c2153996d28e14611c60189f52d0919b79c..000000000000000000000000000= 0000000000000=0A= --- a/sysdeps/mips/atomic-machine.h=0A= +++ /dev/null=0A= @@ -1,38 +0,0 @@=0A= -/* Low-level functions for atomic operations. Mips version.=0A= - Copyright (C) 2005-2022 Free Software Foundation, Inc.=0A= - This file is part of the GNU C Library.=0A= -=0A= - The GNU C Library is free software; you can redistribute it and/or=0A= - modify it under the terms of the GNU Lesser General Public=0A= - License as published by the Free Software Foundation; either=0A= - version 2.1 of the License, or (at your option) any later version.=0A= -=0A= - The GNU C Library is distributed in the hope that it will be useful,=0A= - but WITHOUT ANY WARRANTY; without even the implied warranty of=0A= - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU=0A= - Lesser General Public License for more details.=0A= -=0A= - You should have received a copy of the GNU Lesser General Public=0A= - License along with the GNU C Library. If not, see=0A= - . */=0A= -=0A= -#ifndef _MIPS_ATOMIC_MACHINE_H=0A= -#define _MIPS_ATOMIC_MACHINE_H 1=0A= -=0A= -#include =0A= -=0A= -#if _MIPS_SIM =3D=3D _ABIO32 || _MIPS_SIM =3D=3D _ABIN32=0A= -#define __HAVE_64B_ATOMICS 0=0A= -#else=0A= -#define __HAVE_64B_ATOMICS 1=0A= -#endif=0A= -=0A= -/* MIPS is an LL/SC machine. However, XLP has a direct atomic exchange=0A= - instruction which will be used by __atomic_exchange_n. */=0A= -#ifdef _MIPS_ARCH_XLP=0A= -# define ATOMIC_EXCHANGE_USES_CAS 0=0A= -#else=0A= -# define ATOMIC_EXCHANGE_USES_CAS 1=0A= -#endif=0A= -=0A= -#endif /* atomic-machine.h */=0A= diff --git a/sysdeps/or1k/atomic-machine.h b/sysdeps/or1k/atomic-machine.h= =0A= deleted file mode 100644=0A= index 90a10867b3f9cf97a0f2f521f6759a0008ef5b82..000000000000000000000000000= 0000000000000=0A= --- a/sysdeps/or1k/atomic-machine.h=0A= +++ /dev/null=0A= @@ -1,27 +0,0 @@=0A= -/* Atomic operations. OpenRISC version.=0A= - Copyright (C) 2022 Free Software Foundation, Inc.=0A= - This file is part of the GNU C Library.=0A= -=0A= - The GNU C Library is free software; you can redistribute it and/or=0A= - modify it under the terms of the GNU Lesser General Public=0A= - License as published by the Free Software Foundation; either=0A= - version 2.1 of the License, or (at your option) any later version.=0A= -=0A= - The GNU C Library is distributed in the hope that it will be useful,=0A= - but WITHOUT ANY WARRANTY; without even the implied warranty of=0A= - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU=0A= - Lesser General Public License for more details.=0A= -=0A= - You should have received a copy of the GNU Lesser General Public=0A= - License along with the GNU C Library. If not, see=0A= - . */=0A= -=0A= -#ifndef __OR1K_ATOMIC_H_=0A= -#define __OR1K_ATOMIC_H_=0A= -=0A= -#include =0A= -=0A= -#define __HAVE_64B_ATOMICS 0=0A= -#define ATOMIC_EXCHANGE_USES_CAS 1=0A= -=0A= -#endif /* atomic-machine.h */=0A= diff --git a/sysdeps/powerpc/powerpc32/atomic-machine.h b/sysdeps/powerpc/p= owerpc32/atomic-machine.h=0A= index 6a2aae8bdb34281144e6810924377a6a62857d15..5d1d1ca120530371daaf97d5d0c= 5b545b2327a78 100644=0A= --- a/sysdeps/powerpc/powerpc32/atomic-machine.h=0A= +++ b/sysdeps/powerpc/powerpc32/atomic-machine.h=0A= @@ -33,6 +33,3 @@=0A= #endif=0A= =0A= #define __ARCH_ACQ_INSTR "isync"=0A= -=0A= -#define __HAVE_64B_ATOMICS 0=0A= -#define ATOMIC_EXCHANGE_USES_CAS 1=0A= diff --git a/sysdeps/powerpc/powerpc64/atomic-machine.h b/sysdeps/powerpc/p= owerpc64/atomic-machine.h=0A= index 2932f889c5bc6d0fa49d5ad36875b50c27ad07e9..cdee4b84827bcb8455972302725= edb3fb76a744c 100644=0A= --- a/sysdeps/powerpc/powerpc64/atomic-machine.h=0A= +++ b/sysdeps/powerpc/powerpc64/atomic-machine.h=0A= @@ -33,6 +33,3 @@=0A= #endif=0A= =0A= #define __ARCH_ACQ_INSTR "isync"=0A= -=0A= -#define __HAVE_64B_ATOMICS 1=0A= -#define ATOMIC_EXCHANGE_USES_CAS 1=0A= diff --git a/sysdeps/s390/atomic-machine.h b/sysdeps/s390/atomic-machine.h= =0A= deleted file mode 100644=0A= index 3e25dcf44126001382e3b98aa2f82d29e29f1424..000000000000000000000000000= 0000000000000=0A= --- a/sysdeps/s390/atomic-machine.h=0A= +++ /dev/null=0A= @@ -1,24 +0,0 @@=0A= -/* Copyright (C) 2003-2022 Free Software Foundation, Inc.=0A= - This file is part of the GNU C Library.=0A= -=0A= - The GNU C Library is free software; you can redistribute it and/or=0A= - modify it under the terms of the GNU Lesser General Public=0A= - License as published by the Free Software Foundation; either=0A= - version 2.1 of the License, or (at your option) any later version.=0A= -=0A= - The GNU C Library is distributed in the hope that it will be useful,=0A= - but WITHOUT ANY WARRANTY; without even the implied warranty of=0A= - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU=0A= - Lesser General Public License for more details.=0A= -=0A= - You should have received a copy of the GNU Lesser General Public=0A= - License along with the GNU C Library; if not, see=0A= - . */=0A= -=0A= -#ifdef __s390x__=0A= -# define __HAVE_64B_ATOMICS 1=0A= -#else=0A= -# define __HAVE_64B_ATOMICS 0=0A= -#endif=0A= -=0A= -#define ATOMIC_EXCHANGE_USES_CAS 1=0A= diff --git a/sysdeps/sparc/atomic-machine.h b/sysdeps/sparc/atomic-machine.= h=0A= index 1f0eb0a9b1171c06dc19dc21c4fe7de94adc4bce..7ea88d598b9a36735004fe03cb5= 2e46fe4807140 100644=0A= --- a/sysdeps/sparc/atomic-machine.h=0A= +++ b/sysdeps/sparc/atomic-machine.h=0A= @@ -19,15 +19,6 @@=0A= #ifndef _ATOMIC_MACHINE_H=0A= #define _ATOMIC_MACHINE_H 1=0A= =0A= -#ifdef __arch64__=0A= -# define __HAVE_64B_ATOMICS 1=0A= -#else=0A= -# define __HAVE_64B_ATOMICS 0=0A= -#endif=0A= -=0A= -/* XXX Is this actually correct? */=0A= -#define ATOMIC_EXCHANGE_USES_CAS __HAVE_64B_ATOMICS=0A= -=0A= #ifdef __sparc_v9__=0A= =0A= extern void __cpu_relax (void);=0A= diff --git a/sysdeps/unix/sysv/linux/hppa/atomic-machine.h b/sysdeps/unix/s= ysv/linux/hppa/atomic-machine.h=0A= deleted file mode 100644=0A= index 9c9fecbefef037e3b7e8c291e722d093b811dd69..000000000000000000000000000= 0000000000000=0A= --- a/sysdeps/unix/sysv/linux/hppa/atomic-machine.h=0A= +++ /dev/null=0A= @@ -1,27 +0,0 @@=0A= -/* Copyright (C) 2003-2022 Free Software Foundation, Inc.=0A= - This file is part of the GNU C Library.=0A= -=0A= - The GNU C Library is free software; you can redistribute it and/or=0A= - modify it under the terms of the GNU Lesser General Public=0A= - License as published by the Free Software Foundation; either=0A= - version 2.1 of the License, or (at your option) any later version.=0A= -=0A= - The GNU C Library is distributed in the hope that it will be useful,=0A= - but WITHOUT ANY WARRANTY; without even the implied warranty of=0A= - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU=0A= - Lesser General Public License for more details.=0A= -=0A= - You should have received a copy of the GNU Lesser General Public=0A= - License along with the GNU C Library. If not, see=0A= - . */=0A= -=0A= -#ifndef _ATOMIC_MACHINE_H=0A= -#define _ATOMIC_MACHINE_H 1=0A= -=0A= -#define __HAVE_64B_ATOMICS 0=0A= -=0A= -/* XXX Is this actually correct? */=0A= -#define ATOMIC_EXCHANGE_USES_CAS 1=0A= -=0A= -#endif=0A= -/* _ATOMIC_MACHINE_H */=0A= diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/atomic-machine.h b/sysde= ps/unix/sysv/linux/m68k/coldfire/atomic-machine.h=0A= deleted file mode 100644=0A= index 02e54847a42bfbc93ae1e07b7e32965be644daba..000000000000000000000000000= 0000000000000=0A= --- a/sysdeps/unix/sysv/linux/m68k/coldfire/atomic-machine.h=0A= +++ /dev/null=0A= @@ -1,28 +0,0 @@=0A= -/* Copyright (C) 2010-2022 Free Software Foundation, Inc.=0A= - This file is part of the GNU C Library.=0A= -=0A= - The GNU C Library is free software; you can redistribute it and/or=0A= - modify it under the terms of the GNU Lesser General Public=0A= - License as published by the Free Software Foundation; either=0A= - version 2.1 of the License, or (at your option) any later version.=0A= -=0A= - The GNU C Library is distributed in the hope that it will be useful,=0A= - but WITHOUT ANY WARRANTY; without even the implied warranty of=0A= - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU=0A= - Lesser General Public License for more details.=0A= -=0A= - You should have received a copy of the GNU Lesser General Public=0A= - License along with the GNU C Library. If not, see=0A= - . */=0A= -=0A= -#ifndef _ATOMIC_MACHINE_H=0A= -#define _ATOMIC_MACHINE_H 1=0A= -=0A= -#include =0A= -=0A= -#define __HAVE_64B_ATOMICS 0=0A= -=0A= -/* XXX Is this actually correct? */=0A= -#define ATOMIC_EXCHANGE_USES_CAS 1=0A= -=0A= -#endif=0A= diff --git a/sysdeps/unix/sysv/linux/nios2/atomic-machine.h b/sysdeps/unix/= sysv/linux/nios2/atomic-machine.h=0A= deleted file mode 100644=0A= index 4b4b714f93f4c4b9f7f650d70d2301299a45e2f5..000000000000000000000000000= 0000000000000=0A= --- a/sysdeps/unix/sysv/linux/nios2/atomic-machine.h=0A= +++ /dev/null=0A= @@ -1,27 +0,0 @@=0A= -/* Low-level functions for atomic operations. Nios II version.=0A= - Copyright (C) 2012-2022 Free Software Foundation, Inc.=0A= - This file is part of the GNU C Library.=0A= -=0A= - The GNU C Library is free software; you can redistribute it and/or=0A= - modify it under the terms of the GNU Lesser General Public=0A= - License as published by the Free Software Foundation; either=0A= - version 2.1 of the License, or (at your option) any later version.=0A= -=0A= - The GNU C Library is distributed in the hope that it will be useful,=0A= - but WITHOUT ANY WARRANTY; without even the implied warranty of=0A= - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU=0A= - Lesser General Public License for more details.=0A= -=0A= - You should have received a copy of the GNU Lesser General Public=0A= - License along with the GNU C Library. If not, see=0A= - . */=0A= -=0A= -#ifndef _NIOS2_ATOMIC_MACHINE_H=0A= -#define _NIOS2_ATOMIC_MACHINE_H 1=0A= -=0A= -#define __HAVE_64B_ATOMICS 0=0A= -=0A= -/* XXX Is this actually correct? */=0A= -#define ATOMIC_EXCHANGE_USES_CAS 1=0A= -=0A= -#endif /* _NIOS2_ATOMIC_MACHINE_H */=0A= diff --git a/sysdeps/unix/sysv/linux/riscv/atomic-machine.h b/sysdeps/unix/= sysv/linux/riscv/atomic-machine.h=0A= index b0ebe09ce1fa4e15064dd57d83cadb8a1976f86d..90c48b301e8dad46017fe8d6497= 756cdd74268c8 100644=0A= --- a/sysdeps/unix/sysv/linux/riscv/atomic-machine.h=0A= +++ b/sysdeps/unix/sysv/linux/riscv/atomic-machine.h=0A= @@ -21,9 +21,6 @@=0A= =0A= #ifdef __riscv_atomic=0A= =0A= -# define __HAVE_64B_ATOMICS (__riscv_xlen >=3D 64)=0A= -# define ATOMIC_EXCHANGE_USES_CAS 0=0A= -=0A= /* Miscellaneous. */=0A= =0A= # define asm_amo(which, ordering, mem, value) ({ \=0A= diff --git a/sysdeps/unix/sysv/linux/sh/atomic-machine.h b/sysdeps/unix/sys= v/linux/sh/atomic-machine.h=0A= deleted file mode 100644=0A= index 71848194daa98ad0391c029a8c7d9dba5ba5fe3d..000000000000000000000000000= 0000000000000=0A= --- a/sysdeps/unix/sysv/linux/sh/atomic-machine.h=0A= +++ /dev/null=0A= @@ -1,22 +0,0 @@=0A= -/* Atomic operations used inside libc. Linux/SH version.=0A= - Copyright (C) 2003-2022 Free Software Foundation, Inc.=0A= - This file is part of the GNU C Library.=0A= -=0A= - The GNU C Library is free software; you can redistribute it and/or=0A= - modify it under the terms of the GNU Lesser General Public=0A= - License as published by the Free Software Foundation; either=0A= - version 2.1 of the License, or (at your option) any later version.=0A= -=0A= - The GNU C Library is distributed in the hope that it will be useful,=0A= - but WITHOUT ANY WARRANTY; without even the implied warranty of=0A= - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU=0A= - Lesser General Public License for more details.=0A= -=0A= - You should have received a copy of the GNU Lesser General Public=0A= - License along with the GNU C Library; if not, see=0A= - . */=0A= -=0A= -#define __HAVE_64B_ATOMICS 0=0A= -=0A= -/* XXX Is this actually correct? */=0A= -#define ATOMIC_EXCHANGE_USES_CAS 1=0A= diff --git a/sysdeps/x86/atomic-machine.h b/sysdeps/x86/atomic-machine.h=0A= index 98541a2d06ff5e4aa8c789ab7405215097471971..303458d1296e4b1cd7cd654e090= 4ace0ffc52fae 100644=0A= --- a/sysdeps/x86/atomic-machine.h=0A= +++ b/sysdeps/x86/atomic-machine.h=0A= @@ -21,17 +21,6 @@=0A= =0A= #include /* For mach. */=0A= =0A= -#ifdef __x86_64__=0A= -# define __HAVE_64B_ATOMICS 1=0A= -#else=0A= -/* Since the Pentium, i386 CPUs have supported 64-bit atomics, but the=0A= - i386 psABI supplement provides only 4-byte alignment for uint64_t=0A= - inside structs, so it is currently not possible to use 64-bit=0A= - atomics on this platform. */=0A= -# define __HAVE_64B_ATOMICS 0=0A= -#endif=0A= -#define ATOMIC_EXCHANGE_USES_CAS 0=0A= -=0A= #define atomic_spin_nop() __asm ("pause")=0A= =0A= #endif /* atomic-machine.h */=0A=