{"id":2175300,"url":"http://patchwork.ozlabs.org/api/1.0/patches/2175300/?format=json","project":{"id":41,"url":"http://patchwork.ozlabs.org/api/1.0/projects/41/?format=json","name":"GNU C Library","link_name":"glibc","list_id":"libc-alpha.sourceware.org","list_email":"libc-alpha@sourceware.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20251217175554.1157780-4-adhemerval.zanella@linaro.org>","date":"2025-12-17T17:51:49","name":"[3/8] x86: Do not use __builtin_isinf_sign for _Float64x/long double","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"ff3ec56840102ee7715305b94a0c19061a9faaa1","submitter":{"id":66065,"url":"http://patchwork.ozlabs.org/api/1.0/people/66065/?format=json","name":"Adhemerval Zanella Netto","email":"adhemerval.zanella@linaro.org"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/glibc/patch/20251217175554.1157780-4-adhemerval.zanella@linaro.org/mbox/","series":[{"id":485739,"url":"http://patchwork.ozlabs.org/api/1.0/series/485739/?format=json","date":"2025-12-17T17:51:48","name":"Improve test when building with clang","version":1,"mbox":"http://patchwork.ozlabs.org/series/485739/mbox/"}],"check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2175300/checks/","tags":{},"headers":{"Return-Path":"<libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org>","X-Original-To":["incoming@patchwork.ozlabs.org","libc-alpha@sourceware.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","libc-alpha@sourceware.org"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256\n header.s=google header.b=Z1s5ZSVi;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org\n (client-ip=38.145.34.32; helo=vm01.sourceware.org;\n envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org;\n receiver=patchwork.ozlabs.org)","sourceware.org;\n\tdkim=pass (2048-bit key,\n unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256\n header.s=google header.b=Z1s5ZSVi","sourceware.org;\n dmarc=pass (p=none dis=none) header.from=linaro.org","sourceware.org; spf=pass smtp.mailfrom=linaro.org","server2.sourceware.org;\n arc=none smtp.remote-ip=209.85.214.179"],"Received":["from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4dWhPz4MvKz1y0P\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 18 Dec 2025 04:59:19 +1100 (AEDT)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 8F1B44BA2E21\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 17 Dec 2025 17:59:17 +0000 (GMT)","from mail-pl1-f179.google.com (mail-pl1-f179.google.com\n [209.85.214.179])\n by sourceware.org (Postfix) with ESMTPS id 172404BA2E24\n for <libc-alpha@sourceware.org>; Wed, 17 Dec 2025 17:56:07 +0000 (GMT)","by mail-pl1-f179.google.com with SMTP id\n d9443c01a7336-2a0f3f74587so44718725ad.2\n for <libc-alpha@sourceware.org>; Wed, 17 Dec 2025 09:56:07 -0800 (PST)","from ubuntu-vm.. ([179.99.163.49]) by smtp.gmail.com with ESMTPSA id\n a92af1059eb24-12061a888a8sm433214c88.9.2025.12.17.09.56.03\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 17 Dec 2025 09:56:05 -0800 (PST)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 8F1B44BA2E21","OpenDKIM Filter v2.11.0 sourceware.org 172404BA2E24"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 172404BA2E24","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 172404BA2E24","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1765994167; cv=none;\n b=Pb/cxUWRMbwEC1ak35yPvGzXCQk0G0T3NJLPLjLNi3F4zS2ZsweqinEPXuACuoapg7e9osgo4Jauy2bmj73oaBuX/H6ST3bwYWGfJhgab9B8fqnFx9t3AREpt6wru2MBqoRIT4QqPN0yLJUWAlVdwOXDZwhT3xJiI6lsrSXeMEI=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1765994167; c=relaxed/simple;\n bh=exWpnmoFfrkTQWtjKRDdfO5v4+anacv7RLbmScbDd1Q=;\n h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version;\n b=f3moV7VTMOL/vaY90JLt4nDP6cOW7qhtq53ujG8tClIAUv9wVlWbLxkwbQtLmr+TI346aC3F410NfTSh3blNqyFy8v5PegsxTuaFE0mqaF+60BtWa+daeBYtclZdNhV3NPvsiMbJvNYQKmmKjCLL5Zn5MF29bmxId+iD+oGle08=","ARC-Authentication-Results":"i=1; server2.sourceware.org","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=linaro.org; s=google; t=1765994166; x=1766598966; darn=sourceware.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=G3P7mKvJ94JBQLHg1+imRU8A8mE7o1dnexuHqxJ9cp0=;\n b=Z1s5ZSViEqBbQ9c85+GJ/hJyB2pkq1BYZyIm714als3uYmmNuRyoLs7MPIwIQ32hpe\n nNKTiCiFVhve9gKf06P5Ms6CPaxmKWw3ta0PiQx8tQR86sYYOh4/ai4QFCtXZAaRYNI/\n Vzo9yPQ4rO/oDcQ2r4uuk2tTFdIiESLjtgpP2GckPt8shyCHexk4t8ac5lsY+kOixvG4\n 9u12F0cWQJ0PksaL/ELmsLw+ue97bbJQ2pj9b1u1GaqM/ToNCmKXRcN5+zVCv3Sb1Gvs\n CPKFa4ib59Fv0vwtq8VTpevonToaUXs+orvSZxh9ccRwGDBn5v41aJq/ypenuMdgOrVn\n kOfA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1765994166; x=1766598966;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=G3P7mKvJ94JBQLHg1+imRU8A8mE7o1dnexuHqxJ9cp0=;\n b=iEvXKFS2GNSmBgSix0gkDm7Q9aEudBw4v7quHdYb/OvGsBmyR6/ittTxzdrsvB289T\n t5mh6RORa4t8f+q1fzTSSHiRl6OoDCCax4A7y8UWvParGG7uUcQ8XhwQHLD2qQ5DE++o\n TE4IzUXWqh0/eX7TaDcDoMjIKkJ7TTZ8KV0Y9GKM2gpEpcQKQCZJ92fk7vtxO8S0s1v+\n GirVr/ZydV4VH31C3ixsUwAV6s6qMVLuQypgP3cf9LDBVYPu5nAue7oHn58ZGp86Dl3N\n w3FLdCFe2YCLsPeklFx8X9ZdjIWHd/bBfUv6F9LubVPJAwZq2EAwFRVwSNaKKZUxWhCs\n 21Ow==","X-Gm-Message-State":"AOJu0YwRzJ8JVrLU5bLnqgauK5GiLtSH4seiztRsk440Xd6st7oNTel0\n VCr0vy3s0LGlUkfOot4znKshqaWt24YQwDkbP48CAc22dpjBCCW31V8ukcmJPX6FYs/3vP9x7d0\n N2syu","X-Gm-Gg":"AY/fxX4dE2v3jo5XD9ovF/wvWXsZ7/S+jkTYgBjQZQ0FtX2QA7Myx1DuXPJUAYTa9P+\n +tAxwewYZ0zfLRvWhFyapYr0KHdEdRG5k1LxmGCoN+BhKhGg0AgobOAQMARhWQqZQc5a0aIQVHL\n e5YD8FYonZ5U0TpS4WwLpWVsP5FaH4UrO+JM6RVdAfQ9iGdVv9iH+WfJsQ0v67xGpAQtQ79gAx3\n 4syx1yahKTRM2NBOwPpFmw5xaZKZ3mna4SH32tvIJT8z/LVVUnDiwiuUGfmuITP1lQ/X0j59JqV\n jK3cjIsqAWcIP2RdJ3XKCsr5us/FTIuvbK0p8Knd1O94xiLl53G8VAZRtD5ex0dlkK2KnisY4vP\n LSE1bR5ZmZQq6Izd7Zdfj63wlfBsiLluTTRWDs4SocFPyj5X1KpW4iR3D5/XLHN85SPRI10A1ZS\n AgbxySsfpBNy+/uKRfou/MueE=","X-Google-Smtp-Source":"\n AGHT+IFUcSFZ2QgqnXnGd/TbeemQ/QY96yQSxjO0lD6VOAzSEEByCuNhgnR0qQMPmiQmKvPRsx/Smw==","X-Received":"by 2002:a05:7022:ed09:b0:119:e569:fbb4 with SMTP id\n a92af1059eb24-11f354dd665mr9759548c88.35.1765994165411;\n Wed, 17 Dec 2025 09:56:05 -0800 (PST)","From":"Adhemerval Zanella <adhemerval.zanella@linaro.org>","To":"libc-alpha@sourceware.org","Cc":"\"H . J . Lu\" <hjl.tools@gmail.com>, Collin Funk <collin.funk1@gmail.com>,\n Sam James <sam@gentoo.org>","Subject":"[PATCH 3/8] x86: Do not use __builtin_isinf_sign for _Float64x/long\n double","Date":"Wed, 17 Dec 2025 14:51:49 -0300","Message-ID":"<20251217175554.1157780-4-adhemerval.zanella@linaro.org>","X-Mailer":"git-send-email 2.43.0","In-Reply-To":"<20251217175554.1157780-1-adhemerval.zanella@linaro.org>","References":"<20251217175554.1157780-1-adhemerval.zanella@linaro.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-BeenThere":"libc-alpha@sourceware.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Libc-alpha mailing list <libc-alpha.sourceware.org>","List-Unsubscribe":"<https://sourceware.org/mailman/options/libc-alpha>,\n <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe>","List-Archive":"<https://sourceware.org/pipermail/libc-alpha/>","List-Post":"<mailto:libc-alpha@sourceware.org>","List-Help":"<mailto:libc-alpha-request@sourceware.org?subject=help>","List-Subscribe":"<https://sourceware.org/mailman/listinfo/libc-alpha>,\n <mailto:libc-alpha-request@sourceware.org?subject=subscribe>","Errors-To":"libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org"},"content":"Neither gcc [1] nor clang [2] handles pseudo-normal numbers correctly\nwith the __builtin_isinf_sign, so disable its usage for _Float64x and\nlong double types.\n\nThis only affects x86, so add a new define __FP_BUILTIN_ISINF_SIGN_DENORMAL\nto gate long double and related types to the libc function instead.\n\nIt fixes the regression on test-ldouble-isinf when built with clang:\n\nFailure: isinf (pseudo_zero): Exception \"Invalid operation\" set\nFailure: isinf (pseudo_inf): Exception \"Invalid operation\" set\nFailure: isinf (pseudo_qnan): Exception \"Invalid operation\" set\nFailure: isinf (pseudo_snan): Exception \"Invalid operation\" set\nFailure: isinf (pseudo_unnormal): Exception \"Invalid operation\" set\nFailure: isinf_downward (pseudo_zero): Exception \"Invalid operation\" set\nFailure: isinf_downward (pseudo_inf): Exception \"Invalid operation\" set\nFailure: isinf_downward (pseudo_qnan): Exception \"Invalid operation\" set\nFailure: isinf_downward (pseudo_snan): Exception \"Invalid operation\" set\nFailure: isinf_downward (pseudo_unnormal): Exception \"Invalid operation\" set\nFailure: isinf_towardzero (pseudo_zero): Exception \"Invalid operation\" set\nFailure: isinf_towardzero (pseudo_inf): Exception \"Invalid operation\" set\nFailure: isinf_towardzero (pseudo_qnan): Exception \"Invalid operation\" set\nFailure: isinf_towardzero (pseudo_snan): Exception \"Invalid operation\" set\nFailure: isinf_towardzero (pseudo_unnormal): Exception \"Invalid operation\" set\nFailure: isinf_upward (pseudo_zero): Exception \"Invalid operation\" set\nFailure: isinf_upward (pseudo_inf): Exception \"Invalid operation\" set\nFailure: isinf_upward (pseudo_qnan): Exception \"Invalid operation\" set\nFailure: isinf_upward (pseudo_snan): Exception \"Invalid operation\" set\nFailure: isinf_upward (pseudo_unnormal): Exception \"Invalid operation\" set\n\nChecked on x86_64-linux-gnu with gcc-15 and clang-18.\n\n[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123173\n[2] https://github.com/llvm/llvm-project/issues/172651\n---\n bits/fp-builtin-denormal.h             | 4 ++++\n math/math.h                            | 5 ++++-\n sysdeps/x86/bits/fp-builtin-denormal.h | 4 ++++\n 3 files changed, 12 insertions(+), 1 deletion(-)","diff":"diff --git a/bits/fp-builtin-denormal.h b/bits/fp-builtin-denormal.h\nindex 77b7184975..5748eb86f0 100644\n--- a/bits/fp-builtin-denormal.h\n+++ b/bits/fp-builtin-denormal.h\n@@ -26,3 +26,7 @@\n     Intel double extended-precision (long double).  By default assume 1 to\n     enable the usage of compiler builtin on math.h.  */\n #define __FP_BUILTIN_FPCLASSIFY_DENORMAL 1\n+\n+/* __FP_BUILTIN_ISINF_SIGN_DENORMAL is defined to 1 if compiler supports\n+   handling pseudo-dernormal numbers with isinf_sign builtin.  */\n+#define __FP_BUILTIN_ISINF_SIGN_DENORMAL 1\ndiff --git a/math/math.h b/math/math.h\nindex cbec2f406a..96b64379f7 100644\n--- a/math/math.h\n+++ b/math/math.h\n@@ -1249,7 +1249,10 @@ enum\n      ? __isinff128 (x) : __builtin_isinf_sign (x))\n # elif (__GNUC_PREREQ (4,4) && !defined __SUPPORT_SNAN__) \\\n        || __glibc_clang_prereq (3,7)\n-#  define isinf(x) __builtin_isinf_sign (x)\n+#  define isinf(x) __MATH_TG_BUILTIN_CLASSIFY ((x),\t\t\t      \\\n+\t\t\t\t\t       __builtin_isinf_sign, (x),     \\\n+\t\t\t\t\t       isinf, (x),\t\t      \\\n+\t\t\t\t\t       __FP_BUILTIN_ISINF_SIGN_DENORMAL)\n # else\n #  define isinf(x) __MATH_TG ((x), __isinf, (x))\n # endif\ndiff --git a/sysdeps/x86/bits/fp-builtin-denormal.h b/sysdeps/x86/bits/fp-builtin-denormal.h\nindex bfb8f54237..2f9a5c7b66 100644\n--- a/sysdeps/x86/bits/fp-builtin-denormal.h\n+++ b/sysdeps/x86/bits/fp-builtin-denormal.h\n@@ -23,3 +23,7 @@\n /* Neither GCC (bug 123161) nor clang (issue 172533) handles pseudo-normal\n    numbers correctly with fpclassify builtin.  */\n #define __FP_BUILTIN_FPCLASSIFY_DENORMAL 0\n+\n+/* Neither GCC (bug 123173) nor clang (issue 172651) handles pseudo-normal\n+   numbers correctly with isinf_sign builtin.  */\n+#define __FP_BUILTIN_ISINF_SIGN_DENORMAL 0\n","prefixes":["3/8"]}