From patchwork Thu Jan 12 16:00:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wilco Dijkstra X-Patchwork-Id: 63111 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 0AA7F3854387 for ; Thu, 12 Jan 2023 16:00:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0AA7F3854387 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1673539241; bh=jvkmwiU5RatHsXAndVP38O0hGlml66hwFD6pEVkSaco=; h=To:CC:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=pcMQq65gm0w6VOMuu4j601aPXEcJLOCrMPeDgTvsFWR/fkuUF3jVZfaud8AgLq3Mn qlVaV3vEFtTwFX5uvNxDW4KD64DTTST19zTe27qKVh4bakbVlfwAPRo9JvZWD4GwXs lp/JnMO7y7yO8sJggRktMOg+isw99pu+SnV2SX1c= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2049.outbound.protection.outlook.com [40.107.7.49]) by sourceware.org (Postfix) with ESMTPS id 931A73858D35 for ; Thu, 12 Jan 2023 16:00:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 931A73858D35 Received: from AM6P191CA0020.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:8b::33) by AM8PR08MB5827.eurprd08.prod.outlook.com (2603:10a6:20b:1da::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.13; Thu, 12 Jan 2023 16:00:15 +0000 Received: from AM7EUR03FT013.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:8b:cafe::ba) by AM6P191CA0020.outlook.office365.com (2603:10a6:209:8b::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.13 via Frontend Transport; Thu, 12 Jan 2023 16:00:15 +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 AM7EUR03FT013.mail.protection.outlook.com (100.127.140.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.13 via Frontend Transport; Thu, 12 Jan 2023 16:00:15 +0000 Received: ("Tessian outbound 6e565e48ed4a:v132"); Thu, 12 Jan 2023 16:00:15 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 7ab425bbe232f7d7 X-CR-MTA-TID: 64aa7808 Received: from e71e042722e7.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id D9BFDEE4-54BD-47D1-B588-AD157527A950.1; Thu, 12 Jan 2023 16:00:09 +0000 Received: from EUR01-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id e71e042722e7.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 12 Jan 2023 16:00:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GDj80jBBphq6FSpVLScH1DV5OWNB7pnwUBzmUHHwegI9MD2uXBXykMUnKWGSZQ9eiKYB6XjN5x7u0YiUQQldEiUX6T25NgRbWEeoZN62Yg6iswFcI+Rl7kRVHYXFDpyOVwzyDzj0jDszHkv63n1ymg31+Sb3F6J2ZufmfJRVW9jhq4Sso5o19fUgnrejuC9L5+V0qyFZiI94MZE+7qV6ZUCGOA0zn/Y+2QgrZZDHUW4HjQaoGee+Cou6ro+xcNJrfYxQ/kSjZ9DR1ESEHtU48bHY1eVDvhAoiewYJZ9kQsJGgxz6wdKFJJmKHo++BAxI3Z69/edNXbDw1n4Tx9HWVA== 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=jvkmwiU5RatHsXAndVP38O0hGlml66hwFD6pEVkSaco=; b=NNxJs06UrvZKSLMbueyTPeaulYsTqkiiULIAqWqBuunM9j9ITKAag/v0RsDPeEuwtktPfhiaMo2x/KIl/KwsihsSgwYJTSapjVPjUbrzGpO+ldmhnPZDUIT8s6j421hvqgQN7hWujdw+STWKpD475eZbQW47icNqBiF/ZTiC3q88tg/Qnps6Jf190qRgGq84w9Xmdh7Nk0uBZwUyRxHVUh8QuAuKHxwqM1n+sJVeZo092g6qAr7G1A/yPnVtHiHDrlhJWqnxkwYYcEhgtPixv3nJqyImTd20ngr2e9zZJvY4MfJvp9SAdzmkRvMX5posT2gY0Zt6BNR4vh2wdOwcrw== 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 PAWPR08MB8982.eurprd08.prod.outlook.com (2603:10a6:102:33f::20) by AS2PR08MB8263.eurprd08.prod.outlook.com (2603:10a6:20b:552::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Thu, 12 Jan 2023 16:00:07 +0000 Received: from PAWPR08MB8982.eurprd08.prod.outlook.com ([fe80::66e4:4940:d096:4f7]) by PAWPR08MB8982.eurprd08.prod.outlook.com ([fe80::66e4:4940:d096:4f7%9]) with mapi id 15.20.5986.018; Thu, 12 Jan 2023 16:00:06 +0000 To: 'GNU C Library' CC: Szabolcs Nagy Subject: [PATCH] AArch64: Improve strchrnul Thread-Topic: [PATCH] AArch64: Improve strchrnul Thread-Index: AQHZJp7Z3eHlW3POI02tAiuGfK6XHw== Date: Thu, 12 Jan 2023 16:00:06 +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-traffictypediagnostic: PAWPR08MB8982:EE_|AS2PR08MB8263:EE_|AM7EUR03FT013:EE_|AM8PR08MB5827:EE_ X-MS-Office365-Filtering-Correlation-Id: 0845a197-dd22-4470-5e74-08daf4b61865 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: pCIjAaXp7okPe/rZ2XgZOWfRs9+CDVZ3rvrhxsXdVqK5vxzBLi92pynzyw1V++xLkMFElhAYZqJpnwhQV0ss4EIMSGsqW5Fmpytjr9Z7xvTrdaoydMOt/P6m0kSZrkQTtJ1ncCDC4u+T/Dy/D//LKRRr3J2cK7MV7WBfDat+cL7Z42m5ZTvAlgGe/tj5cGk44LorkbM+YaszOJYwFunn47mpDiLUFg1HGIdl9J4fUDfAN2hIm6GnqdrIZLviOxn3oCwxU+lREWmII5nUhTFpaJKwEbeJ/IU1KHKl8Jm+pvehZ2eNukMH5Z90CG1AaQDYlWbhmdbJlm1it3mtoOJrEjg+TdBukMNIDRxVV+1P7txzjA1leOPxKaZCsokZ+Fi9Wp0b/ynEi6+5rL3j2LOCoOpSMBVQxCiQ9hDRUiY8H9E0aAw1pgzLKZmk9ihpl/wkEpCuALJV5pGg74hjLHXzwKmJU+oA893Ozr/lMgp4IqS7fA7i1PJJxsPouRHkZGZu2sp7SZyb2F1H4BH8VHDUsbeaNmvKAZsiIo5fWxiXnqXNA1AlJ5VsSKrLs4Q8jNoRVU4TjzIhM71ZfRVjAC3eaM5o8QKRkDSmUzJhqUBrmzZ2fiiut9Bq/a7lyZXpyJQF9XuM1iwk20YYzkRumI71Bf01GETEYdhhH9SlJNkKW+v6KJ85O7vz+6B3URcoX9IkBoVlohs+Zv4DgN2TGn/HmYoXENE2/VyQfasAkQ76kPQ= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAWPR08MB8982.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(346002)(376002)(366004)(39860400002)(396003)(136003)(451199015)(86362001)(186003)(26005)(9686003)(7696005)(55016003)(4744005)(66476007)(478600001)(91956017)(4326008)(8676002)(52536014)(66446008)(64756008)(66556008)(33656002)(76116006)(66946007)(71200400001)(8936002)(5660300002)(316002)(38100700002)(6916009)(2906002)(41300700001)(38070700005)(6506007)(122000001)(156123004); DIR:OUT; SFP:1101; MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB8263 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: AM7EUR03FT013.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 6379059c-8d48-41cb-06d3-08daf4b612fc X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5qYt0HNx8InYvVRX/LRZ0HHDbxsZJXGAaGjLJkLO0gzFMBYmt0kNOULR8MFQw4MruqmsoIYPw+eVPE2zbufTnBFDTwVDRcoicbsm8qcK0jBs01WB8nyQZ2d962A+sI3BSrK6hxNU8DipZw0sPkmzH8L4bjmkDORgx1Zl5l5+DiGVVTjYMm0kyhRmDNQAPh2ggJvB0ABY4giYpIx6AGihp6w/n5qtSo3EHvTRRcB/Y0sHZOpM2GVw9o+3aZ0iHakOofLLnhSKt5AJ7Nan2BTpZabL43r4dmNKvZyySScKmWIfOIZwGDRiyiCCPU/nO35EE6n1/LAI+k+xV/FmyBwoqyDW9xEO5WcD6Br5h+7rJURuHSe+MHNulaFOMMyZVe8T+8Y6GtckCef9khO8GfXoaXFJsxjidhJnV4WaxVby+XpOWU2Fkt6rVc7MPTf/apjhlBDToi6RAMo0BTb2dxGAMo8BPh+NTycM8iVoDPwOUYBQDqDAFwd8S2t7Qe9f4MIRC5L5SNQic91bqX/xdTebtKFQUI5g6GKh5FNZ6K0K55OSR7BT6NLW4JxwPXCmvt/P25OhGxroZnxp3p20vwcKqKCcqsbk3HWJzCQ+RU7tjeviR+1LQ611rjoEl5AsoZNs0u6wMiH43OCO87SVAgNVNOa78YBveziCkAY72xDXe4vYksNgGjNGwk9UpBNb7gluhcsDsf48g6PgkTvkjbtSoXa32JftEFVzxVpeClBcc+0= 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:(13230022)(4636009)(346002)(39860400002)(396003)(136003)(376002)(451199015)(40470700004)(36840700001)(46966006)(8676002)(6916009)(70586007)(4326008)(8936002)(52536014)(5660300002)(70206006)(41300700001)(4744005)(26005)(356005)(7696005)(2906002)(316002)(186003)(86362001)(33656002)(40460700003)(478600001)(40480700001)(47076005)(6506007)(55016003)(9686003)(336012)(82310400005)(81166007)(82740400003)(36860700001)(156123004); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2023 16:00:15.6243 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0845a197-dd22-4470-5e74-08daf4b61865 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: AM7EUR03FT013.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB5827 X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_NONE, 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-Patchwork-Original-From: Wilco Dijkstra via Libc-alpha From: Wilco Dijkstra Reply-To: Wilco Dijkstra Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Unroll the main loop, which improves performance slightly. Passes regress. Reviewed-by: Szabolcs Nagy diff --git a/sysdeps/aarch64/strchrnul.S b/sysdeps/aarch64/strchrnul.S index 4ca1e58c36ac903fad83c4470ed7f4abd6c74e27..aa8c9a4363051b4098c2f60ee830bab7326a54a7 100644 --- a/sysdeps/aarch64/strchrnul.S +++ b/sysdeps/aarch64/strchrnul.S @@ -70,14 +70,22 @@ ENTRY (__strchrnul) .p2align 4 L(loop): - ldr qdata, [src, 16]! + ldr qdata, [src, 16] + cmeq vhas_chr.16b, vdata.16b, vrepchr.16b + cmhs vhas_chr.16b, vhas_chr.16b, vdata.16b + umaxp vend.16b, vhas_chr.16b, vhas_chr.16b + fmov tmp1, dend + cbnz tmp1, L(end) + ldr qdata, [src, 32]! cmeq vhas_chr.16b, vdata.16b, vrepchr.16b cmhs vhas_chr.16b, vhas_chr.16b, vdata.16b umaxp vend.16b, vhas_chr.16b, vhas_chr.16b fmov tmp1, dend cbz tmp1, L(loop) - + sub src, src, 16 +L(end): shrn vend.8b, vhas_chr.8h, 4 /* 128->64 */ + add src, src, 16 fmov tmp1, dend #ifndef __AARCH64EB__ rbit tmp1, tmp1