From patchwork Wed Mar 27 16:45:26 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: 1916946 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=bi8U2v60; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) 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 ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4V4Xkq4yZnz1yWr for ; Thu, 28 Mar 2024 03:51:47 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E24713858D20 for ; Wed, 27 Mar 2024 16:51:45 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by sourceware.org (Postfix) with ESMTPS id E7B15385E45F for ; Wed, 27 Mar 2024 16:46:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E7B15385E45F 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 E7B15385E45F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::62f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711557967; cv=none; b=sxUE8N++RlIBHePWnOu7yjN0O5WE3EEAReP3avYFU+9VNRF/Agn1qteicWhPdfQJKw+GxC7nq7iStI3H8LwkBgz/nuNUlR7weSl58bUo/DcxlqrSAJgop6pg4HT4GghiKUUBiBsx7LI1C4ILEe+/XwQcX1FYulxU5uAeU/OxiIk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711557967; c=relaxed/simple; bh=IHVmuW9MM4fKmTcotIQy+gCOD3rsiBO17gs+zD0Nztw=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=eFDzgQ1UjoXw3LMXUqmBO4YDctBmnCm/t/Y2h6sOgiH7KCwA3SOq/4MsQ/IkGJ6jxak7ZvPbwarGeY0jXfGjDH89dIvwnUC4nmSShvujDYQe2NCflqjBPZQbvqV87RbkIMtTrnPocShbuRCb64xqm5ihizqtVeQnNKTdI8bkRrI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1e0878b76f3so649025ad.0 for ; Wed, 27 Mar 2024 09:46:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711557962; x=1712162762; 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=ah4URH/aGPZ0QCEKaSIjDoKiv15ADYgX/jTm5C2jEzI=; b=bi8U2v60z6z422qVu70UWsd3Mw/PcY8RfzRnothUmh6SarLcyY7UgfSyIBKpySgUAp KwZ3OZuUqIc9Y84SLI7gIck7hRbrTHYa9Ri2IB2DkLyeDmqFwXvS77VJyS4BkcRDLIAZ RFJcnY5C9O6bmEXkHw1nsk1jj4lw/7gt05PrZ9MaOa8943pxNGWT0CZrzjNtnhG7lZ8A fqPHVfU1FvuaEitAAOf+adDmgm/d0P7a9YoFF15e3LDJd6Q+I2yCc6rk3jaTnOhVa9WA 6iMGWkaj6PoJi0ZB/y9RhbDzrwpNceq4twkBo4bOMsyyZmsiaCQgZ1MGirWsn+QdsfDI vPlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711557962; x=1712162762; 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=ah4URH/aGPZ0QCEKaSIjDoKiv15ADYgX/jTm5C2jEzI=; b=Upn9MVaBsl1W6wFcOU2Cl07k0EkecxH6AuVl/TulA1Yvb2TmnOc1IVjAe2HXwGuI9a oX8zCB++XIY4ZnularuKhehxA+jSqtou6/0gz5HwpwqtXEfDBcj5tn8pH+rMRK0vUR3W 6KzeWqDjKVBWWQAlOFqraedp6OimVyy5eJ5I139GM7bD+nnz2lTqN6ZZ9LFbnN6mEprl pf0ktjEnyrLFuHaga3TWbf1OT/gKaC2q5DRDqQEE9y6h+4egX0cHKxog8VWbUu52noQD YW3OiOBR/xrWPlFtDdWQFxDST8Mj+Snzuc3PakHy3aw+qka4S6IIkQ7uEnCRCNOTBkfw fWDw== X-Gm-Message-State: AOJu0Yy/ybRpLk78H4Gz7IacvYNUeb/h9sq9vjCntH0JSf2hCkwUPw8+ Gtzp0UmWDovS2YolYMWEyzyUvWQM1VjJoJh0TlYFxhRfOAY5j9ocP5Y4Go0b4WdlUtPWcf1tyCf h X-Google-Smtp-Source: AGHT+IGQ2BtR6xQZ1UBXY89k/CsTqi6fKaGpBlbKC1kOBkxV55U6ujLaTdXLfXqQioZFJXkQEA/NdA== X-Received: by 2002:a17:902:e84c:b0:1dd:69bb:7f96 with SMTP id t12-20020a170902e84c00b001dd69bb7f96mr190653plg.6.1711557962298; Wed, 27 Mar 2024 09:46:02 -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.46.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 09:46:01 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Joseph Myers , Florian Weimer , "H . J . Lu" Subject: [PATCH 14/15] math: Fix y0 template for arguments less/equal than 0 Date: Wed, 27 Mar 2024 13:45:26 -0300 Message-Id: <20240327164527.3717523-15-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+incoming=patchwork.ozlabs.org@sourceware.org The template is used by some ABI for the static build, and it fails to correct return if the argument is less/equal than 0 Checked on x86_64-linux-gnu. --- math/Makefile | 1 + math/w_j0_template.c | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/math/Makefile b/math/Makefile index 7391f2bd41..5807e949d7 100644 --- a/math/Makefile +++ b/math/Makefile @@ -372,6 +372,7 @@ libm-test-funcs-auto-static = \ exp10 \ log2 \ log10 \ + y0 \ # libm-test-funcs-auto-static libm-test-funcs-noauto-static = \ copysign \ diff --git a/math/w_j0_template.c b/math/w_j0_template.c index 1822fc8213..afa2056f96 100644 --- a/math/w_j0_template.c +++ b/math/w_j0_template.c @@ -39,11 +39,19 @@ M_DECL_FUNC (__y0) (FLOAT x) if (__glibc_unlikely (islessequal (x, M_LIT (0.0)))) { if (x < 0) - /* Domain error: y0(x<0). */ - __set_errno (EDOM); + { + /* Domain error: y0(x<0). */ + __feraiseexcept (FE_INVALID); + __set_errno (EDOM); + return NAN; + } else if (x == 0) - /* Pole error: y0(0). */ - __set_errno (ERANGE); + { + /* Pole error: y0(0). */ + __feraiseexcept (FE_DIVBYZERO); + __set_errno (ERANGE); + return -INFINITY; + } } return M_SUF (__ieee754_y0) (x); }