From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2073.outbound.protection.outlook.com [40.107.20.73]) by sourceware.org (Postfix) with ESMTPS id 4E6C53857B83 for ; Tue, 16 Jan 2024 16:08:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4E6C53857B83 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4E6C53857B83 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.20.73 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1705421320; cv=pass; b=bpsqnY1eRYRnMVZKbdaF0k9y+Csn1rfOh+hY8Gfx/0OT+4JMK7XuVj7Wy8gf8FMjAAyOkBevXdiIP2PLTKVYrvTRKzE2X9MjnsRkpgzklMhVzMnEh799F+E0SbdTDjvikuTWvhh3na5GyUPCNa3RHlukhYyVgvBQ+vv4Cc+7PFQ= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1705421320; c=relaxed/simple; bh=0cL7SDHRnnz4OyrjjZRG4xHNMD3o+khte09jPlzu/Dk=; h=DKIM-Signature:DKIM-Signature:Date:From:To:Subject:Message-ID: MIME-Version; b=oh2fyOCjtZcCyqTSzOF4uNSpzEW2hulb4yM1YWMFjnoEgZbbhjGMn4o0PduqviHreu491RDHcLDn7sCwtKumjiSw7cLnHWFvfGLAS5kav/U0VDcOf/jf5olciG6ULfwMBvSezfRuoKi995pZkcvtOSVA0H4m4cneDV+SSpJtZnU= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=CUfMghd6zYdDWVOXQRwXGPDQxq0w5h7uVV3IyB40Sls39ZGgk//mb0UVlkhz1W2HNGzEZB5zAF2nutKDZy2j3AKLskm+Dth2Qovp1kr5e7DVNKHVysOq2H5z0n3DVJBond290cHDtmtdxC8obwSxZxuydgEEWJEGRijY0YZ8VqSqUo3iszvYCJRis6gsgptgoFuoOzpWJ2twIzaf/3DCL9BjBfBJ7DvEe56tHXksNgYsjMTCPeCC0yCdj1nqvw+MjGUrQH8ssYaYdWunsuE6yT8gmL5gy6NF7hOUJl1zobKscH7B8HwS16eOCb4rhieshYO7hw07O5MwC1a7C4rhwA== 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=Z0bHr/fbjvTEpDf2RZm2RE1aGZewZX5gSDhXbnoXTlQ=; b=QPc6Y8bgUFXBfvwCTgtXchHfXqTGafrIcsEqTKddlXXmxmb+DuOyzFuIb4gYYfTIwknsEwNP50TESddq+e9T4FVjkq0imTDiGHObNARL0SYXzs14fx2BoDLUtnhDR2FVVSItYg6cCytaofDCXM8Xn7EjHGHlYwVaMQxLsaNmenZvWthrvdYGD2SQbN1+cRMD6r6ajfQ4bhIBx++/FJlPoVBE8IDFHQnKH5gR9zg8yVb5gluYeqPv6trGutZ5pWXLCp82Sduh0ZcMlrHOpGFbVwRk8JqxdTrDvqhpRfcO5s80fWbTtMg8vDRnIqJ1vwbOQPZ7/nkteJj7HROIEfe2Wg== 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]) 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=Z0bHr/fbjvTEpDf2RZm2RE1aGZewZX5gSDhXbnoXTlQ=; b=AvjIikC2mhUlepDSVVP66kKSgc3X6VoxRPKBAVSNgI5jmUnrIUqQeQrysrOgStSVHQ2MDsnBezA8AKlQIVkCYYTjqMpKdaitKNO2T91PN9XxNeEzb0HMgkNLkaBsUH0x8+4mwi3+8cfZaPds1t+sT3ivUKa9C5AuPby0dp9MMbY= Received: from AM6P192CA0022.EURP192.PROD.OUTLOOK.COM (2603:10a6:209:83::35) by AS8PR08MB8947.eurprd08.prod.outlook.com (2603:10a6:20b:5b3::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.23; Tue, 16 Jan 2024 16:08:31 +0000 Received: from AM2PEPF0001C713.eurprd05.prod.outlook.com (2603:10a6:209:83:cafe::b1) by AM6P192CA0022.outlook.office365.com (2603:10a6:209:83::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.26 via Frontend Transport; Tue, 16 Jan 2024 16:08:31 +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 AM2PEPF0001C713.mail.protection.outlook.com (10.167.16.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7202.16 via Frontend Transport; Tue, 16 Jan 2024 16:08:31 +0000 Received: ("Tessian outbound 31df1b57f90c:v228"); Tue, 16 Jan 2024 16:08:31 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: cf09c948550d8fa1 X-CR-MTA-TID: 64aa7808 Received: from f8ab0b506000.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 0B005EB6-4D12-4C35-BFF7-DF2B1C335AD9.1; Tue, 16 Jan 2024 16:08:19 +0000 Received: from EUR01-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f8ab0b506000.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 16 Jan 2024 16:08:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dk/68tzI3V87ORFhcPcz0Lx0H4VzylkvSijaf1qYL1La0mjyCd+jyiv2jwulUUA5X2BS44EHaFtJYTt41bYufwplPEjxMlBE9ckFPl9fvjbpSfEX4M1P5nCxOZCkZUvG/1GGJkwrPSfQVXqaDqglx+YgIRojaxL5YmLn1SgzFVYyYuplKO6KA91asAJ6gMu08w0rGPziLU5tMGp4kTjxG2URBOJP9qVQD/dTZ7hZHdVY9eVNulYcHOxA9/5RwhecLc0CvEL/GPTPNPNki3bBpe4U9AZMBfiljLRRXmwASGrGEVmlrGhzYKfObeeyJIZws5+y9qmvg6ZaeDjomtF7wg== 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=Z0bHr/fbjvTEpDf2RZm2RE1aGZewZX5gSDhXbnoXTlQ=; b=l1LzVwsogivuS722F575vji6Z2MKUw8qPZ7Kw6PCQrHtQ13lplEsNJd6NOjUD/HojdckEQSPpT0/v/sO4ubodmn4eZGsjRxVY7lL8iYktH2NEhhx/X+o3FfILiNGV0igGEMXh5hQv9ov27LAYMnGAfSk8JUARaEigZEVqIHXI73Ux/CAkANRpLfpybpML5utKN2NMwISeji5T0zmx55nBsxYW9GalsmZsm1oP+m5thQIAi4+JYXn3TeyOm7IGLdJ9A2sCRYrsXisMH0eD8gkZWvtFfz15HcZSTvQBmvKVpWgy90rLfPwyZoiDWOjc7Wbcj8c6XVlDXtsRW9MH5EItg== 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=Z0bHr/fbjvTEpDf2RZm2RE1aGZewZX5gSDhXbnoXTlQ=; b=AvjIikC2mhUlepDSVVP66kKSgc3X6VoxRPKBAVSNgI5jmUnrIUqQeQrysrOgStSVHQ2MDsnBezA8AKlQIVkCYYTjqMpKdaitKNO2T91PN9XxNeEzb0HMgkNLkaBsUH0x8+4mwi3+8cfZaPds1t+sT3ivUKa9C5AuPby0dp9MMbY= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from DB9PR08MB7179.eurprd08.prod.outlook.com (2603:10a6:10:2cc::19) by AM8PR08MB5826.eurprd08.prod.outlook.com (2603:10a6:20b:1c6::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.23; Tue, 16 Jan 2024 16:08:18 +0000 Received: from DB9PR08MB7179.eurprd08.prod.outlook.com ([fe80::bc19:813c:34d3:758]) by DB9PR08MB7179.eurprd08.prod.outlook.com ([fe80::bc19:813c:34d3:758%7]) with mapi id 15.20.7181.027; Tue, 16 Jan 2024 16:08:18 +0000 Date: Tue, 16 Jan 2024 16:08:02 +0000 From: Szabolcs Nagy To: Wilco Dijkstra , Adhemerval Zanella Netto , 'GNU C Library' Subject: Re: [PATCH] math: remove exp10 wrappers Message-ID: References: <1d3ba914-9e61-49fb-9ab3-816507cd18aa@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: LO4P123CA0432.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:18b::23) To DB9PR08MB7179.eurprd08.prod.outlook.com (2603:10a6:10:2cc::19) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DB9PR08MB7179:EE_|AM8PR08MB5826:EE_|AM2PEPF0001C713:EE_|AS8PR08MB8947:EE_ X-MS-Office365-Filtering-Correlation-Id: 1f310971-2c5d-4e26-afb8-08dc16ad626b 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: bBbZyoZDX3PpkIhrwUM3VP70jKsIGR4xBHw1MwTrwzyw287Ds1zMqtxbxlhIwzt4qJlIm/NV9tWPYoQ5Og9f+xXb6peNdjfaHm0HPETdv/Ev1JjEYZ0A5nECQrHuxqpvBdejyIYJn/EqoOsS2pNBj8yR3E7w7DXL7LTzfIXs3msz/epiwIyQHmHQOEm9QetEqcOAl66/ln7grDZ19aTIIkf3CFFu/sx99VdrXs9dEFOolzGGkPOmdGN+La5qx9b0GX4kNyPu+Ytl/XJhrbp45q+tzygxL9aOamW7q9WJwnZFtW4nL7IznMcb345/ic7wyZfFfbnDTXGmKBj7RPbpXZop8Ta/oeauWBM5oizchQS8P2RRiT1TE+dNA1pbx8fEBm8QfdmTjXG06bJvTS7c/YEx+3cgT6hkn7QK5YhfFHjC+O3yHk2gwuDjQ3OVfF3BT74KS+nLEy+7E4sGS6HN+hjL3AO1/r/qijtB8CRdfdLDvURcyffgShxA9LvBMTkFmbdvJjMKQ0t/pL+RCxz7rttyO7Nf1HlquSyHFRLalJTF7+vhgX7n4lVMIvRm5SwT X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB9PR08MB7179.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(366004)(39860400002)(396003)(346002)(376002)(230922051799003)(186009)(64100799003)(1800799012)(451199024)(110136005)(6666004)(6506007)(2616005)(6512007)(6486002)(66946007)(316002)(66556008)(66476007)(478600001)(26005)(41300700001)(5660300002)(2906002)(8936002)(8676002)(36756003)(38100700002)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB5826 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: AM2PEPF0001C713.eurprd05.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 888bd932-de32-4afd-8980-08dc16ad5a33 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /j/CnZnMpWahSRBrdvUDBtc/c4Ot7+6oxs2TIKTKqVHgOPm5WnJpDMZZQghrX0zmjjyKHyPcecFLTnPYShpx9mRvjgL6DQf/dcVcltxx/869oeGFrGfLuS+skFnzBYHJvFekZRmk9o9sY6ZZqaeH1ljhRpK7k/C81cxoTf1tAAyMF8UxRneVovuesR4TV3rdgbhYLVrkP5f0X4m6ZkMFs0qv8uHEK24XV20UQmvo5n6e+dPJXoM7lkxKj3J+Mlxlxz/fzQvfdZUo0a1oEUnaBxrWEBe0u7Yi6wgwI8Q0qRKeu4jq/tx98r6rvNg/jexzjHtTotreC1YRBa4LGCLm+jaAUaT8hxFaSrm/4aaWgkF7eX+Pflv4P8pp3BOOwVkKMi93FcHV0Vix1U+lMKXJfdFXiDR7EQ9dJURTO97wEw7BmMeFdoUYcJBpfeW1kHmzjduR+f/SaU/j12NrAqKoZ8qL8c8JRY/aUVI9tm9re4HEWH0Qh2IycwPw9ZOcrsSaGqAiO79MlSz1mV/JBPVVC6AOb137DAbgcGxTIacvKM5seHnThKvYOrE+aMMFrwA6f8a09djcPm/JFxPhpdpiM0rFpqrf5inUn7UsZ8JZuvEoILeBVhA+EuGZM0WByMCHiaNTx3Biuhf7+MtFcvCF3SJXNxGnOAVc8r7eRG/YuCkS08wPF6hyj0SrB00MpOL2mpF82rbaVKexRd2giLc4UQzekbykCrRMB+c9lTFlxlUYS+90ylHXLRmz4GbtTbyA 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)(376002)(396003)(39860400002)(136003)(230922051799003)(1800799012)(451199024)(64100799003)(186009)(82310400011)(40470700004)(46966006)(36840700001)(2906002)(5660300002)(81166007)(86362001)(6486002)(356005)(6512007)(36860700001)(478600001)(6506007)(36756003)(2616005)(82740400003)(336012)(26005)(8676002)(47076005)(6666004)(316002)(8936002)(41300700001)(70206006)(110136005)(70586007)(40480700001)(40460700003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jan 2024 16:08:31.5676 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1f310971-2c5d-4e26-afb8-08dc16ad626b 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: AM2PEPF0001C713.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB8947 X-Spam-Status: No, score=-5.4 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,T_SCC_BODY_TEXT_LINE,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: The 01/16/2024 15:41, Wilco Dijkstra wrote: > Hi Adhemerval, > > > The patch below fixes the numerical stability I found on i686: > > So it looks like it is due to incorrect uses of math_narrow_eval with > double_t expressions: kd = math_narrow_eval (z + Shift); > This needs to be: kd = math_narrow_eval ((double) (z + Shift)); > > > And I think we haven't see it because all ABIs with FLT_EVAL_METHOD=2 uses > > assembly implementations for exp/exp2/exp10 (this is the case for i386 > > and m68k). > > Indeed. > > > Furthermore, at least with i686 the use of double_t also does not show > > better performance either. The current sysdeps/i386/fpu/e_exp10.S > > on a recent CPU (Ryzen 9 5900X) with gcc version 13.2.1: > > That's surprising. What happens is that we build with -std=gnu11 which implies > -fexcess-precision=fast. I double-checked on a SkyLake - using double_t is slower > as well. So overall it seems best to let the compiler decide where to use excess > precision. > > > So I am not sure if double_t is really helpful here. > > Unless we decide to move to -fexcess-precision=standard by default I guess - > but there doesn't seem to be an advantage in doing so given that double_t > is slower. the code was written with standard conformance in mind. (i.e. it should have reliable semantics with any iso c compiler.) glibc does not build in standard confrom excess precision mode, so i was using float_t and double_t to avoid changing semantics depending on cflags. (the narrow eval issue was an oversight that can be fixed with a cast.) i did not expect double ops with non-standard excess precision handling to have different performance than long double ops on i386. if that's the case then indeed using float/double directly may be better than float_t/double_t (but keep in mind if somebody builds the code outside the glibc tree to do tests or other analysis the behaviour will be fragile on targets like i386 and m68k. same if we ever want to change the glibc build flags to iso c mode on those targets.)