From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on starla X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 97DF91F44D for ; Wed, 3 Apr 2024 11:14:42 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; unprotected) header.d=armh.onmicrosoft.com header.i=@armh.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-armh-onmicrosoft-com header.b=FACVhxSX; dkim=pass (1024-bit key) header.d=armh.onmicrosoft.com header.i=@armh.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-armh-onmicrosoft-com header.b=FACVhxSX; dkim-atps=neutral Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 485B43846405 for ; Wed, 3 Apr 2024 11:14:40 +0000 (GMT) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2076.outbound.protection.outlook.com [40.107.6.76]) by sourceware.org (Postfix) with ESMTPS id 5CAB13847700 for ; Wed, 3 Apr 2024 11:14:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5CAB13847700 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 5CAB13847700 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.6.76 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1712142854; cv=pass; b=ipv09jJ8c+NSOxH65pfcWogbPM6qRMWrlJjUd5gua6oOKYyMveFdOUI4EwpRaqwMEeSoWUSQ/ExLDilkfwZfkdYVYdSy3Vx6mpqkmjkxUzIUWecRFeMV8xM6dAeJv+mMC0QU5qQIc0/SMS4y2ELYOoxrYYvGfbNU5SxjVj7c048= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1712142854; c=relaxed/simple; bh=j7xYeQX65GYIwR+K/FWr9YJmN1mkEx6vVq+IGBXz9GE=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=fE+BTXZz9r8H0RO739stKrSMf8Gxjwu4tRWt+aUmOpSJQds/vbkCGHyl35XwWJovY27L9Cf8mXf9/tPNwyVyGSduQHSE9PULTxrhh3L2gmYdlhpTq0TgVpbnKmcDpYkc/ELjoux6tqnjbiXCCfDcN+JLz6usE9ouYZJBLAGRh9c= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=h+mB1FqHhWoA/dqec8M+7TqXS8NPZTG+TJDPXlsODFqLzbaPuOLRu6fqSHOmBBKO/jYGOeVjNAhlVKWVDrhVh5IRW0VV4eUq8h5rYFZD93Gz9MVRFuutTNZcIft1GRWiPNPMBZx8vsxa7dxTSgqSdW4IflwQL5Zc6jzzWrPpCAes/F8vOfVhyx0DY9vgCCydd/2h5Nhuabr5rw6dfx3KHhJBaU/dR1C9zRl3dHvfODwPkPZqW7MbnIzZX+X/EoDkJnnzJWPcCiJ+7ZLn/S1m2UMw6r/bZReZvjosD+KNCreGrEgvT81KFkN+AiNgPKJPQ5mkYLnPjw1SPpb9PY9ZvQ== 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=j6BdSXXhM/my4++fKN1ui+14ohSNIpn8yL8E7QM86aY=; b=i0o0HWc1lWAZSyhwV07VdHCP+zB0HSr73UVW77ynErVKGpnhvpRTltSJG6HX5nm2vLHve32j8eZcropiIwbirqwhwLmnnoOTRcrj+A3uhjTw5bTwmMV30aGDv3CTkMsdwWdgoeFft3zW8QMQQUXF19b7K1ZTn6eDVP7JWKRrge0xFIITtV9CUzRpdx099/pqrbPL2XDRIRIiVS841u6Xvu+bsWZ99HDhfLGp88Yss5a/W+V1SmkxUp/vd/Pq5+dydwAUW/Kpr+6/5x+dwcpEpK4N18EnBCXcxR2b+0E8d5HwKceRid8fpwW6jWT2sa5vgruqC5O2Rs4vk21xEjSOeQ== 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] 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=j6BdSXXhM/my4++fKN1ui+14ohSNIpn8yL8E7QM86aY=; b=FACVhxSXDwjcC8kN1fZ9H3IsRwvXmY4tQuCo8hdeC2fYiftOHI/UOaWepeUPU+XpvgfGLyd7eYC7bbtmLxsq6clwSWvmZIF43Lqo0EE8auUPaYoeMcA+3cLv0fqixJqSfKgqmeVssG4KKRqF7ZWBMS3WOmA01pICdu4wPFiw4ug= Received: from AM6P192CA0047.EURP192.PROD.OUTLOOK.COM (2603:10a6:209:82::24) by DB8PR08MB5323.eurprd08.prod.outlook.com (2603:10a6:10:fa::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Wed, 3 Apr 2024 11:14:07 +0000 Received: from AMS0EPF000001A1.eurprd05.prod.outlook.com (2603:10a6:209:82:cafe::d9) by AM6P192CA0047.outlook.office365.com (2603:10a6:209:82::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46 via Frontend Transport; Wed, 3 Apr 2024 11:14:07 +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 AMS0EPF000001A1.mail.protection.outlook.com (10.167.16.231) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7452.22 via Frontend Transport; Wed, 3 Apr 2024 11:14:05 +0000 Received: ("Tessian outbound 9d16f63426bd:v300"); Wed, 03 Apr 2024 11:14:05 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: c4e4c8c8196b5b87 X-CR-MTA-TID: 64aa7808 Received: from 15346fb5f20e.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 03FFAEF7-DC47-4DA7-A035-409ECF064B54.1; Wed, 03 Apr 2024 11:13:58 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 15346fb5f20e.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 03 Apr 2024 11:13:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ErTrHPmGwQZyExTOdopga4hY4c+NHtPCH31oUmHQB0hMIVsYOai6MWDcb0Lm2BjbMrU2woh9SJp+gtpnxM5DKCXm3vXN3gVoDsUw8hiHSWVqbihcai0Q1ipzTsVY0pJO/IAopr/kh1JFVDJ73pRh1IIC2c+BneVr87vlDQ8IcE+GJa13clIyCxC9tE0v1y0BBmlmHtQDuN/TL5bw/5sem0msBWnC9VyKSde1RO5X+mdZE5JGaleu8iRztffQcUPu4Y2HOINsiIk2RQU4ogdAPqOHequhDLGmpLqdDOv16JsGSXWgPS3/0lpfu15nfZNSUYsScNVDTbTW6pah/3TeQw== 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=j6BdSXXhM/my4++fKN1ui+14ohSNIpn8yL8E7QM86aY=; b=C0/SNrq2NfVVusYmqoCSay59cbpRen6zSSzHwA7YhalMvwvH49SN9r+v7feOjPrPM4ivl4RYkAehSz+VIOMgpeVkYjffADUV50ETlJDkFUa0f4MumYQWsrvwHLRUhVyHS1vV+BPcDwMlPLO9Rlm1jbQyxvTAbmgbKiUvBJ6BrgRUfdeCI2uZjH441skHMrQ1jD7W8grsgnvL0vQRGIvSsD4VTjRxcNl6plPxJE2/53z6/fKZn4dLL2jJdwMr0tLkwxiiQ/0g3LvkBdHvHAxkX4EYu3Z3KhVVsXPOFwd2YOYqB8G2/87KKuQY0+akJEbrhE0NcWkpMns34W983KxgGA== 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 (0) 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=j6BdSXXhM/my4++fKN1ui+14ohSNIpn8yL8E7QM86aY=; b=FACVhxSXDwjcC8kN1fZ9H3IsRwvXmY4tQuCo8hdeC2fYiftOHI/UOaWepeUPU+XpvgfGLyd7eYC7bbtmLxsq6clwSWvmZIF43Lqo0EE8auUPaYoeMcA+3cLv0fqixJqSfKgqmeVssG4KKRqF7ZWBMS3WOmA01pICdu4wPFiw4ug= Received: from AM6PR10CA0024.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:209:89::37) by DB9PR08MB8505.eurprd08.prod.outlook.com (2603:10a6:10:3d6::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Wed, 3 Apr 2024 11:13:55 +0000 Received: from AMS0EPF0000019F.eurprd05.prod.outlook.com (2603:10a6:209:89:cafe::b3) by AM6PR10CA0024.outlook.office365.com (2603:10a6:209:89::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46 via Frontend Transport; Wed, 3 Apr 2024 11:13:55 +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 AMS0EPF0000019F.mail.protection.outlook.com (10.167.16.251) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7452.22 via Frontend Transport; Wed, 3 Apr 2024 11:13:55 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) 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.35; Wed, 3 Apr 2024 11:13:54 +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.35 via Frontend Transport; Wed, 3 Apr 2024 11:13:54 +0000 From: Joe Ramsay To: CC: , Joe Ramsay Subject: [PATCH 5/8 v2] aarch64/fpu: Add vector variants of atanh Date: Wed, 3 Apr 2024 12:13:53 +0100 Message-ID: <20240403111353.51358-1-Joe.Ramsay@arm.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AMS0EPF0000019F:EE_|DB9PR08MB8505:EE_|AMS0EPF000001A1:EE_|DB8PR08MB5323:EE_ X-MS-Office365-Filtering-Correlation-Id: cf26b346-2340-46a6-5662-08dc53cf2cd7 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: fv6hutI9G8zFukA5pzmE1mPNx3+JBf7wkQW0BYnipPnktGWsB9cfNe1dv8neC0UU1mOAEpoDquzhiMcq3g8phhb3CEzRhfgIJEJuI/nefaEf5KBmv7MxtH7V42curp42E1qwmmfQxAqGqmywNuuFylXuQC6WGvVlMT1qnM3RfqvoI0lFablPwncVr+RLyZMTC7pBwfpDUqEGc1iSgR8eHGZxCaZaVB7U+Yj8NztTdh5Kwg5ySByjo8PMboS2QI9CPLjVmngEO9JNbgWmn6W0cllj4W7bD2GDuRmbdmHmLJ0SmVmMCIfRRPzDG2DjQUy5VYkEgcPzR5Zg9ZKkbqdtp6RnERG/qBcXq26xsUQGwhJws/e8nG21zOVDnWf30t5GlC4ATde5qdwhynVSqs1u8yV4e8PFQYvZTw9N+uYL8vUjG/F/BxV+GdsNUbZDQHJdcdxRXk8bKYr0U6qGWDDFp3YQhr+yv+QE/5IBudW/rJIZ9KlDi5CcjCorXa915QvIqej1rVw4p6q9QaLbJXh139924nfXiCuASWlCMj3FIDs0hAjWkM2Z9Tb7if3mowwst8LdzDoWgVku6BciSCZ4VzWwGvdCiJeZiJ90RGU5paopHeh1CTZR6m7GqWkpUYhx0+BksUw03W0fZ2rwd+uOjAtw4CTHdCip4kZotSTrQXoTwX8a5nhTlr5GUPTi8pRicVePKPTXEyOACFognBeRSg== 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)(36860700004)(1800799015)(376005)(82310400014); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB8505 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AMS0EPF000001A1.eurprd05.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 2806922b-f99d-4d33-7d81-08dc53cf26e8 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nfjmKMPsVRP/zisHF6Ie0S7wE7PnRsKM3OsDK7cvLeEaOEYeYDxPE8x6r9UrjEUEk5HRNh6KQ9Kky1S9yIiyh2NJpk46Og42fAxQOZ5GIhlOTnIse8cnR7JA3emvVoLWcejOrU1N4MPyuUStNQlJziTFzgdzgIXrtoNnsMdMgesXU2ptAfqYTS+D71dJ6c6oRYUmrZoty6VJbjmMKwWOIbJIjJ8qJKBql79u9PqZ0dI7eeVVZzFl1txbUi+ZSAEq/GGDsrrvvroxZXY+mYJ25cdRPFMFAxLJUFqkBvDwa7Omo5reMLBS/yUchEpihB8L+/TfjQl3XA9hbBzWYynDL8eRKFkMVl0fkljw4Gr/hs33XIjRXXfMNzQg5/x8wL4ObncjT+ZYU7P7bwtwHppC4RhFuDngMdhvZKjhHlRFabrjFS/vF0LKR5P9YwnA54EfNADBHawx2Js5WvPjG6Yil9jf9Nc30mZaWOQsvgpZScCCzVR6B7nLUvMqugP2IX3i7VhmpSiDEClnNoY815j75m4yTsh9t13RcWlDDRvx0c5nGek43NDgNqoBfiabIVIokpWueUZ2deQDOmC2tAi4C5kE3rG9IDxV0HRdmpwUMrMWu/1QrrOJJ8HI0ML7WwtwFBBUkosaiIFMa+r5b/Ixs6agXkqt2fPPb+Tla8wgLxanMiBC85da3hzmXsqmKHra5XZTSF2iLJuBZTxLP5GHKA== 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)(36860700004)(376005)(1800799015)(82310400014); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Apr 2024 11:14:05.4632 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cf26b346-2340-46a6-5662-08dc53cf2cd7 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: AMS0EPF000001A1.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB5323 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+e=80x24.org@sourceware.org --- Changes from v1: * Sorted entries in Versions file Will send updated version of this patch and 6/8, which needs a rebase. Thanks, Joe sysdeps/aarch64/fpu/Makefile | 1 + sysdeps/aarch64/fpu/Versions | 5 ++ sysdeps/aarch64/fpu/advsimd_f32_protos.h | 1 + sysdeps/aarch64/fpu/atanh_advsimd.c | 64 +++++++++++++++ sysdeps/aarch64/fpu/atanh_sve.c | 59 ++++++++++++++ sysdeps/aarch64/fpu/atanhf_advsimd.c | 79 +++++++++++++++++++ sysdeps/aarch64/fpu/atanhf_sve.c | 54 +++++++++++++ sysdeps/aarch64/fpu/bits/math-vector.h | 8 ++ .../fpu/test-double-advsimd-wrappers.c | 1 + .../aarch64/fpu/test-double-sve-wrappers.c | 1 + .../aarch64/fpu/test-float-advsimd-wrappers.c | 1 + sysdeps/aarch64/fpu/test-float-sve-wrappers.c | 1 + sysdeps/aarch64/libm-test-ulps | 8 ++ .../unix/sysv/linux/aarch64/libmvec.abilist | 5 ++ 14 files changed, 288 insertions(+) create mode 100644 sysdeps/aarch64/fpu/atanh_advsimd.c create mode 100644 sysdeps/aarch64/fpu/atanh_sve.c create mode 100644 sysdeps/aarch64/fpu/atanhf_advsimd.c create mode 100644 sysdeps/aarch64/fpu/atanhf_sve.c diff --git a/sysdeps/aarch64/fpu/Makefile b/sysdeps/aarch64/fpu/Makefile index d474f2969d..4c878e5906 100644 --- a/sysdeps/aarch64/fpu/Makefile +++ b/sysdeps/aarch64/fpu/Makefile @@ -3,6 +3,7 @@ libmvec-supported-funcs = acos \ asin \ asinh \ atan \ + atanh \ atan2 \ cos \ cosh \ diff --git a/sysdeps/aarch64/fpu/Versions b/sysdeps/aarch64/fpu/Versions index 08ea15efae..092949dc96 100644 --- a/sysdeps/aarch64/fpu/Versions +++ b/sysdeps/aarch64/fpu/Versions @@ -89,6 +89,11 @@ libmvec { _ZGVnN4v_asinhf; _ZGVsMxv_asinh; _ZGVsMxv_asinhf; + _ZGVnN2v_atanh; + _ZGVnN2v_atanhf; + _ZGVnN4v_atanhf; + _ZGVsMxv_atanh; + _ZGVsMxv_atanhf; _ZGVnN2v_cosh; _ZGVnN2v_coshf; _ZGVnN4v_coshf; diff --git a/sysdeps/aarch64/fpu/advsimd_f32_protos.h b/sysdeps/aarch64/fpu/advsimd_f32_protos.h index 1e80721c9f..afbb01e191 100644 --- a/sysdeps/aarch64/fpu/advsimd_f32_protos.h +++ b/sysdeps/aarch64/fpu/advsimd_f32_protos.h @@ -22,6 +22,7 @@ libmvec_hidden_proto (V_NAME_F1(acosh)); libmvec_hidden_proto (V_NAME_F1(asin)); libmvec_hidden_proto (V_NAME_F1(asinh)); libmvec_hidden_proto (V_NAME_F1(atan)); +libmvec_hidden_proto (V_NAME_F1(atanh)); libmvec_hidden_proto (V_NAME_F1(cos)); libmvec_hidden_proto (V_NAME_F1(cosh)); libmvec_hidden_proto (V_NAME_F1(erf)); diff --git a/sysdeps/aarch64/fpu/atanh_advsimd.c b/sysdeps/aarch64/fpu/atanh_advsimd.c new file mode 100644 index 0000000000..3c3d0bd6ad --- /dev/null +++ b/sysdeps/aarch64/fpu/atanh_advsimd.c @@ -0,0 +1,64 @@ +/* Double-precision vector (Advanced SIMD) atanh function + + Copyright (C) 2024 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#define WANT_V_LOG1P_K0_SHORTCUT 0 +#include "v_log1p_inline.h" + +const static struct data +{ + struct v_log1p_data log1p_consts; + uint64x2_t one, half; +} data = { .log1p_consts = V_LOG1P_CONSTANTS_TABLE, + .one = V2 (0x3ff0000000000000), + .half = V2 (0x3fe0000000000000) }; + +static float64x2_t VPCS_ATTR NOINLINE +special_case (float64x2_t x, float64x2_t y, uint64x2_t special) +{ + return v_call_f64 (atanh, x, y, special); +} + +/* Approximation for vector double-precision atanh(x) using modified log1p. + The greatest observed error is 3.31 ULP: + _ZGVnN2v_atanh(0x1.ffae6288b601p-6) got 0x1.ffd8ff31b5019p-6 + want 0x1.ffd8ff31b501cp-6. */ +VPCS_ATTR +float64x2_t V_NAME_D1 (atanh) (float64x2_t x) +{ + const struct data *d = ptr_barrier (&data); + + float64x2_t ax = vabsq_f64 (x); + uint64x2_t ia = vreinterpretq_u64_f64 (ax); + uint64x2_t sign = veorq_u64 (vreinterpretq_u64_f64 (x), ia); + uint64x2_t special = vcgeq_u64 (ia, d->one); + float64x2_t halfsign = vreinterpretq_f64_u64 (vorrq_u64 (sign, d->half)); + +#if WANT_SIMD_EXCEPT + ax = v_zerofy_f64 (ax, special); +#endif + + float64x2_t y; + y = vaddq_f64 (ax, ax); + y = vdivq_f64 (y, vsubq_f64 (v_f64 (1), ax)); + y = log1p_inline (y, &d->log1p_consts); + + if (__glibc_unlikely (v_any_u64 (special))) + return special_case (x, vmulq_f64 (y, halfsign), special); + return vmulq_f64 (y, halfsign); +} diff --git a/sysdeps/aarch64/fpu/atanh_sve.c b/sysdeps/aarch64/fpu/atanh_sve.c new file mode 100644 index 0000000000..7a52728d70 --- /dev/null +++ b/sysdeps/aarch64/fpu/atanh_sve.c @@ -0,0 +1,59 @@ +/* Double-precision vector (SVE) atanh function + + Copyright (C) 2024 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#define WANT_SV_LOG1P_K0_SHORTCUT 0 +#include "sv_log1p_inline.h" + +#define One (0x3ff0000000000000) +#define Half (0x3fe0000000000000) + +static svfloat64_t NOINLINE +special_case (svfloat64_t x, svfloat64_t y, svbool_t special) +{ + return sv_call_f64 (atanh, x, y, special); +} + +/* SVE approximation for double-precision atanh, based on log1p. + The greatest observed error is 2.81 ULP: + _ZGVsMxv_atanh(0x1.ffae6288b601p-6) got 0x1.ffd8ff31b5019p-6 + want 0x1.ffd8ff31b501cp-6. */ +svfloat64_t SV_NAME_D1 (atanh) (svfloat64_t x, const svbool_t pg) +{ + + svfloat64_t ax = svabs_x (pg, x); + svuint64_t iax = svreinterpret_u64 (ax); + svuint64_t sign = sveor_x (pg, svreinterpret_u64 (x), iax); + svfloat64_t halfsign = svreinterpret_f64 (svorr_x (pg, sign, Half)); + + /* It is special if iax >= 1. */ +// svbool_t special = svcmpge (pg, iax, One); + svbool_t special = svacge (pg, x, 1.0); + + /* Computation is performed based on the following sequence of equality: + (1+x)/(1-x) = 1 + 2x/(1-x). */ + svfloat64_t y; + y = svadd_x (pg, ax, ax); + y = svdiv_x (pg, y, svsub_x (pg, sv_f64 (1), ax)); + /* ln((1+x)/(1-x)) = ln(1+2x/(1-x)) = ln(1 + y). */ + y = sv_log1p_inline (y, pg); + + if (__glibc_unlikely (svptest_any (pg, special))) + return special_case (x, svmul_x (pg, halfsign, y), special); + return svmul_x (pg, halfsign, y); +} diff --git a/sysdeps/aarch64/fpu/atanhf_advsimd.c b/sysdeps/aarch64/fpu/atanhf_advsimd.c new file mode 100644 index 0000000000..ae488f7b54 --- /dev/null +++ b/sysdeps/aarch64/fpu/atanhf_advsimd.c @@ -0,0 +1,79 @@ +/* Single-precision vector (Advanced SIMD) atanh function + + Copyright (C) 2024 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include "v_math.h" +#include "v_log1pf_inline.h" + +const static struct data +{ + struct v_log1pf_data log1pf_consts; + uint32x4_t one; +#if WANT_SIMD_EXCEPT + uint32x4_t tiny_bound; +#endif +} data = { + .log1pf_consts = V_LOG1PF_CONSTANTS_TABLE, + .one = V4 (0x3f800000), +#if WANT_SIMD_EXCEPT + /* 0x1p-12, below which atanhf(x) rounds to x. */ + .tiny_bound = V4 (0x39800000), +#endif +}; + +#define AbsMask v_u32 (0x7fffffff) +#define Half v_u32 (0x3f000000) + +static float32x4_t NOINLINE VPCS_ATTR +special_case (float32x4_t x, float32x4_t y, uint32x4_t special) +{ + return v_call_f32 (atanhf, x, y, special); +} + +/* Approximation for vector single-precision atanh(x) using modified log1p. + The maximum error is 3.08 ULP: + __v_atanhf(0x1.ff215p-5) got 0x1.ffcb7cp-5 + want 0x1.ffcb82p-5. */ +VPCS_ATTR float32x4_t NOINLINE V_NAME_F1 (atanh) (float32x4_t x) +{ + const struct data *d = ptr_barrier (&data); + + float32x4_t halfsign = vbslq_f32 (AbsMask, v_f32 (0.5), x); + float32x4_t ax = vabsq_f32 (x); + uint32x4_t iax = vreinterpretq_u32_f32 (ax); + +#if WANT_SIMD_EXCEPT + uint32x4_t special + = vorrq_u32 (vcgeq_u32 (iax, d->one), vcltq_u32 (iax, d->tiny_bound)); + /* Side-step special cases by setting those lanes to 0, which will trigger no + exceptions. These will be fixed up later. */ + if (__glibc_unlikely (v_any_u32 (special))) + ax = v_zerofy_f32 (ax, special); +#else + uint32x4_t special = vcgeq_u32 (iax, d->one); +#endif + + float32x4_t y = vdivq_f32 (vaddq_f32 (ax, ax), vsubq_f32 (v_f32 (1), ax)); + y = log1pf_inline (y, d->log1pf_consts); + + if (__glibc_unlikely (v_any_u32 (special))) + return special_case (x, vmulq_f32 (halfsign, y), special); + return vmulq_f32 (halfsign, y); +} +libmvec_hidden_def (V_NAME_F1 (atanh)) +HALF_WIDTH_ALIAS_F1 (atanh) diff --git a/sysdeps/aarch64/fpu/atanhf_sve.c b/sysdeps/aarch64/fpu/atanhf_sve.c new file mode 100644 index 0000000000..dae83041ef --- /dev/null +++ b/sysdeps/aarch64/fpu/atanhf_sve.c @@ -0,0 +1,54 @@ +/* Single-precision vector (SVE) atanh function + + Copyright (C) 2024 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include "sv_log1pf_inline.h" + +#define One (0x3f800000) +#define Half (0x3f000000) + +static svfloat32_t NOINLINE +special_case (svfloat32_t x, svfloat32_t y, svbool_t special) +{ + return sv_call_f32 (atanhf, x, y, special); +} + +/* Approximation for vector single-precision atanh(x) using modified log1p. + The maximum error is 2.28 ULP: + _ZGVsMxv_atanhf(0x1.ff1194p-5) got 0x1.ffbbbcp-5 + want 0x1.ffbbb6p-5. */ +svfloat32_t SV_NAME_F1 (atanh) (svfloat32_t x, const svbool_t pg) +{ + svfloat32_t ax = svabs_x (pg, x); + svuint32_t iax = svreinterpret_u32 (ax); + svuint32_t sign = sveor_x (pg, svreinterpret_u32 (x), iax); + svfloat32_t halfsign = svreinterpret_f32 (svorr_x (pg, sign, Half)); + svbool_t special = svcmpge (pg, iax, One); + + /* Computation is performed based on the following sequence of equality: + * (1+x)/(1-x) = 1 + 2x/(1-x). */ + svfloat32_t y = svadd_x (pg, ax, ax); + y = svdiv_x (pg, y, svsub_x (pg, sv_f32 (1), ax)); + /* ln((1+x)/(1-x)) = ln(1+2x/(1-x)) = ln(1 + y). */ + y = sv_log1pf_inline (y, pg); + + if (__glibc_unlikely (svptest_any (pg, special))) + return special_case (x, svmul_x (pg, halfsign, y), special); + + return svmul_x (pg, halfsign, y); +} diff --git a/sysdeps/aarch64/fpu/bits/math-vector.h b/sysdeps/aarch64/fpu/bits/math-vector.h index eb2af35b27..ab7a8f7454 100644 --- a/sysdeps/aarch64/fpu/bits/math-vector.h +++ b/sysdeps/aarch64/fpu/bits/math-vector.h @@ -49,6 +49,10 @@ # define __DECL_SIMD_atan __DECL_SIMD_aarch64 # undef __DECL_SIMD_atanf # define __DECL_SIMD_atanf __DECL_SIMD_aarch64 +# undef __DECL_SIMD_atanh +# define __DECL_SIMD_atanh __DECL_SIMD_aarch64 +# undef __DECL_SIMD_atanhf +# define __DECL_SIMD_atanhf __DECL_SIMD_aarch64 # undef __DECL_SIMD_atan2 # define __DECL_SIMD_atan2 __DECL_SIMD_aarch64 # undef __DECL_SIMD_atan2f @@ -137,6 +141,7 @@ __vpcs __f32x4_t _ZGVnN4v_acoshf (__f32x4_t); __vpcs __f32x4_t _ZGVnN4v_asinf (__f32x4_t); __vpcs __f32x4_t _ZGVnN4v_asinhf (__f32x4_t); __vpcs __f32x4_t _ZGVnN4v_atanf (__f32x4_t); +__vpcs __f32x4_t _ZGVnN4v_atanhf (__f32x4_t); __vpcs __f32x4_t _ZGVnN4v_cosf (__f32x4_t); __vpcs __f32x4_t _ZGVnN4v_coshf (__f32x4_t); __vpcs __f32x4_t _ZGVnN4v_erff (__f32x4_t); @@ -157,6 +162,7 @@ __vpcs __f64x2_t _ZGVnN2v_acosh (__f64x2_t); __vpcs __f64x2_t _ZGVnN2v_asin (__f64x2_t); __vpcs __f64x2_t _ZGVnN2v_asinh (__f64x2_t); __vpcs __f64x2_t _ZGVnN2v_atan (__f64x2_t); +__vpcs __f64x2_t _ZGVnN2v_atanh (__f64x2_t); __vpcs __f64x2_t _ZGVnN2v_cos (__f64x2_t); __vpcs __f64x2_t _ZGVnN2v_cosh (__f64x2_t); __vpcs __f64x2_t _ZGVnN2v_erf (__f64x2_t); @@ -182,6 +188,7 @@ __sv_f32_t _ZGVsMxv_acoshf (__sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_asinf (__sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_asinhf (__sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_atanf (__sv_f32_t, __sv_bool_t); +__sv_f32_t _ZGVsMxv_atanhf (__sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_cosf (__sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_coshf (__sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_erff (__sv_f32_t, __sv_bool_t); @@ -202,6 +209,7 @@ __sv_f64_t _ZGVsMxv_acosh (__sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_asin (__sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_asinh (__sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_atan (__sv_f64_t, __sv_bool_t); +__sv_f64_t _ZGVsMxv_atanh (__sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_cos (__sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_cosh (__sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_erf (__sv_f64_t, __sv_bool_t); diff --git a/sysdeps/aarch64/fpu/test-double-advsimd-wrappers.c b/sysdeps/aarch64/fpu/test-double-advsimd-wrappers.c index 3d7177c32d..a01aa99c16 100644 --- a/sysdeps/aarch64/fpu/test-double-advsimd-wrappers.c +++ b/sysdeps/aarch64/fpu/test-double-advsimd-wrappers.c @@ -28,6 +28,7 @@ VPCS_VECTOR_WRAPPER (acosh_advsimd, _ZGVnN2v_acosh) VPCS_VECTOR_WRAPPER (asin_advsimd, _ZGVnN2v_asin) VPCS_VECTOR_WRAPPER (asinh_advsimd, _ZGVnN2v_asinh) VPCS_VECTOR_WRAPPER (atan_advsimd, _ZGVnN2v_atan) +VPCS_VECTOR_WRAPPER (atanh_advsimd, _ZGVnN2v_atanh) VPCS_VECTOR_WRAPPER_ff (atan2_advsimd, _ZGVnN2vv_atan2) VPCS_VECTOR_WRAPPER (cos_advsimd, _ZGVnN2v_cos) VPCS_VECTOR_WRAPPER (cosh_advsimd, _ZGVnN2v_cosh) diff --git a/sysdeps/aarch64/fpu/test-double-sve-wrappers.c b/sysdeps/aarch64/fpu/test-double-sve-wrappers.c index b88a2afe5c..83cb3ad5d0 100644 --- a/sysdeps/aarch64/fpu/test-double-sve-wrappers.c +++ b/sysdeps/aarch64/fpu/test-double-sve-wrappers.c @@ -47,6 +47,7 @@ SVE_VECTOR_WRAPPER (acosh_sve, _ZGVsMxv_acosh) SVE_VECTOR_WRAPPER (asin_sve, _ZGVsMxv_asin) SVE_VECTOR_WRAPPER (asinh_sve, _ZGVsMxv_asinh) SVE_VECTOR_WRAPPER (atan_sve, _ZGVsMxv_atan) +SVE_VECTOR_WRAPPER (atanh_sve, _ZGVsMxv_atanh) SVE_VECTOR_WRAPPER_ff (atan2_sve, _ZGVsMxvv_atan2) SVE_VECTOR_WRAPPER (cos_sve, _ZGVsMxv_cos) SVE_VECTOR_WRAPPER (cosh_sve, _ZGVsMxv_cosh) diff --git a/sysdeps/aarch64/fpu/test-float-advsimd-wrappers.c b/sysdeps/aarch64/fpu/test-float-advsimd-wrappers.c index 533655402d..831d4d7552 100644 --- a/sysdeps/aarch64/fpu/test-float-advsimd-wrappers.c +++ b/sysdeps/aarch64/fpu/test-float-advsimd-wrappers.c @@ -28,6 +28,7 @@ VPCS_VECTOR_WRAPPER (acoshf_advsimd, _ZGVnN4v_acoshf) VPCS_VECTOR_WRAPPER (asinf_advsimd, _ZGVnN4v_asinf) VPCS_VECTOR_WRAPPER (asinhf_advsimd, _ZGVnN4v_asinhf) VPCS_VECTOR_WRAPPER (atanf_advsimd, _ZGVnN4v_atanf) +VPCS_VECTOR_WRAPPER (atanhf_advsimd, _ZGVnN4v_atanhf) VPCS_VECTOR_WRAPPER_ff (atan2f_advsimd, _ZGVnN4vv_atan2f) VPCS_VECTOR_WRAPPER (cosf_advsimd, _ZGVnN4v_cosf) VPCS_VECTOR_WRAPPER (coshf_advsimd, _ZGVnN4v_coshf) diff --git a/sysdeps/aarch64/fpu/test-float-sve-wrappers.c b/sysdeps/aarch64/fpu/test-float-sve-wrappers.c index f7b673e335..96fd612c3e 100644 --- a/sysdeps/aarch64/fpu/test-float-sve-wrappers.c +++ b/sysdeps/aarch64/fpu/test-float-sve-wrappers.c @@ -47,6 +47,7 @@ SVE_VECTOR_WRAPPER (acoshf_sve, _ZGVsMxv_acoshf) SVE_VECTOR_WRAPPER (asinf_sve, _ZGVsMxv_asinf) SVE_VECTOR_WRAPPER (asinhf_sve, _ZGVsMxv_asinhf) SVE_VECTOR_WRAPPER (atanf_sve, _ZGVsMxv_atanf) +SVE_VECTOR_WRAPPER (atanhf_sve, _ZGVsMxv_atanhf) SVE_VECTOR_WRAPPER_ff (atan2f_sve, _ZGVsMxvv_atan2f) SVE_VECTOR_WRAPPER (cosf_sve, _ZGVsMxv_cosf) SVE_VECTOR_WRAPPER (coshf_sve, _ZGVsMxv_coshf) diff --git a/sysdeps/aarch64/libm-test-ulps b/sysdeps/aarch64/libm-test-ulps index dc8cb08b3a..e2b43107e5 100644 --- a/sysdeps/aarch64/libm-test-ulps +++ b/sysdeps/aarch64/libm-test-ulps @@ -173,11 +173,19 @@ double: 2 float: 2 ldouble: 4 +Function: "atanh_advsimd": +double: 1 +float: 1 + Function: "atanh_downward": double: 3 float: 3 ldouble: 4 +Function: "atanh_sve": +double: 2 +float: 1 + Function: "atanh_towardzero": double: 2 float: 2 diff --git a/sysdeps/unix/sysv/linux/aarch64/libmvec.abilist b/sysdeps/unix/sysv/linux/aarch64/libmvec.abilist index f288afdfdd..ce42372a3a 100644 --- a/sysdeps/unix/sysv/linux/aarch64/libmvec.abilist +++ b/sysdeps/unix/sysv/linux/aarch64/libmvec.abilist @@ -77,18 +77,23 @@ GLIBC_2.40 _ZGVnN2v_acosh F GLIBC_2.40 _ZGVnN2v_acoshf F GLIBC_2.40 _ZGVnN2v_asinh F GLIBC_2.40 _ZGVnN2v_asinhf F +GLIBC_2.40 _ZGVnN2v_atanh F +GLIBC_2.40 _ZGVnN2v_atanhf F GLIBC_2.40 _ZGVnN2v_cosh F GLIBC_2.40 _ZGVnN2v_coshf F GLIBC_2.40 _ZGVnN2v_erf F GLIBC_2.40 _ZGVnN2v_erff F GLIBC_2.40 _ZGVnN4v_acoshf F GLIBC_2.40 _ZGVnN4v_asinhf F +GLIBC_2.40 _ZGVnN4v_atanhf F GLIBC_2.40 _ZGVnN4v_coshf F GLIBC_2.40 _ZGVnN4v_erff F GLIBC_2.40 _ZGVsMxv_acosh F GLIBC_2.40 _ZGVsMxv_acoshf F GLIBC_2.40 _ZGVsMxv_asinh F GLIBC_2.40 _ZGVsMxv_asinhf F +GLIBC_2.40 _ZGVsMxv_atanh F +GLIBC_2.40 _ZGVsMxv_atanhf F GLIBC_2.40 _ZGVsMxv_cosh F GLIBC_2.40 _ZGVsMxv_coshf F GLIBC_2.40 _ZGVsMxv_erf F -- 2.27.0