From patchwork Wed Oct 4 09:40:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Ramsay X-Patchwork-Id: 77087 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 41BBA387542C for ; Wed, 4 Oct 2023 09:40:40 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2075.outbound.protection.outlook.com [40.107.6.75]) by sourceware.org (Postfix) with ESMTPS id 34442386183A for ; Wed, 4 Oct 2023 09:40:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 34442386183A 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=uNpi6ePde9wkCertWspZ9RfCUswLmL99yDwnUAqwGNc=; b=fV2laPNgiZ32nLLlbGFBITQzEEL6hfhJBasah03ng/7KXVv+dng5rvvkYvvfrJ5xdffFItyBsDJ3VsoO5yVRx357KXtzznUXoGpzakFQQQM2bHyFzkSMqbWPc5Nb7jzGDGvMvRSkCsA7c+anvJ3oMMZFr1uoSVsgW3yqL7iaCbQ= Received: from AS9PR0301CA0051.eurprd03.prod.outlook.com (2603:10a6:20b:469::28) by PA4PR08MB7618.eurprd08.prod.outlook.com (2603:10a6:102:273::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.29; Wed, 4 Oct 2023 09:40:21 +0000 Received: from AM7EUR03FT032.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:469:cafe::19) by AS9PR0301CA0051.outlook.office365.com (2603:10a6:20b:469::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.33 via Frontend Transport; Wed, 4 Oct 2023 09:40:21 +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 AM7EUR03FT032.mail.protection.outlook.com (100.127.140.65) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.26 via Frontend Transport; Wed, 4 Oct 2023 09:40:20 +0000 Received: ("Tessian outbound ab4fc72d2cd4:v211"); Wed, 04 Oct 2023 09:40:20 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 53f19744d90e3ab0 X-CR-MTA-TID: 64aa7808 Received: from 89b5f06cf6cd.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 0D73CE20-593B-45D6-8CA1-C22B89E9E3F8.1; Wed, 04 Oct 2023 09:40:13 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 89b5f06cf6cd.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 04 Oct 2023 09:40:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Kt/jnFSewzxnmPM/imFw8NZ/XJgc2wUlRn34B4HRyY1i8gnuissEDIpdu2sdwffiLLf8EraoKJ5cRUgmfYS1aO9gnn9paYJ9LdIkwMgr/NKGsJcCR/xfqt28ZCIK6fUTlZFkzcepy6RXNZ8RhcoRuZnhc7hv8bhyFarhIpbTMHW61/ZQZZr3P62Yo8tLtKJff0NkF73MyaykFTGicGzA1Vkg+QQC+3MbiQd3ZuLeNqWvcY1GY9nQeE7X7d5t1/BtrIsrBi72ORK2PnT0mvqYzdM9d6JPyCo3v4LldyzWYdckoC9fHjYNmVpOd18zN15iL3RnJU3w6FvDjDngWH08Mw== 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=uNpi6ePde9wkCertWspZ9RfCUswLmL99yDwnUAqwGNc=; b=Et0ZR7bVoHk9QYxD/RETTWCkOiESHk0WusHdiTQ4z7a9Da9nOUQXLDF1toDBkeMDQUqK5snuo/xvjD6waub/TvMaqwM9n02taKuXb7aaGwW6Dt6rr8uTFXnlceEggp0MsTlcti+veANCPUbTle/mU1mzLwGs8w2QMYn21U6d5YRybR/hFPyJA7V7msNlxOeEppC9P04BQLW2S3oxu0yWOsX/3H6Io31mc4+IdW5jXWehXCY60NyL8DS/GXGutkLe+thSbEfjpYSPI1lImDdUA5SkkAfJSVo7D/P5NavDw9d084LQQ94qLlxesIr9sGVZwanERDR32J1+Wrl/azMcEA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); 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=uNpi6ePde9wkCertWspZ9RfCUswLmL99yDwnUAqwGNc=; b=fV2laPNgiZ32nLLlbGFBITQzEEL6hfhJBasah03ng/7KXVv+dng5rvvkYvvfrJ5xdffFItyBsDJ3VsoO5yVRx357KXtzznUXoGpzakFQQQM2bHyFzkSMqbWPc5Nb7jzGDGvMvRSkCsA7c+anvJ3oMMZFr1uoSVsgW3yqL7iaCbQ= Received: from AS8PR07CA0005.eurprd07.prod.outlook.com (2603:10a6:20b:451::32) by PAVPR08MB8821.eurprd08.prod.outlook.com (2603:10a6:102:2fc::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.33; Wed, 4 Oct 2023 09:40:10 +0000 Received: from AM7EUR03FT053.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:451:cafe::2a) by AS8PR07CA0005.outlook.office365.com (2603:10a6:20b:451::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.25 via Frontend Transport; Wed, 4 Oct 2023 09:40:10 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by AM7EUR03FT053.mail.protection.outlook.com (100.127.140.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6863.26 via Frontend Transport; Wed, 4 Oct 2023 09:40:10 +0000 Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 4 Oct 2023 09:40:06 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 4 Oct 2023 09:40:06 +0000 Received: from vcn-man-apps.manchester.arm.com (10.32.108.22) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.27 via Frontend Transport; Wed, 4 Oct 2023 09:40:06 +0000 From: Joe Ramsay To: CC: Joe Ramsay Subject: [PATCH] aarch64: Cosmetic change in SVE exp routines Date: Wed, 4 Oct 2023 10:40:04 +0100 Message-ID: <20231004094004.49030-1-Joe.Ramsay@arm.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT053:EE_|PAVPR08MB8821:EE_|AM7EUR03FT032:EE_|PA4PR08MB7618:EE_ X-MS-Office365-Filtering-Correlation-Id: cd0cd706-3e82-41a6-fc23-08dbc4bded2c 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: 4eBy9Wy7ylQXPlxl5bR7HhwTvWOBWzJIH8B0Kr56jAgModTfQ33H4vvNzcR/SotUAjyXeC9x4Y8NYS7Hlyre09R0/oSoZs9GkTz5BvQ9X9FgFd6GW1DgAHhigAZHq/jxFX843GXbJxc7dilurEOSkuW0C2tOT0M7gRW3FK9BlWRgGB7Xu83oMFcHl74G0n8nivgW//gOspO199cfrwzhb30VjAX9/KmcrO/2fzFv76fItQNlOI9ZKNVsROr2kB28hRFOKX6ewMXAPy2Dt/9WWsaw6KZauYPs/xFGMW10EjYST1nzxDaVmI2JE+dflkAhBZSQOV7l28tFD7MwEyFB2RYcRrbc00BVJJHvowNYbnN7DEWxw8/bopWoI7FfR1pPd7u1WZ6OvL0OQ+j8lYDKS7I7ftwSUNh/724LwOytPIGeUKsB7ApSq0LdbF0OMVEoI/6tBP9Zie2B35cz0KsZxi7wzvvEimz8XraVily8Yf+wZn28ywtleT3KlgrmAKkvbalSzVc12aOR8Tdo3Ea/Pk6wADi4J80jELcxo9OogvpzBf2B1HaWBCrZDhlV8crhIRE057D1Gf/Km2Zalo+jc0k6YJq0hKSmpNrQgYlixpfSyz3ui6AjwEJpEDbQ3Iu+LiKSqIdI44wX9m4lpfp24dnDZdHmjnLViQ9aUCyqxfS9+e9dmzbKR3ytz8jf/srwKJOYdOXqMYAqtA4LCdLq1gOcSfbtvGOd85YusL6sI5N7TPi+qhHCjdXRsUFCtCjl8BVSMmu0CWlabeSTd1/l52V0jnFe2cc8D4jRG2opUnc= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:nebula.arm.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(4636009)(396003)(376002)(136003)(39860400002)(346002)(230922051799003)(64100799003)(1800799009)(451199024)(186009)(82310400011)(46966006)(36840700001)(40470700004)(40460700003)(40480700001)(7696005)(478600001)(82740400003)(36860700001)(356005)(86362001)(81166007)(2906002)(6916009)(4326008)(47076005)(2616005)(426003)(336012)(26005)(83380400001)(1076003)(36756003)(70206006)(70586007)(41300700001)(8936002)(5660300002)(316002)(8676002)(36900700001)(473944003); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR08MB8821 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT032.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: a51fcd20-89b5-4224-0211-08dbc4bde719 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2KvGJerktGqzoAXsYJLInV/xsxSzD9l4hqg65rfEF4/x5dDnIpdHyv9TzkPY3MoVuxRSXAnTRlSwEYwSMdWUgedGXflpI0V2VxSk7r4bvoWEc/9AAisk+ryXuyYu0NdeS2HHo5fzQKQEjpFxfuWgw7ceLj/z1nmaRX/LaAf8kaYpTmvYUb9Hr167t3E5EbXUzBJmbP5IDyNk9DU+yyZ4jrFemoKD579LlHZNWqYJtpSHD766NuTDBecwRV1flB6t0FrcVVqqT8zV65c7rK8kBOiDPvRqqRnObJwrK+93jh/GrBq2HmmumVtLr1GigbJFIIps53zX+sn3lN5pl8BpjBYBe3McLIEVSN7CeEifvvArJvZJTDH8EHTm1Ys0apLW7dQ4YU8t8OrKieq7Fr/AOAiyBSDseGAhOAOG9oPXNBzSapWkKVfcCbWUGomwMwwVWN6/+0vSeku5nw9iBzaVUWDfcPw/Fy5V1rIdmOtkozZoz4T0SGpmYC+NE1lfPpSletwhR6tnzUCJvWI7pa24J98+csDjajcbG5CtAfXuiBAjKvE8I0xxoNUVeR5yLtWLUkG25o1eHyF6ocsDq2FS7E3I6Kj2WAp5RlgR0l1uEhOSx6gzEq9On9G2LdC7+rX6EJvKHQs0CKxOL9X1LKV/+gSy9dU4ap/i5u8f6GZgvW0J49W+uqjn67UwJZcsdquXWn5H5r5Ko8ezIkr2PNV+LZ9fe604uhSzNJAbdDSMbAuUeT0Vly2DhSTe8QxqGns35CawtE05fZqqm2JNgS6Bww== 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)(39860400002)(396003)(376002)(346002)(136003)(230922051799003)(1800799009)(186009)(82310400011)(64100799003)(451199024)(36840700001)(46966006)(40470700004)(7696005)(478600001)(83380400001)(426003)(336012)(26005)(1076003)(2616005)(2906002)(41300700001)(316002)(70206006)(70586007)(6916009)(4326008)(5660300002)(8936002)(8676002)(36756003)(86362001)(36860700001)(47076005)(81166007)(82740400003)(40480700001)(40460700003)(473944003); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2023 09:40:20.9287 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cd0cd706-3e82-41a6-fc23-08dbc4bded2c 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: AM7EUR03FT032.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB7618 X-Spam-Status: No, score=-12.6 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.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Use overloaded intrinsics for readability. Codegen does not change, however while we're bringing the routines up-to-date with recent improvements to other routines in AOR it is worth copying this change over as well. --- Thanks, Joe sysdeps/aarch64/fpu/exp_sve.c | 58 ++++++++++++++++------------------ sysdeps/aarch64/fpu/expf_sve.c | 33 ++++++++++--------- 2 files changed, 44 insertions(+), 47 deletions(-) diff --git a/sysdeps/aarch64/fpu/exp_sve.c b/sysdeps/aarch64/fpu/exp_sve.c index ec0932bd70..02304c38b4 100644 --- a/sysdeps/aarch64/fpu/exp_sve.c +++ b/sysdeps/aarch64/fpu/exp_sve.c @@ -52,26 +52,26 @@ special_case (svbool_t pg, svfloat64_t s, svfloat64_t y, svfloat64_t n) and s1*s1 overflows only if n>0. */ /* If n<=0 then set b to 0x6, 0 otherwise. */ - svbool_t p_sign = svcmple_n_f64 (pg, n, 0.0); /* n <= 0. */ + svbool_t p_sign = svcmple (pg, n, 0.0); /* n <= 0. */ svuint64_t b - = svdup_n_u64_z (p_sign, SpecialOffset); /* Inactive lanes set to 0. */ + = svdup_u64_z (p_sign, SpecialOffset); /* Inactive lanes set to 0. */ /* Set s1 to generate overflow depending on sign of exponent n. */ - svfloat64_t s1 = svreinterpret_f64_u64 ( - svsubr_n_u64_x (pg, b, SpecialBias1)); /* 0x70...0 - b. */ + svfloat64_t s1 = svreinterpret_f64 ( + svsubr_x (pg, b, SpecialBias1)); /* 0x70...0 - b. */ /* Offset s to avoid overflow in final result if n is below threshold. */ - svfloat64_t s2 = svreinterpret_f64_u64 (svadd_u64_x ( - pg, svsub_n_u64_x (pg, svreinterpret_u64_f64 (s), SpecialBias2), - b)); /* as_u64 (s) - 0x3010...0 + b. */ + svfloat64_t s2 = svreinterpret_f64 ( + svadd_x (pg, svsub_x (pg, svreinterpret_u64 (s), SpecialBias2), + b)); /* as_u64 (s) - 0x3010...0 + b. */ /* |n| > 1280 => 2^(n) overflows. */ - svbool_t p_cmp = svacgt_n_f64 (pg, n, 1280.0); + svbool_t p_cmp = svacgt (pg, n, 1280.0); - svfloat64_t r1 = svmul_f64_x (pg, s1, s1); - svfloat64_t r2 = svmla_f64_x (pg, s2, s2, y); - svfloat64_t r0 = svmul_f64_x (pg, r2, s1); + svfloat64_t r1 = svmul_x (pg, s1, s1); + svfloat64_t r2 = svmla_x (pg, s2, s2, y); + svfloat64_t r0 = svmul_x (pg, r2, s1); - return svsel_f64 (p_cmp, r1, r0); + return svsel (p_cmp, r1, r0); } /* SVE exp algorithm. Maximum measured error is 1.01ulps: @@ -81,7 +81,7 @@ svfloat64_t SV_NAME_D1 (exp) (svfloat64_t x, const svbool_t pg) { const struct data *d = ptr_barrier (&data); - svbool_t special = svacgt_n_f64 (pg, x, d->thres); + svbool_t special = svacgt (pg, x, d->thres); /* Use a modifed version of the shift used for flooring, such that x/ln2 is rounded to a multiple of 2^-6=1/64, shift = 1.5 * 2^52 * 2^-6 = 1.5 * @@ -100,26 +100,26 @@ svfloat64_t SV_NAME_D1 (exp) (svfloat64_t x, const svbool_t pg) We add 1023 to the modified shift value in order to set bits 16:6 of u to 1, such that once these bits are moved to the exponent of the output of FEXPA, we get the exponent of 2^n right, i.e. we get 2^m. */ - svfloat64_t z = svmla_n_f64_x (pg, sv_f64 (d->shift), x, d->inv_ln2); - svuint64_t u = svreinterpret_u64_f64 (z); - svfloat64_t n = svsub_n_f64_x (pg, z, d->shift); + svfloat64_t z = svmla_x (pg, sv_f64 (d->shift), x, d->inv_ln2); + svuint64_t u = svreinterpret_u64 (z); + svfloat64_t n = svsub_x (pg, z, d->shift); /* r = x - n * ln2, r is in [-ln2/(2N), ln2/(2N)]. */ - svfloat64_t ln2 = svld1rq_f64 (svptrue_b64 (), &d->ln2_hi); - svfloat64_t r = svmls_lane_f64 (x, n, ln2, 0); - r = svmls_lane_f64 (r, n, ln2, 1); + svfloat64_t ln2 = svld1rq (svptrue_b64 (), &d->ln2_hi); + svfloat64_t r = svmls_lane (x, n, ln2, 0); + r = svmls_lane (r, n, ln2, 1); /* y = exp(r) - 1 ~= r + C0 r^2 + C1 r^3 + C2 r^4 + C3 r^5. */ - svfloat64_t r2 = svmul_f64_x (pg, r, r); - svfloat64_t p01 = svmla_f64_x (pg, C (0), C (1), r); - svfloat64_t p23 = svmla_f64_x (pg, C (2), C (3), r); - svfloat64_t p04 = svmla_f64_x (pg, p01, p23, r2); - svfloat64_t y = svmla_f64_x (pg, r, p04, r2); + svfloat64_t r2 = svmul_x (pg, r, r); + svfloat64_t p01 = svmla_x (pg, C (0), C (1), r); + svfloat64_t p23 = svmla_x (pg, C (2), C (3), r); + svfloat64_t p04 = svmla_x (pg, p01, p23, r2); + svfloat64_t y = svmla_x (pg, r, p04, r2); /* s = 2^n, computed using FEXPA. FEXPA does not propagate NaNs, so for consistent NaN handling we have to manually propagate them. This comes at significant performance cost. */ - svfloat64_t s = svexpa_f64 (u); + svfloat64_t s = svexpa (u); /* Assemble result as exp(x) = 2^n * exp(r). If |x| > Thresh the multiplication may overflow, so use special case routine. */ @@ -129,14 +129,12 @@ svfloat64_t SV_NAME_D1 (exp) (svfloat64_t x, const svbool_t pg) /* FEXPA zeroes the sign bit, however the sign is meaningful to the special case function so needs to be copied. e = sign bit of u << 46. */ - svuint64_t e - = svand_n_u64_x (pg, svlsl_n_u64_x (pg, u, 46), 0x8000000000000000); + svuint64_t e = svand_x (pg, svlsl_x (pg, u, 46), 0x8000000000000000); /* Copy sign to s. */ - s = svreinterpret_f64_u64 ( - svadd_u64_x (pg, e, svreinterpret_u64_f64 (s))); + s = svreinterpret_f64 (svadd_x (pg, e, svreinterpret_u64 (s))); return special_case (pg, s, y, n); } /* No special case. */ - return svmla_f64_x (pg, s, s, y); + return svmla_x (pg, s, s, y); } diff --git a/sysdeps/aarch64/fpu/expf_sve.c b/sysdeps/aarch64/fpu/expf_sve.c index 03f2e086ed..3ee794e988 100644 --- a/sysdeps/aarch64/fpu/expf_sve.c +++ b/sysdeps/aarch64/fpu/expf_sve.c @@ -60,31 +60,30 @@ svfloat32_t SV_NAME_F1 (exp) (svfloat32_t x, const svbool_t pg) /* Load some constants in quad-word chunks to minimise memory access (last lane is wasted). */ - svfloat32_t invln2_and_ln2 = svld1rq_f32 (svptrue_b32 (), &d->inv_ln2); + svfloat32_t invln2_and_ln2 = svld1rq (svptrue_b32 (), &d->inv_ln2); /* n = round(x/(ln2/N)). */ - svfloat32_t z = svmla_lane_f32 (sv_f32 (d->shift), x, invln2_and_ln2, 0); - svfloat32_t n = svsub_n_f32_x (pg, z, d->shift); + svfloat32_t z = svmla_lane (sv_f32 (d->shift), x, invln2_and_ln2, 0); + svfloat32_t n = svsub_x (pg, z, d->shift); /* r = x - n*ln2/N. */ - svfloat32_t r = svmls_lane_f32 (x, n, invln2_and_ln2, 1); - r = svmls_lane_f32 (r, n, invln2_and_ln2, 2); + svfloat32_t r = svmls_lane (x, n, invln2_and_ln2, 1); + r = svmls_lane (r, n, invln2_and_ln2, 2); -/* scale = 2^(n/N). */ - svbool_t is_special_case = svacgt_n_f32 (pg, x, d->thres); - svfloat32_t scale = svexpa_f32 (svreinterpret_u32_f32 (z)); + /* scale = 2^(n/N). */ + svbool_t is_special_case = svacgt (pg, x, d->thres); + svfloat32_t scale = svexpa (svreinterpret_u32 (z)); /* y = exp(r) - 1 ~= r + C0 r^2 + C1 r^3 + C2 r^4 + C3 r^5 + C4 r^6. */ - svfloat32_t p12 = svmla_f32_x (pg, C (1), C (2), r); - svfloat32_t p34 = svmla_f32_x (pg, C (3), C (4), r); - svfloat32_t r2 = svmul_f32_x (pg, r, r); - svfloat32_t p14 = svmla_f32_x (pg, p12, p34, r2); - svfloat32_t p0 = svmul_f32_x (pg, r, C (0)); - svfloat32_t poly = svmla_f32_x (pg, p0, r2, p14); + svfloat32_t p12 = svmla_x (pg, C (1), C (2), r); + svfloat32_t p34 = svmla_x (pg, C (3), C (4), r); + svfloat32_t r2 = svmul_x (pg, r, r); + svfloat32_t p14 = svmla_x (pg, p12, p34, r2); + svfloat32_t p0 = svmul_x (pg, r, C (0)); + svfloat32_t poly = svmla_x (pg, p0, r2, p14); if (__glibc_unlikely (svptest_any (pg, is_special_case))) - return special_case (x, svmla_f32_x (pg, scale, scale, poly), - is_special_case); + return special_case (x, svmla_x (pg, scale, scale, poly), is_special_case); - return svmla_f32_x (pg, scale, scale, poly); + return svmla_x (pg, scale, scale, poly); }