From patchwork Wed Jul 16 12:03:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Radek Barton X-Patchwork-Id: 116406 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1396C3857C67 for ; Wed, 16 Jul 2025 12:04:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1396C3857C67 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1752667455; bh=UCZ3imSZp8Sfmf+PvcqWoNFMOeb7LrczXTuwk7/BqAg=; h=To:CC:Subject:Date:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=y29+bXXR7FJlSCdUZK+clO7eoEGX6uKcgwl00JDnApPTny/TPC5eGAOM9CRQTtwXp IfFEVyjLYdNDqDdCuAMNozRtJruFnMmJF9YIbTzm+GRJLZ/g0FeL3ct6byoMucXjJk Fdcv3ksUwEqyxHf6/TYUm7rEOsXXvDobvZdQJSpk= X-Original-To: newlib@sourceware.org Delivered-To: newlib@sourceware.org Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on20703.outbound.protection.outlook.com [IPv6:2a01:111:f403:2607::703]) by sourceware.org (Postfix) with ESMTPS id E5EB23858402 for ; Wed, 16 Jul 2025 12:03:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E5EB23858402 ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E5EB23858402 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1752667424; cv=pass; b=sGmPT1u3t5wXDwgX1CH4h9AJzp6miZ4cuEeH5nDQcVF22tg0Xgt94iAI/J2+NUJXxeabYEGwRDmmoIsjjLdzchyFObMFuF0GNbmxN2XVKgQwS+fMUb0gho8DNdOubQUUliCGOWarwhqwQU9bINv0RnW4KrEL0iDvNxkYhJAUzgU= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1752667424; c=relaxed/simple; bh=D676k5LB6WViJ5qNKjuFf+WnuaqnoXTcy3/60IMuEH0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=vnMxvBqt0iajhvI8VipougUBNjS5KqcdOIfVGXuEaBBlWw2qf4xOLQFC1nutjvRUxUdg5sueM097pKQC/tQJObp5K8cmnb/D7aY+kbL6yLvSFBfkN9Uiy81wVHhkYxiBXNUJNP/jsxjuCrVLDs4NyTqBJEpRRa21gyuuupK3oQQ= ARC-Authentication-Results: i=2; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E5EB23858402 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Un+qS2zx2Ze6xPpTcxo2XoZBX0w4a3FUaKKo9JoKSLryh40LdL92P+3EyZuvMsIaH+BQz5nUV5oaYFQGfjsCVY3IKZibK4754H6Vwy/l1GjFTVar3Ltf/uJgPbkbs1IuJvqaKB2ox6JmcSGW/DK/QF21wqSBug7JaMtSasQ7IajXZKkCYrZg+2nMR22NVu7t83PP0JIQu85Qyb/hX8YWyQOFnPIdrkUxQz4r1Hq2RWR4vGKk0SG25ybQ5BgxjHwes8L1UckWOMGQTCK0xl5BiGjUQRnlojqbgR+6SuKZHrFjU4NDpfBg0P8Rz00BmUG6ceJwrUhPkts1TDwCpzQlqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=JiXNFSaWp0gObCC+9y4OP7V0BGNE3W0E8gPyGcVErPg=; b=b6ncckcC5MJthrfy8a9cfTANxetNksLgNtwd/BJyv+ZM/Vi4svca6lf9NH2LTuAFPngsU4qK8vgi83mH4IkqmOw+xRo+y422sJ/DefhZgYtsx30itLobcNwqj9nas+AFaOna7D+y8CYeW3ELFkwFfLvcRxAKx9UcTyqC+4Xy6EDfZnqZWlssqUtqpfJ0bS7RSvL+Hs3bpP75zOhQF3OxobxE3oyF/u9fASvEjKnMAUAM8nLdCoCFF7PpWU5YT8STgoFZqjdu+DUfVbbYB43v0nWOwX79SE1XcJdXSIVh2iCxffCEQsgltOxhVbB/eLKPgcyo6U7rRnK+J+Ryu/oBvQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none Received: from GV4PR83MB0941.EURPRD83.prod.outlook.com (2603:10a6:150:27e::22) by VI0PR83MB0566.EURPRD83.prod.outlook.com (2603:10a6:800:212::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8964.8; Wed, 16 Jul 2025 12:03:39 +0000 Received: from GV4PR83MB0941.EURPRD83.prod.outlook.com ([fe80::db38:300c:f561:a48a]) by GV4PR83MB0941.EURPRD83.prod.outlook.com ([fe80::db38:300c:f561:a48a%4]) with mapi id 15.20.8964.004; Wed, 16 Jul 2025 12:03:39 +0000 To: "newlib@sourceware.org" CC: "Richard Earnshaw (lists)" Subject: [PATCH v3] newlib: libc: make AArch64 asmdefs.h compatible with GCC/binutils COFF Thread-Topic: [PATCH v3] newlib: libc: make AArch64 asmdefs.h compatible with GCC/binutils COFF Thread-Index: AQHb9kmqzheM9dUdrU+XXLuephnHqg== Date: Wed, 16 Jul 2025 12:03:38 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2025-07-16T12:03:34.643Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=General; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: GV4PR83MB0941:EE_|VI0PR83MB0566:EE_ x-ms-office365-filtering-correlation-id: 77e83d72-1a32-4b95-12e0-08ddc460cce6 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|1800799024|366016|376014|4053099003|38070700018; x-microsoft-antispam-message-info: =?iso-8859-2?q?m2vGmsWA8DtA7mVCy6cN31nf9G?= =?iso-8859-2?q?sLVG6EzPZAAXPBh2gtzia+KH63p37kKC5t0Eb2m8//oGtRnksRq/zMz2hdX9?= =?iso-8859-2?q?1Hl2/fqOITxoCGJPYNp+3v0IQ2l8JU23+fm0W0ZaDMRcrpFNonjfLpeBaD7v?= =?iso-8859-2?q?H8woKjnwMC6CnyU/lIKOB+5hghjLo1uoybly+4SNn5ZS079+Zjs166WnQprV?= =?iso-8859-2?q?1LRaugobWjy0h/TfagBiOeXghB1FQq2CouBqdqFHCaVQdqmABazKpRZEqhkc?= =?iso-8859-2?q?bXUJHrN2yVo69LeyAp5cK6PF3t8Zm+8oqr8xb/dSfkIo/4MHiB1joS3SiMkg?= =?iso-8859-2?q?DEGOd0vy4QIiWdiHEa27tipjPisnpwK6p+0tBLW0Y69Hz5tkxHwph7svOkKq?= =?iso-8859-2?q?CrjvKhIIvkVi2Cvs9YUfOdyIOVisMgMKxbxO2FiAr1ch5A6da9OCjg7A06tF?= =?iso-8859-2?q?Vw2PQ2IqcVhHJviEAMSl8B9sadEz4bfQ3Yvtdkz2H7+oGyg7Y9OsmiiFyFqy?= =?iso-8859-2?q?+EH0aYwHEFCNT8gtQTry8COxRzmS1HPVVwG6hMzxotAirMdHaC/DqBoM8/Ry?= =?iso-8859-2?q?v+a+QKss8fskgpk7PzrDygxaPx6lHxOi0gmB0Sg/STsaMt/c2/sUSP1u+HHd?= =?iso-8859-2?q?SjjCr3LoVHuc9F7SrbQ/HDp+edWtj46qUdgqney5RLBTqfQawjYbru0Cdw02?= =?iso-8859-2?q?exBWKHI2iQFmFBwCAddnUa1YfBzuVAbBIPFGL/kh8wmfoRwNDx/P8k9RYVs8?= =?iso-8859-2?q?gy9WNp/sKdIhDhDDigi8EI4FWW04YM7asG1nRQsUTxehAW7Q+RZYFMxo8a/B?= =?iso-8859-2?q?QOMfZRUNxlpkxM8fCdkINLcbG61oJs3z48HvixMruS3b+sRgL3eoNFtPDRTn?= =?iso-8859-2?q?EwY7PUzIy84i7Uxmnj8sn9V15WDgo8O1lcVKzYINIVacXLeYxHFWlYFRJzWo?= =?iso-8859-2?q?gU1rpuqQnANjXbRPQzmcnTVp9fEJAkuGLbsSRdeZdAA9rTRXRxM/PdVgdLfP?= =?iso-8859-2?q?NHI4obU8D1v0sgE7aTc9bjf0B12zKKF3Ea/m76DjbG/JYTk4IQUqjtdxBLmV?= =?iso-8859-2?q?eUKKfi3pRNSWtXUj6EoElFFdz41Ci9Saln+vAHJ3Sbtq6lya4eOK4N4Uif/+?= =?iso-8859-2?q?Ibnq3DzlkZOJMkeFqDEE9ban8TsU/IQSPmFEjFptOwwgKWPUbyBimZQv4t84?= =?iso-8859-2?q?M7b1TuE4uJs5H95feSUHzDJFV2TpjQxY29FQS/lr0IrQCCnaRfs44ew4MD/n?= =?iso-8859-2?q?58WrHZYcM/FC+1X7zMpScjIy51ZiRAICYYcqjHolY+1AjH/t9x4ZFPdK2Jkw?= =?iso-8859-2?q?2zah62cSrRrKPszutjoG50s6U60D3/91aETX1qq3YwMRPtFXbZBVfhLAh0EZ?= =?iso-8859-2?q?zOo4v0eMO03RWg78pvEM6QxnMZ9lJPE+FA4eW71fcOkAYl7ug+Z0LeNC5Xf6?= =?iso-8859-2?q?y8vJBdNqW41CX0Cq84eRi3i+vmRYYcy8W8M7DDZ2NEaDHH1I+2MfRxQBTyPS?= =?iso-8859-2?q?pn0Rs2ZcDV7+kq8ori61BXHt2Ltz8C8c0VxNffGyCidRWuAI0=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:GV4PR83MB0941.EURPRD83.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014)(4053099003)(38070700018); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-2?q?leKvsN0rMVP0ntNiapWryA6?= =?iso-8859-2?q?IPkvo9Lg8ZYonZR9HiRfUlKJWPgXiFP5ndxuZPoltNwqdOJV45F/ZPDFiAQ5?= =?iso-8859-2?q?s+n3dWrypYXXLH0sF10QiRvHm+bqaAjffmjdWzHQxeHqqOTf9IpQ0d9bMpPx?= =?iso-8859-2?q?/2skR6lD1ZttgLoe1GTQs1y5ALdaTcGkjg94nyiloSrUAjlLJUXYkyYA/RR8?= =?iso-8859-2?q?SMnTcouOxmuUFsnu5Kmq74olPfGFqF0xWejQHLslYzsahXn3Uiw/2E0Aj5Bc?= =?iso-8859-2?q?N+Vg1Mgr6FQ/6iUr17DXJwdwhy9pkrsbpqrT+VUSyztVvnZVI0mCeAGmaPuh?= =?iso-8859-2?q?Da5Zqyk6sQHyaTgS2APDY8Qrfo4vQmoI+ftSquIoizAexorlvsmM7oxnxJQN?= =?iso-8859-2?q?tRmkCpL3o2k8NF8y80Zkgb+kT7Bvh1FMtPXTJgWs7NVmY93IvdQAfZmbmi4j?= =?iso-8859-2?q?5SWwDX3fDzEEeU5zjDEaW3TRY4RiT4DlAuBAFKkgEkXKhIpg72UncO0eMKYM?= =?iso-8859-2?q?Md1rOrAoJigQTLcTKqu3rdX7aecNig1Fhj6b+y9LietT/QaFApL1kPnIGXET?= =?iso-8859-2?q?NjoaABM5Mf0VWh9Ctkm4LtRmZIWyegCzPo9znmuYYQGVs5BetzL3etu6RchS?= =?iso-8859-2?q?iKC1f3mu4OCo4slO0bGoFVc0bkEK1XB9uyeHxJMIvoWSlrC4zNF9s+VT2THV?= =?iso-8859-2?q?UXLIk9r/L0cIzPMEWgWyywSU/0+tNnHFcEg+zveHAG5LdDGXaJ9hgenPP7gx?= =?iso-8859-2?q?f6fV+mTmWfQamRhiIK3qlcfoRjWv6kY39zCbSnLQma14aV4kjbJY9UJpdY/8?= =?iso-8859-2?q?LDdJq6LyLLsimyNBacPMrWsKSG12i+BSfoOKyMsqghvy3r+3ZgwhPvTttwTK?= =?iso-8859-2?q?AbzpI+NtFQMiWeSZ66l9XI8gNPVbYqAq4TVG+oqkGu+OBNLRbw1LQ7/EGYbn?= =?iso-8859-2?q?Y44hcj4Ydksv50gBpBFYpUO35ExoQSUUmI4rKFWuJCQyW0SSFurY4kpm3/Z4?= =?iso-8859-2?q?JxSWVT70z8c7+C8oOHjEeK07nrUli8m6KSks5el5KGX7iUVh66uGjKDopVqi?= =?iso-8859-2?q?yQaIf23G5DIms65w/kkD0b8o2p0StfSr/ZOflcs4U3ccKCp1m8wH71cb+VRu?= =?iso-8859-2?q?Qvw9F0D/b7GNW9CP0cl52KtTh1qucXLVwL7jIff2LdU7SYA/xiIlJ2co3yXn?= =?iso-8859-2?q?FiF5eGTr05O4gL9dDbABkuhMy+VMVqmSlGZYGQPe1iPlJZEKv/XydPAKSGFz?= =?iso-8859-2?q?zFpt5A9kvgOLTlvvrlIt7+9+aCH7dhrOlmuZMlilNvlHcC53Q6wLXGoZYYFq?= =?iso-8859-2?q?H7c1RYQPGIX5y8M7GrdLUV5wps5CTXAHHd44mpxktPWCa6I2U3Eb6PNUNQqC?= =?iso-8859-2?q?rqm8yUr5IxRkaHWLDpH7BPtSa0ffz6H3/f0ghZmPQHrd30hJhqydMhyuleE9?= =?iso-8859-2?q?ryfvhRCaNf+2NnNklJUoK6bTXvO3eHFWyPNfJDYQLI+sIFI46aizzSs056po?= =?iso-8859-2?q?09PkJsV/jiulPZDK524I2XnyyrlRYIU3innydhaCijC8+IR67o7ibcWh5enj?= =?iso-8859-2?q?BFry/tjrioh/x?= MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: GV4PR83MB0941.EURPRD83.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 77e83d72-1a32-4b95-12e0-08ddc460cce6 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Jul 2025 12:03:38.9455 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: MwXRmLFPvwHzRgxRW2bkBbwG5PuBkvVTXgkE5yAA3FGzXejnvsLX7BKaRqypWviFqs7gD9srELD47R+btY/O8DYdKHIeMn/1yD9fznBktA4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI0PR83MB0566 X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_NONE, TXREP 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: newlib@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Radek Barton via Newlib From: Radek Barton Reply-To: Radek Barton Errors-To: newlib-bounces~patchwork=sourceware.org@sourceware.org Hello. The necessary changes to asmdefs.h header in optimized-routines repository were accepted (https://github.com/ARM-software/optimized-routines/pull/87) so the new version of the patch synchronizes the newlib version of the header. Radek --- From ac536e8cf2e15ce25bc7d352f0fef492b58c276a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radek=20Barto=C5=88?= Date: Thu, 5 Jun 2025 11:32:08 +0200 Subject: [PATCH v3] newlib: libc: update asmdefs.h compatible with Cygwin AArch64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch synchronizes newlib/libc/machine/aarch64/asmdefs.h header with version from https://github.com/ARM-software/optimized-routines/commit/4352245388a55a836f3ac9ac5907022c24ab8e4c commit that added support for AArch64 Cygwin. This version of the header removed PTR_ARG and SIZE_ARG macros as ILP32 was deprecated which introduced changes in many .S files. On top of that, setjmp.S and rawmemchr.S were refactored to use ENTRY/ENTRY_ALIGN and END macros. Signed-off-by: Radek BartoĊˆ --- newlib/libc/machine/aarch64/asmdefs.h | 105 ++++++++++-------------- newlib/libc/machine/aarch64/memchr.S | 2 - newlib/libc/machine/aarch64/memcmp.S | 4 - newlib/libc/machine/aarch64/memcpy.S | 3 - newlib/libc/machine/aarch64/memrchr.S | 1 - newlib/libc/machine/aarch64/memset.S | 3 - newlib/libc/machine/aarch64/rawmemchr.S | 17 +--- newlib/libc/machine/aarch64/setjmp.S | 14 ++-- newlib/libc/machine/aarch64/strchr.S | 1 - newlib/libc/machine/aarch64/strchrnul.S | 1 - newlib/libc/machine/aarch64/strcmp.S | 2 - newlib/libc/machine/aarch64/strcpy.S | 2 - newlib/libc/machine/aarch64/strlen.S | 1 - newlib/libc/machine/aarch64/strncmp.S | 3 - newlib/libc/machine/aarch64/strnlen.S | 2 - newlib/libc/machine/aarch64/strrchr.S | 1 - 16 files changed, 54 insertions(+), 108 deletions(-) diff --git a/newlib/libc/machine/aarch64/asmdefs.h b/newlib/libc/machine/aarch64/asmdefs.h index 131b95e1f..6c99fa704 100644 --- a/newlib/libc/machine/aarch64/asmdefs.h +++ b/newlib/libc/machine/aarch64/asmdefs.h @@ -1,19 +1,28 @@ /* * Macros for asm code. AArch64 version. * - * Copyright (c) 2019-2023, Arm Limited. + * Copyright (c) 2019-2025, Arm Limited. * SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception */ #ifndef _ASMDEFS_H #define _ASMDEFS_H +/* Set the line separator for the assembler. */ +#if defined (__APPLE__) +# define SEP %% +# define PREF _ +#else +# define SEP ; +# define PREF +#endif + /* Branch Target Identitication support. */ #define BTI_C hint 34 #define BTI_J hint 36 /* Return address signing support (pac-ret). */ -#define PACIASP hint 25; .cfi_window_save -#define AUTIASP hint 29; .cfi_window_save +#define PACIASP hint 25 SEP .cfi_window_save +#define AUTIASP hint 29 SEP .cfi_window_save /* GNU_PROPERTY_AARCH64_* macros from elf.h. */ #define FEATURE_1_AND 0xc0000000 @@ -21,32 +30,18 @@ #define FEATURE_1_PAC 2 /* Add a NT_GNU_PROPERTY_TYPE_0 note. */ -#ifdef __ILP32__ #define GNU_PROPERTY(type, value) \ - .section .note.gnu.property, "a"; \ - .p2align 2; \ - .word 4; \ - .word 12; \ - .word 5; \ - .asciz "GNU"; \ - .word type; \ - .word 4; \ - .word value; \ + .section .note.gnu.property, "a" SEP \ + .p2align 3 SEP \ + .word 4 SEP \ + .word 16 SEP \ + .word 5 SEP \ + .asciz "GNU" SEP \ + .word type SEP \ + .word 4 SEP \ + .word value SEP \ + .word 0 SEP \ .text -#else -#define GNU_PROPERTY(type, value) \ - .section .note.gnu.property, "a"; \ - .p2align 3; \ - .word 4; \ - .word 16; \ - .word 5; \ - .asciz "GNU"; \ - .word type; \ - .word 4; \ - .word value; \ - .word 0; \ - .text -#endif /* If set then the GNU Property Note section will be added to mark objects to support BTI and PAC-RET. */ @@ -60,47 +55,37 @@ GNU_PROPERTY (FEATURE_1_AND, FEATURE_1_BTI|FEATURE_1_PAC) #endif #define ENTRY_ALIGN(name, alignment) \ - .global name; \ - .type name,%function; \ - .align alignment; \ - name: \ - .cfi_startproc; \ - BTI_C; + .align alignment SEP \ + ENTRY_ALIAS(name) SEP \ + .cfi_startproc SEP \ + BTI_C #define ENTRY(name) ENTRY_ALIGN(name, 6) -#define ENTRY_ALIAS(name) \ - .global name; \ - .type name,%function; \ - name: - -#define END(name) \ - .cfi_endproc; \ - .size name, .-name; +#if defined (__APPLE__) +/* Darwin is an underscore platform, symbols need an extra _ prefix. */ +# define ENTRY_ALIAS(name) \ + .global _ ## name SEP \ + _ ## name: -#define L(l) .L ## l +# define END(name) .cfi_endproc +#elif defined (_WIN32) || defined (__CYGWIN__) +# define ENTRY_ALIAS(name) \ + .global name SEP \ + name: -#ifdef __ILP32__ - /* Sanitize padding bits of pointer arguments as per aapcs64 */ -#define PTR_ARG(n) mov w##n, w##n +# define END(name) .cfi_endproc #else -#define PTR_ARG(n) -#endif +# define ENTRY_ALIAS(name) \ + .global name; \ + .type name,%function; \ + name: -#ifdef __ILP32__ - /* Sanitize padding bits of size arguments as per aapcs64 */ -#define SIZE_ARG(n) mov w##n, w##n -#else -#define SIZE_ARG(n) +# define END(name) \ + .cfi_endproc; \ + .size name, .-name #endif -/* Compiler supports SVE instructions */ -#ifndef HAVE_SVE -# if __aarch64__ && (__GNUC__ >= 8 || __clang_major__ >= 5) -# define HAVE_SVE 1 -# else -# define HAVE_SVE 0 -# endif -#endif +#define L(l) .L ## l #endif diff --git a/newlib/libc/machine/aarch64/memchr.S b/newlib/libc/machine/aarch64/memchr.S index a0f305e0f..074a004cf 100644 --- a/newlib/libc/machine/aarch64/memchr.S +++ b/newlib/libc/machine/aarch64/memchr.S @@ -50,8 +50,6 @@ */ ENTRY (memchr) - PTR_ARG (0) - SIZE_ARG (2) /* Do not dereference srcin if no bytes to compare. */ cbz cntin, L(zero_length) /* diff --git a/newlib/libc/machine/aarch64/memcmp.S b/newlib/libc/machine/aarch64/memcmp.S index 18874d321..2a9c446bb 100644 --- a/newlib/libc/machine/aarch64/memcmp.S +++ b/newlib/libc/machine/aarch64/memcmp.S @@ -34,10 +34,6 @@ ENTRY (memcmp) - PTR_ARG (0) - PTR_ARG (1) - SIZE_ARG (2) - cmp limit, 16 b.lo L(less16) ldp data1, data3, [src1] diff --git a/newlib/libc/machine/aarch64/memcpy.S b/newlib/libc/machine/aarch64/memcpy.S index 248e7843a..252d2452a 100644 --- a/newlib/libc/machine/aarch64/memcpy.S +++ b/newlib/libc/machine/aarch64/memcpy.S @@ -58,9 +58,6 @@ ENTRY_ALIAS (memmove) ENTRY (memcpy) - PTR_ARG (0) - PTR_ARG (1) - SIZE_ARG (2) add srcend, src, count add dstend, dstin, count cmp count, 128 diff --git a/newlib/libc/machine/aarch64/memrchr.S b/newlib/libc/machine/aarch64/memrchr.S index ba9915cc3..2525cf190 100644 --- a/newlib/libc/machine/aarch64/memrchr.S +++ b/newlib/libc/machine/aarch64/memrchr.S @@ -45,7 +45,6 @@ exactly which byte matched. */ ENTRY (memrchr) - PTR_ARG (0) add end, srcin, cntin sub endm1, end, 1 bic src, endm1, 15 diff --git a/newlib/libc/machine/aarch64/memset.S b/newlib/libc/machine/aarch64/memset.S index ca76439a9..5bf4851f3 100644 --- a/newlib/libc/machine/aarch64/memset.S +++ b/newlib/libc/machine/aarch64/memset.S @@ -25,9 +25,6 @@ #define zva_val x5 ENTRY (memset) - PTR_ARG (0) - SIZE_ARG (2) - dup v0.16B, valw add dstend, dstin, count diff --git a/newlib/libc/machine/aarch64/rawmemchr.S b/newlib/libc/machine/aarch64/rawmemchr.S index 26da81005..85dda749a 100644 --- a/newlib/libc/machine/aarch64/rawmemchr.S +++ b/newlib/libc/machine/aarch64/rawmemchr.S @@ -34,22 +34,13 @@ /* See rawmemchr-stub.c. */ #else -#define L(l) .L ## l - - .macro def_fn f p2align=0 - .text - .p2align \p2align - .global \f - .type \f, %function -\f: - .endm +#include "asmdefs.h" /* Special case rawmemchr (s, 0) as strlen, otherwise tailcall memchr. Call strlen without setting up a full frame - it preserves x14/x15. */ -def_fn rawmemchr p2align=5 - .cfi_startproc +ENTRY_ALIGN (rawmemchr, 5) cbz w1, L(do_strlen) mov x2, -1 b memchr @@ -61,8 +52,6 @@ L(do_strlen): bl strlen add x0, x14, x0 ret x15 - .cfi_endproc +END (rawmemchr) - .size rawmemchr, . - rawmemchr #endif - diff --git a/newlib/libc/machine/aarch64/setjmp.S b/newlib/libc/machine/aarch64/setjmp.S index 0856145bf..1a1f2a387 100644 --- a/newlib/libc/machine/aarch64/setjmp.S +++ b/newlib/libc/machine/aarch64/setjmp.S @@ -26,6 +26,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "asmdefs.h" + #define GPR_LAYOUT \ REG_PAIR (x19, x20, 0); \ REG_PAIR (x21, x22, 16); \ @@ -42,9 +44,7 @@ REG_PAIR (d14, d15, 160); // int setjmp (jmp_buf) - .global setjmp - .type setjmp, %function -setjmp: +ENTRY (setjmp) mov x16, sp #define REG_PAIR(REG1, REG2, OFFS) stp REG1, REG2, [x0, OFFS] #define REG_ONE(REG1, OFFS) str REG1, [x0, OFFS] @@ -54,12 +54,10 @@ setjmp: #undef REG_ONE mov w0, #0 ret - .size setjmp, .-setjmp +END (setjmp) // void longjmp (jmp_buf, int) __attribute__ ((noreturn)) - .global longjmp - .type longjmp, %function -longjmp: +ENTRY (longjmp) #define REG_PAIR(REG1, REG2, OFFS) ldp REG1, REG2, [x0, OFFS] #define REG_ONE(REG1, OFFS) ldr REG1, [x0, OFFS] GPR_LAYOUT @@ -71,4 +69,4 @@ longjmp: cinc w0, w1, eq // use br not ret, as ret is guaranteed to mispredict br x30 - .size longjmp, .-longjmp +END (longjmp) diff --git a/newlib/libc/machine/aarch64/strchr.S b/newlib/libc/machine/aarch64/strchr.S index 500d9aff2..a4e089b99 100644 --- a/newlib/libc/machine/aarch64/strchr.S +++ b/newlib/libc/machine/aarch64/strchr.S @@ -54,7 +54,6 @@ /* Locals and temporaries. */ ENTRY (strchr) - PTR_ARG (0) /* Magic constant 0xc0300c03 to allow us to identify which lane matches the requested byte. Even bits are set if the character matches, odd bits if either the char is NUL or matches. */ diff --git a/newlib/libc/machine/aarch64/strchrnul.S b/newlib/libc/machine/aarch64/strchrnul.S index ceaf4dca1..4d6093be7 100644 --- a/newlib/libc/machine/aarch64/strchrnul.S +++ b/newlib/libc/machine/aarch64/strchrnul.S @@ -50,7 +50,6 @@ /* Locals and temporaries. */ ENTRY (strchrnul) - PTR_ARG (0) /* Magic constant 0x40100401 to allow us to identify which lane matches the termination condition. */ mov wtmp2, #0x0401 diff --git a/newlib/libc/machine/aarch64/strcmp.S b/newlib/libc/machine/aarch64/strcmp.S index 691a1760e..1d85da432 100644 --- a/newlib/libc/machine/aarch64/strcmp.S +++ b/newlib/libc/machine/aarch64/strcmp.S @@ -54,8 +54,6 @@ ENTRY (strcmp) - PTR_ARG (0) - PTR_ARG (1) sub off2, src2, src1 mov zeroones, REP8_01 and tmp, src1, 7 diff --git a/newlib/libc/machine/aarch64/strcpy.S b/newlib/libc/machine/aarch64/strcpy.S index 57c46f390..1f5f70792 100644 --- a/newlib/libc/machine/aarch64/strcpy.S +++ b/newlib/libc/machine/aarch64/strcpy.S @@ -55,8 +55,6 @@ exactly which byte matched. */ ENTRY (STRCPY) - PTR_ARG (0) - PTR_ARG (1) bic src, srcin, 15 ld1 {vdata.16b}, [src] cmeq vhas_nul.16b, vdata.16b, 0 diff --git a/newlib/libc/machine/aarch64/strlen.S b/newlib/libc/machine/aarch64/strlen.S index 68a6f357c..a3345a3ab 100644 --- a/newlib/libc/machine/aarch64/strlen.S +++ b/newlib/libc/machine/aarch64/strlen.S @@ -78,7 +78,6 @@ character, return the length, if not, continue in the main loop. */ ENTRY (strlen) - PTR_ARG (0) and tmp1, srcin, MIN_PAGE_SIZE - 1 cmp tmp1, MIN_PAGE_SIZE - 32 b.hi L(page_cross) diff --git a/newlib/libc/machine/aarch64/strncmp.S b/newlib/libc/machine/aarch64/strncmp.S index 373695503..6b1994ef5 100644 --- a/newlib/libc/machine/aarch64/strncmp.S +++ b/newlib/libc/machine/aarch64/strncmp.S @@ -58,9 +58,6 @@ #endif ENTRY (strncmp) - PTR_ARG (0) - PTR_ARG (1) - SIZE_ARG (2) cbz limit, L(ret0) eor tmp1, src1, src2 mov zeroones, #REP8_01 diff --git a/newlib/libc/machine/aarch64/strnlen.S b/newlib/libc/machine/aarch64/strnlen.S index 091002e0b..dc9fcb2fd 100644 --- a/newlib/libc/machine/aarch64/strnlen.S +++ b/newlib/libc/machine/aarch64/strnlen.S @@ -39,8 +39,6 @@ identifies the first zero byte. */ ENTRY (strnlen) - PTR_ARG (0) - SIZE_ARG (1) bic src, srcin, 15 cbz cntin, L(nomatch) ld1 {vdata.16b}, [src] diff --git a/newlib/libc/machine/aarch64/strrchr.S b/newlib/libc/machine/aarch64/strrchr.S index b0574228b..67013e39d 100644 --- a/newlib/libc/machine/aarch64/strrchr.S +++ b/newlib/libc/machine/aarch64/strrchr.S @@ -58,7 +58,6 @@ identify exactly which byte is causing the termination, and why. */ ENTRY (strrchr) - PTR_ARG (0) /* Magic constant 0x40100401 to allow us to identify which lane matches the requested byte. Magic constant 0x80200802 used similarly for NUL termination. */