From patchwork Wed Mar 27 16:45:27 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: 783142 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:b0:33e:7753:30bd with SMTP id p1csp2300832wrt; Wed, 27 Mar 2024 09:48:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWJh4s3mS8BCH0ScZWHfF5NlDk5+XDUgDbKvswE4yLDL4z0KjOGXfBt18NpZPNWO+NENRageEygfTgwUdy5W20j X-Google-Smtp-Source: AGHT+IGRp9OCKMYD8VUASarcW6GLJvjSsjiEFqO4vfCCvCZcbcSrHVjFZS9XKx/2qr7XEsNPAbf+ X-Received: by 2002:a05:622a:1206:b0:431:7ed1:4d2e with SMTP id y6-20020a05622a120600b004317ed14d2emr203126qtx.68.1711558121779; Wed, 27 Mar 2024 09:48:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711558121; cv=pass; d=google.com; s=arc-20160816; b=dA+NusqvxdKspFwKaIOctP/GUh8XonPr9+wT40XVvOJ4/ET26xBv5tOTBkIT1NtXD3 OBFF+i5pIT/h23TBWjybKW6WiHnYdmILC3uSY1FiWsn/ixlga2jBvtqkmhgSY3GDV3hG HB30+d1Sdhx9iijT1BdmuxB0OR2ZXCM6yfd7t4ZvkYZx1y6BAGizs4OkXm/ckkJ2Sf9D ZrI08PQ6Gvz5If/2bhflpG9i7B5ywWwZzOG0z0knJg1Z2snOCQSoJay2XhI2FMCS587+ b3yJyjq4/XFkW/noxnNjKFxRxZfZp1w3WpVrFER6giJHEzMqRlfiTkuGqdjOS6eWe9Uj MXEw== 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=hU0PJbP2URljP7w6Sb0tW3oRuLveUFIgdOvH220fqI0=; fh=WtLnUd2EuDKv+EP3BSdEI8hdivapDDAq3MY9+WgWrlk=; b=zoPW9xrVRmBmZbWACmXK25ZRkyUHntPKSZ3m+ECAUUkFdWUS668mdmEyv9cEiv69Sx jlgiwIz4AzOFUEsw5HYIaD7rN8zItJWjPIbOhyUsqg8lOvt8EbzSZrv0/0pV7rMK+uHr F6wG1AVt9bI25qybqAaSOoimARBfEoJDaeKKEwLPR2AYc64qJ2F5GxtBThYCHD0SlwzN pipfYgWo1EF34GYM79buGQQgrOmFWgU/e8EDcBwh9Igdhw3zqpXitanXPCl1fw/B1GoO q/ozhQWxdNdnwdTjXp9g3bvw2Vyi7AdIL6aTVy8LDdkz/Oq/IGYQaX72fyxmd4Q1kL/y Gh0Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vQ85pN+B; 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 f7-20020a05622a1a0700b004315b469699si6588240qtb.685.2024.03.27.09.48.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 09:48:41 -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=vQ85pN+B; 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 67CF4385C6EE for ; Wed, 27 Mar 2024 16:48:41 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by sourceware.org (Postfix) with ESMTPS id CFDDF385DC18 for ; Wed, 27 Mar 2024 16:46:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CFDDF385DC18 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 CFDDF385DC18 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::62b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711557967; cv=none; b=mwLlpRyhle27g7JgFWVhdrYXmFxrY0DmPAf9e63UuylDN4Re3LktC/3l1fKn/bmQSpeSeLpJt2GwK8QJTJTdH3KFLfpq91iEaAh0Aa6dCCo3Tj2Empkzw11Vf2mSIUbU3pZXzyIiq8hWui2GZzoqWK873/qaQZqYAI6IvLGW3gM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711557967; c=relaxed/simple; bh=Mal+E7LUP0cRsZMKfE9wEUgdvKAA4VRP1nVlPqotcCM=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=TjHeOzaS9eaQkJSDWaIs3Hp5Nn4QwyNsJAOTHdCSQ9OhkQqTZb/ISqfIqmx6DLq6VoPEgZkzG75X2tPmdTkLjQl9PXJKQMTsbGVgn5t8rVlWHbuu+ZUXCxnxabMgNGFzRX7sfkT+8HXQEi3POrbtX2pljWIQkEd8QBDdmPVToAE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1e0f2798cd8so273525ad.3 for ; Wed, 27 Mar 2024 09:46:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711557964; x=1712162764; 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=hU0PJbP2URljP7w6Sb0tW3oRuLveUFIgdOvH220fqI0=; b=vQ85pN+Bv4AsIizOMn73HaRtIdq/Px6mBqR1aSaGnZx8v/SyugOpAWsmm65TWyf2wS EWyWEmVVAn5vt73lCZCHEhgHrPBnKeo0PkL3BC4+rUPuZMCwukpHW3wQ391whLmupcc+ 9td3iqRXNUMQxLjbdXubdT2r/UvIu+8QrGD01TGMtDBk6KpucNY1nzb1LE0XNLJPBRyW 9+IMz/Ela01Had2NLmF8NkpVvyRe79oUzLhqMiGC1DhaTjIGvZTZVYMSBAvw5psA5b4z D20x0FDlWu//Vt1Z8GH4k0x7SSDKJjrZM67PlLdHMjqeO78S4NDEW4+/arQvKWERvcZQ KeEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711557964; x=1712162764; 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=hU0PJbP2URljP7w6Sb0tW3oRuLveUFIgdOvH220fqI0=; b=V6WkdmFb+TNdEegJpI9NqEgIS/KkImBVVronuvUZWOau9qPEtQrvjuTCtoufeZ5VGh fL6UTy8ztxCwEspr7MOggDMp02xoxM/UuUZSLaDxGcVJO2nOsU2cjJwQClmbKKdtnASY zXd0wZEmLYAaOGYujH9SKWbh0sNvKWyMLypUdOGGI9jHHmoncHw9Rsk98kHiAXJm3lhw MHnoKg8dd3SMHFTl8bnP8vycqjjNswu34Xmc87UE5vN3MqYy5HwzBNitzNvYjRAowmt0 JDoFjf6R6NB0i9PE2d0TA5Ov4FWvWVCf1XSaFyx/yJHHIcqMKrlB9kaGEb1wrhVCjELe Prcg== X-Gm-Message-State: AOJu0YzVZyQTzKmAPYP0GCEIf/PkQfGC9XA26IV6qWJZ6wHbjSQhCtMb mAPsTevsYTs/TefjnIPRJ3YCcCxS6wGucsMJAOEJRvQGitffPirV9s+tX+jR6xn2YzoWTd3X1Ty Y X-Received: by 2002:a17:902:d549:b0:1e0:d62e:77d with SMTP id z9-20020a170902d54900b001e0d62e077dmr303951plf.23.1711557964493; Wed, 27 Mar 2024 09:46:04 -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.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 09:46:04 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Joseph Myers , Florian Weimer , "H . J . Lu" Subject: [PATCH 15/15] math: Fix y1 template for arguments less/equal than 0 Date: Wed, 27 Mar 2024 13:45:27 -0300 Message-Id: <20240327164527.3717523-16-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 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_j1_template.c | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/math/Makefile b/math/Makefile index 5807e949d7..b58fca85e4 100644 --- a/math/Makefile +++ b/math/Makefile @@ -373,6 +373,7 @@ libm-test-funcs-auto-static = \ log2 \ log10 \ y0 \ + y1 \ # libm-test-funcs-auto-static libm-test-funcs-noauto-static = \ copysign \ diff --git a/math/w_j1_template.c b/math/w_j1_template.c index 0a97cf9219..addcf4fac9 100644 --- a/math/w_j1_template.c +++ b/math/w_j1_template.c @@ -39,11 +39,19 @@ M_DECL_FUNC (__y1) (FLOAT x) if (__glibc_unlikely (islessequal (x, M_LIT (0.0)))) { if (x < 0) - /* Domain error: y1(x<0). */ - __set_errno (EDOM); + { + /* Domain error: y1(x<0). */ + __feraiseexcept (FE_INVALID); + __set_errno (EDOM); + return NAN; + } else if (x == 0) - /* Pole error: y1(0). */ - __set_errno (ERANGE); + { + /* Pole error: y1(0). */ + __feraiseexcept (FE_DIVBYZERO); + __set_errno (ERANGE); + return -INFINITY; + } } return M_SUF (__ieee754_y1) (x); }