From patchwork Wed Mar 27 16:45:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 783145 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:b0:33e:7753:30bd with SMTP id p1csp2301424wrt; Wed, 27 Mar 2024 09:50:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXrPEVfxly/teLQvn2d3ZupKaAQkR81B/E9UsKXATQ64clnGbqL8LysjYyPwVQhcwf9ufICc+Bpg5cVzyWHXPge X-Google-Smtp-Source: AGHT+IEE+1OZk3cSKFpYa3hiFtYvVL9qR1ChKc6iuAjwvAdDUICoMv1dBFkiNZfJjQLz5P/CJy6Y X-Received: by 2002:a05:6808:148d:b0:3c3:6500:66f1 with SMTP id e13-20020a056808148d00b003c3650066f1mr694776oiw.43.1711558219592; Wed, 27 Mar 2024 09:50:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711558219; cv=pass; d=google.com; s=arc-20160816; b=jfzLU1gWkbuYAY+U0rKQF+ia/vo3+Q6IF36OIlBkw6VVwxodZ0aISbkXyHwygqfQub IQ+AGexDNLK8+1kf9HPWy1ncFI8+8hWDzX833z38nPJjytDDdMG46txaUScxnkmwy4eF KVN9NMVuPIn5ge+EiiX6pegMkLtiy3ZKI/QzU4Fv2KO6VUpi1F62qDpjXonotrMblOUq vOoP+Y3IuoJ/34agxZ/VG9TIS7deKQNnVPfB8u2LNrwHUDVDQmNOsopsyadfUTBtFL/0 V2/gpkph57V7ZTflCZsFzTzsy33vWurt2thEWkbOzzTlqqy93j07wv3+JSMg/C4hjgA9 GYPw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=E6meBW8o0nRpvTFaLF8Ch+/RWgMkapQ5IYEczi9JJmo=; fh=WtLnUd2EuDKv+EP3BSdEI8hdivapDDAq3MY9+WgWrlk=; b=n8CU3kNiUiBUGI0mgE6EVkKlkY9pbEw39np8rl/0k+uPCa6WhJotGGkELuk1x49T38 Jgrose3o2c5rf66pnskJxo7y0vMJ69HPTU6CfwOhOTD1YXOFzdlOEIH7UXn8gwkipKbw iLvEMPgX2NOF2cPeP1SmUl/gAHh0Ib5q/D+K2PjPFw/mNoN0w8FotwOFVrV42o71DdC2 urRFgL33/WJAolqDzZlYltb5Ekr0IIDZDS+Ti7VQfXgBuMylQ0otEYUrzZT1iqXN9BUV y+kf6tFMWprW7tiTa0BkOvTsrfNRPEaY+r2jQJWpR5/ZFlRdPNY0PEjlvRGAagvLkmvU pJsA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jJwG1MdY; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="libc-alpha-bounces+patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id gb14-20020a05622a598e00b00431503e41dcsi7677693qtb.515.2024.03.27.09.50.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 09:50:19 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jJwG1MdY; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="libc-alpha-bounces+patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 37076385E446 for ; Wed, 27 Mar 2024 16:50:19 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by sourceware.org (Postfix) with ESMTPS id BA7CB385E448 for ; Wed, 27 Mar 2024 16:45:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BA7CB385E448 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BA7CB385E448 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::629 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711557959; cv=none; b=bOeH29Qdr9nAID09ngJ9wTOIq2v2vGp4P4pFfNTgou2fSkp3p8xSdiv3MebGSy+RvOemOBaPVaeHgyRAR+mnmtOOaiY1+6xK1Upb8TqhDdvXDqpfZCYNCbyp/Qe/P42x7A9lWHjniuOfdzOdDXU5zn4C9sUUNMrYO5qVHToogdg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711557959; c=relaxed/simple; bh=rr8tM5m4NJ9NHwHGEs52TlBc33W7hoA0JwGSKpgLU8Y=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=fRRSiD0k64zEQahrcclEY+eEqryoiBowssnui4Aj6AGJIBrx6i9rhShwLrxuytgsMkcUD764p4z2v3VcpEWGhiY1Idovd1ntpnydIDlFjkfzxHyruEYUHoaI5VnC320Rq69Ash6/fhVCl4OWJAhRDT/CvcrMUtw8gvJ5Zua8+8Q= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1dde26f7e1dso335055ad.1 for ; Wed, 27 Mar 2024 09:45:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711557956; x=1712162756; darn=sourceware.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=E6meBW8o0nRpvTFaLF8Ch+/RWgMkapQ5IYEczi9JJmo=; b=jJwG1MdY+kofq/FgFygUfMXDtyLQEFpXo31FAttzONL5LYlbkcEYT4IpSha6acQHe1 w7xoTn+gxsFe6QgHGL0jwGGiQhcO4UFKMsJpnSBfYFcBtGPvFyY9QuL336nQshx85yAh viq5WjPPNvjL/XJs/Z9f14Svhwpqzg1q45VSh8PpSpyvs23t1wFjGqxcJAGLZVr8LZg6 e9jGHgHTDDLHO3ckhgL8ct9P6e7MxHENnm3kOnW40eLvpDKJmXN+ttoV1ePaK1XcDPj0 oqxykeEgeDB4lUneepw8ZI0Jv0HFjq8QKtXkbfXYQSJAQ7/8T1FFjQJsA+pENLl17cCh vWlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711557956; x=1712162756; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=E6meBW8o0nRpvTFaLF8Ch+/RWgMkapQ5IYEczi9JJmo=; b=VSU3JwaAKHO+G4ao907Mg7Z0ZOGdpO4uIgeTmf4To09qq1ohKGt4kRlGaUTeMiB1LJ xGD4fAnjChYjLUWbDCYVL0Uq0w+n0b+AY6HEintg7Q/7ylaZnJe4IV6ofwBY3EL82zst bnWhhVGsGrf8rmqv0sEGrOVhpniE6dx/CDUZdv5jyY/c4gcSvmcakjAbgm4a2HP5eNuU XDSczmC30aIpfRNSAZBu83tAGhqVBsq2ChOnsyH1/xLL30x6fdu1FusU3qQynCQKNS1c haAgFwrzgR7FuLHGCHTpEl70CxwWln3sbhpykqGm+olFpveukpHmJzltZ4KrV9AG+J36 DK8w== X-Gm-Message-State: AOJu0YxIg9vsm58bVXf2bIupm2igH4//bw6jAzaeXsch8sP6AKeWsGzB 3WPHjw07Vb+Ucw6c78CMjY66DM9N1b6IyPQHw+FtSIThyVi2L7EqjkJKwZzfwzLPkQklvfWjCm6 e X-Received: by 2002:a17:902:ce86:b0:1e0:b62c:3ae2 with SMTP id f6-20020a170902ce8600b001e0b62c3ae2mr303470plg.10.1711557955939; Wed, 27 Mar 2024 09:45:55 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:b18e:67c4:6248:3d8a:f386]) by smtp.gmail.com with ESMTPSA id c4-20020a170903234400b001e20578b524sm858593plh.252.2024.03.27.09.45.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 09:45:55 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Joseph Myers , Florian Weimer , "H . J . Lu" Subject: [PATCH 11/15] math: Fix acos template for arguments greater than 1 Date: Wed, 27 Mar 2024 13:45:23 -0300 Message-Id: <20240327164527.3717523-12-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240327164527.3717523-1-adhemerval.zanella@linaro.org> References: <20240327164527.3717523-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP 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+patch=linaro.org@sourceware.org The template is used by some ABsI for static build, and it fails set the expected floating exceptions if the argument is outside of the range (on x86_64 this triggers an overflow calculation in __ieee754_acos). Checked on x86_64-linux-gnu. --- math/Makefile | 1 + math/w_acos_template.c | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/math/Makefile b/math/Makefile index af1909d0c7..2b2683a9fa 100644 --- a/math/Makefile +++ b/math/Makefile @@ -368,6 +368,7 @@ $(libm-test-c-narrow-obj): $(objpfx)libm-test%.c: libm-test%.inc \ libm-test-funcs-auto-static = \ + acos \ exp10 \ # libm-test-funcs-auto-static libm-test-funcs-noauto-static = \ diff --git a/math/w_acos_template.c b/math/w_acos_template.c index fe6d6c01db..f4b0e91ae1 100644 --- a/math/w_acos_template.c +++ b/math/w_acos_template.c @@ -30,8 +30,13 @@ FLOAT M_DECL_FUNC (__acos) (FLOAT x) { if (__glibc_unlikely (isgreater (M_FABS (x), M_LIT (1.0)))) - /* Domain error: acos(|x|>1). */ - __set_errno (EDOM); + { + /* Domain error: acos(|x|>1). */ + __feraiseexcept (FE_INVALID); + __set_errno (EDOM); + return __builtin_nanl (""); + } + return M_SUF (__ieee754_acos) (x); } declare_mgen_alias (__acos, acos)