From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2083.outbound.protection.outlook.com [40.107.7.83]) by sourceware.org (Postfix) with ESMTPS id DC5913858D28 for ; Wed, 30 Aug 2023 12:51:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DC5913858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=W+ioBs8N6o3j4lS/8PPNSNyDTl8Ae9vM0SUUnzOEeY8=; b=Yyw5dJ+BGadlOMOQpq3dL++t04Xzrv4fpZGv13zUb/fr+Z/7MEsAbYBefPakrAdicIHX7yZJiC2i2RAABL0VC8nqi7LWjV/3KeAklD8/UmvxdSXi7RgBPkLgRYwCiPYILKDxd3yDDJdIb4XmzwP4NXiqeqpX8FpOsgi0sJVS0f4= Received: from DB8PR06CA0012.eurprd06.prod.outlook.com (2603:10a6:10:100::25) by DB9PR08MB8457.eurprd08.prod.outlook.com (2603:10a6:10:3d7::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.20; Wed, 30 Aug 2023 12:51:37 +0000 Received: from DBAEUR03FT042.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:100:cafe::4c) by DB8PR06CA0012.outlook.office365.com (2603:10a6:10:100::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.20 via Frontend Transport; Wed, 30 Aug 2023 12:51:37 +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 DBAEUR03FT042.mail.protection.outlook.com (100.127.142.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.20 via Frontend Transport; Wed, 30 Aug 2023 12:51:37 +0000 Received: ("Tessian outbound b5a0f4347031:v175"); Wed, 30 Aug 2023 12:51:36 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: cb1d34179c88555e X-CR-MTA-TID: 64aa7808 Received: from 8204de359ffb.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 030ED79D-0632-4387-A9D2-476EA1F1BCC3.1; Wed, 30 Aug 2023 12:51:30 +0000 Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 8204de359ffb.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 30 Aug 2023 12:51:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Eou77qDWJx+JvT8nWCQUSBY9I0a9/peCMI6JdEr+qxmSjKTO0qpCasv6zeaKzFRe19FXv6YJ49axknflH0bVS5DyZ0D49lmZIq8R6iPHjjYJ7HhyXfnQTbDKTBxv6soE5ufotpO38phYpUJ2PujiwXY7QrQ1PdjLWBRJEfF+eCJVj59wqM6QzDa6Dn/pXlXMNNwl96iICdsXUgsYcDiNk4gKfYl6ZDDy0dTsMdAA7FHdzU0UU6CK5YDXsBcRm24oLpAmpvKYySORPqDG/+w7iBJO1NFyD8MZCYTdXmhVAh2phNws6X0lzzKm/LN0jYpm7qKtWZ/KWxBzL74FwnE9iQ== 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=W+ioBs8N6o3j4lS/8PPNSNyDTl8Ae9vM0SUUnzOEeY8=; b=U6Hzwmvvg4CXahgVMsqaVhgHyn1tT1d+QbmM9YZHFyKiDEyXx9lA7sKrHVpnfC/zkfghwG9fxNHvIHVXrZLj0u1nHW1Bjrid6mwev/C591gHGNHViO2ekSaEXZ+/VXubG4P7m317DqTLN7aSls0d65GiJkRaRCU2jI7YAThJRSUGWqMEWbWVvnqa3gWJdKYh6YHIPXd7PCVrXQCupQ4Oncpa06u664vyUTNF+nL9MlK62IoUYw228JRv5DXOaE6ddToRwvMP5/oDXYuKcevzdkgY7mBqIKocLO6Tp8qpAT4u/Bp7ViwAo8RXz2UXB0tYBvdHAdrY4TuzuBSVZHiXHw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=W+ioBs8N6o3j4lS/8PPNSNyDTl8Ae9vM0SUUnzOEeY8=; b=Yyw5dJ+BGadlOMOQpq3dL++t04Xzrv4fpZGv13zUb/fr+Z/7MEsAbYBefPakrAdicIHX7yZJiC2i2RAABL0VC8nqi7LWjV/3KeAklD8/UmvxdSXi7RgBPkLgRYwCiPYILKDxd3yDDJdIb4XmzwP4NXiqeqpX8FpOsgi0sJVS0f4= Received: from PAWPR08MB8982.eurprd08.prod.outlook.com (2603:10a6:102:33f::20) by PAXPR08MB6352.eurprd08.prod.outlook.com (2603:10a6:102:150::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.20; Wed, 30 Aug 2023 12:51:28 +0000 Received: from PAWPR08MB8982.eurprd08.prod.outlook.com ([fe80::ff3d:6e95:9971:a7e]) by PAWPR08MB8982.eurprd08.prod.outlook.com ([fe80::ff3d:6e95:9971:a7e%5]) with mapi id 15.20.6699.034; Wed, 30 Aug 2023 12:51:27 +0000 From: Wilco Dijkstra To: Adhemerval Zanella Netto , Richard Henderson CC: 'GNU C Library' Subject: Re: [PATCH v2] string: Use builtins for ffs and ffsll Thread-Topic: [PATCH v2] string: Use builtins for ffs and ffsll Thread-Index: AQHZ2BPEefcZR5L51Uavq05wrrF+g6/875sAgAAueNyAApROgIAACx4AgAMKwsc= Date: Wed, 30 Aug 2023 12:51:27 +0000 Message-ID: References: <2ee3e8b7-55a3-1566-4ba9-9570b726832f@linaro.org> <779a92ff-e28a-474c-9c09-e0bd6d52d41f@linaro.org> <8533efa4-337e-8a61-83bf-5eb83f4a4d2a@linaro.org> In-Reply-To: <8533efa4-337e-8a61-83bf-5eb83f4a4d2a@linaro.org> 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_|PAXPR08MB6352:EE_|DBAEUR03FT042:EE_|DB9PR08MB8457:EE_ X-MS-Office365-Filtering-Correlation-Id: 17e2051c-e614-4066-fd9c-08dba957d8f5 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: 4WCZ+jVYR6+LVoEUYlOCShw1xPzRL3N7wjSYyw5Zik7G2A4cA9ALgb/nYqAQiOqEezgx29QoH73jf8RroHY4KVVoCOXL+/GIHfYDzyOdoFbCZlantx/LVvVe+WETVQiEDg1xnqRfkdQGf7xC6YWHsfXTVHs+fVt1oq1qWe+z+1Jt5/UjJvl+GOJ2vWN22Vvq192c49HXPBnIbg3HNuoyVKcyiQzeuO9ro7tiZ5ZMU16yHSpxlTj5YbeAgfmh/ECr2SQUyg7nCWQyUnE62WAUXhq27u1n0fmfDZAnGyjCLIFlQUFYjdGFFjNmMu9kvkfz6Bs9+oDMuL3NTQF7KE1kjO5RVhZ2HQm+mFDWaytspAYyNBRrlOr0kMWbkrvhIDj6U1V1NBZ1FSfc+ezKAmg7Lr5wQQ4u2wCMnQD/4MPRoZeyPyv93oecJj5DFD4Cz8aN/v0eGz+zCYgxu9Ro7iZoQYg2CthibJ5NdFp9elpU49x7G4ClFGby5gjlbC/CFwstcPJcRDvAt8oo8WTXOaxKuFk++zHsPMrfRe4+dkLNXGjuGayq4fAUs9XtW9l/ogvNppllAruWvqnBQ0iHCpJNg64BY0UPuJosAsQqNFvem7XHzN7Z2apGGdVx+716Ev7t 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:(13230031)(346002)(39860400002)(376002)(396003)(366004)(136003)(186009)(1800799009)(451199024)(33656002)(66556008)(66446008)(64756008)(2906002)(66946007)(91956017)(110136005)(76116006)(316002)(66476007)(55016003)(41300700001)(9686003)(71200400001)(7696005)(6506007)(5660300002)(52536014)(26005)(86362001)(38070700005)(38100700002)(122000001)(8936002)(4326008)(478600001)(8676002);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: PAXPR08MB6352 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: DBAEUR03FT042.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 6c21ba3c-2a20-43a1-c1ca-08dba957d38a X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0wB7BMaA59jho13MC9WUd+KUGDplOvEotrE5+h1th4J3TkCKbMP6HArZ1DGewl+TDuuBMN1phFWeKVWZwkPZw9QAsYqDAyobJAPUG2v28sPXXKU3YkLKl7Rix7bxsiCbbT1pVlkA4hABiqu29sG/frgbIq5WwIdQs03o8WjB1dLpDnJXdZQo1d4eOi6caOpEs09IYBTScJZdJFl/n6IETdEZagXsXvnKuvG67XeDP204k35bX0OOkKb5NFbF/FX2vTg9PO/5KQHE0U04mRyqaEQbACo+VOT9xLGI/zAMwXeYsp5CY4zwTsmKU8JLIiMktwZYUIj5KeMubnt+nmkzis+YHbCSvMe0eldw3/tf0SFs9ekSkGp/W9odOEij9tvd+yGs3r9So62jggEoOM7QPGGvHoMOVsSm0A0/cJpxY7ObTrd/duLxKPb6vgwrXYSpc9gJujCz2NaUA5zHZNW7GhlgdZN4HlmY4NWFfmrByyqrJfwgZZWM04/Vp2QAlPSxhafJDXo3RaJoQV1+7+d7sG4/6MKyQ6t9Q8iZ0P+Dws37j+zXY/j11TjeTOnC4ujXeuWwMlR3K98Fue3Zm8x2jVlFPLcyF4LPIc5yNMJAKFDKSQs/6ZdCYA9NY6hRV8cF0RaRFTd1YKBvCJgORNtSXM7vCuQv4oEUEh6W6dJs6zu06ZrsAhVMDfBxs5AdBf0OgqrVF43FlhB+OMfnJgABDp4FwZzz0K8ymYTxoBTPK0Q= 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:(13230031)(4636009)(346002)(39860400002)(376002)(396003)(136003)(186009)(82310400011)(1800799009)(451199024)(40470700004)(36840700001)(46966006)(33656002)(2906002)(70586007)(70206006)(110136005)(316002)(55016003)(40480700001)(41300700001)(40460700003)(9686003)(36860700001)(7696005)(6506007)(5660300002)(52536014)(26005)(336012)(47076005)(86362001)(356005)(82740400003)(8936002)(4326008)(81166007)(478600001)(8676002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2023 12:51:37.0149 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 17e2051c-e614-4066-fd9c-08dba957d8f5 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: DBAEUR03FT042.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB8457 X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,KAM_DMARC_NONE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,TXREP,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Adhemerval,=0A= =0A= > I would say we are discussing two different things here.=A0 My patch inte= ntion=0A= > is to remove the multiple ffs/ffsll arch-specific and use compiler to gen= erate=0A= > the optimized instruction were possible.=A0 The idea is not to leverage l= ibgcc,=0A= > since I have not touched string/ffs{ll}.c.=0A= =0A= "where possible" is the issue. Eg. for Arm USE_FFS_BUILTIN should be set fr= om=0A= armv5te onwards, and USE_FFSLL_BUILTIN from armv6t2 onwards on GCC14.=0A= Other targets likely have similar issues. And targets that didn't have opti= mized=0A= assembler implementations might still have the right instructions and thus= =0A= should use the builtin.=0A= =0A= There are 2 ways to fix this properly: a configure check, or always use the= builtins.=0A= =0A= > A possible further cleanup would to indeed remove string/ffs.c, and alway= s use=0A= > the compiler builtin (and thus libgcc).=A0 But I think this should be a d= ifferent=0A= > patch.=0A= =0A= To be clear I'm fine with a follow-on patch that removes these defines agai= n.=0A= It's just that in previous iterations several people wanted more accurate s= ettings=0A= for these defines, and it seems that could go on...=0A= =0A= > In fact, in the glibc weekly discussion Carlos brought that we should als= o remove =0A= > the ffs/ffsll benchtests (since there is no much point in having a benchm= ark for=0A= > theses symbols).=0A= =0A= Yes I was going to bring that up too. There are likely other functions whic= h are rarely=0A= used, and thus have no need to have optimized implementations or benchmarks= .=0A= =0A= Cheers,=0A= Wilco=