{"id":2175299,"url":"http://patchwork.ozlabs.org/api/1.0/patches/2175299/?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-9-adhemerval.zanella@linaro.org>","date":"2025-12-17T17:51:54","name":"[8/8] math: Use math_opt_barrier on underflow/overflow","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"fb55a51d5de9b555559f6406ad6c3b6793337a18","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-9-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/2175299/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=Rm0aab5m;\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=Rm0aab5m","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.210.169"],"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 4dWhMM5BWvz1y0P\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 18 Dec 2025 04:57:03 +1100 (AEDT)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 7C2374BA2E2E\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 17 Dec 2025 17:57:01 +0000 (GMT)","from mail-pf1-f169.google.com (mail-pf1-f169.google.com\n [209.85.210.169])\n by sourceware.org (Postfix) with ESMTPS id A03574BA2E07\n for <libc-alpha@sourceware.org>; Wed, 17 Dec 2025 17:56:16 +0000 (GMT)","by mail-pf1-f169.google.com with SMTP id\n d2e1a72fcca58-7bab7c997eeso6792886b3a.0\n for <libc-alpha@sourceware.org>; Wed, 17 Dec 2025 09:56:16 -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.13\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 17 Dec 2025 09:56:14 -0800 (PST)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 7C2374BA2E2E","OpenDKIM Filter v2.11.0 sourceware.org A03574BA2E07"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org A03574BA2E07","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org A03574BA2E07","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1765994176; cv=none;\n b=WIAX7q8wun0U3/h1gTv8thM22JfjUBt2ZH8tvJKeC695DLWPCifkqGknoVvVAyX0IK3awRhEI9nuArFuTtPuxo+Si6Q+H0/djBfcavBS4+rHt8LG3wlIGFxcd1NkbAoU3h99Pg1GTcP4eWAvbE3jjZERGWQy0rg14RMVDe4r75s=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1765994176; c=relaxed/simple;\n bh=tdjwGEQSOzGSzXuGYy089KZsQq/a/YjaILNWfzqpKFU=;\n h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version;\n b=i8YMG35UYo/aD1xhK4ri/ioVOF46G10HJHQLVARM7QwjfezqtuZrgpmVyOn11UzqrYxcRBqPR/PSYYMg/ZQIrq8ZX0+s+FcQTocL/MMSwZWhW9x61i+d4bYXUXdb/bmSATQNG2vhWE/ViOVRw19uEK5Zgbqg+pUF1+SGpvlJbgQ=","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=1765994175; x=1766598975; 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=Wu4fTwHCw47vwRzhDsjFFiZlgx/xSKGBFcFUwA9Q+7k=;\n b=Rm0aab5mUpJZ7Pr+TYX15v4HpLw/oqHWMcU+O0xZzY0AANXoN1WUd42xHUj0pyeE1h\n E4MSi7h335lqynaiZssTxOvoPyVj3QDbHLuVAnN9Ly2+EmFmsJ++Jn+ph7AIGPgfEEhP\n ganSmSyuvGkxWClfOn232y65KVHIOij6rp46+yJYOrRHTYVXxnbCKcT8zBHt93AXWfTW\n j1BroCymRCgZAPii1pd62cfTgp6EMsyd2w8aJHhyMsjdLkIeRxotSDdZppJTA/4BVyko\n rpeJgB9CHQNsGdDrQUB7cXNou5sHeKVL5njGGBkc2wemWVFL7o/ytSDQ1UV3I+jomqZt\n SRLA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1765994175; x=1766598975;\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=Wu4fTwHCw47vwRzhDsjFFiZlgx/xSKGBFcFUwA9Q+7k=;\n b=E/geGc4KjTHMQRmOS7vknVnt+42r0unmawSf62jxqwmGhsj/IXA4C7FsmcH0k6mTFy\n X5Zj88XXRF12f87mMYrgoE/kT5pdaUqW/Mx+6oaUQGaGg0okiPZY1pgoCT+rvYeQ0UCg\n BlrF2tTjs4aMuyvL1zf+G64VEIdvCN0dAPZUdH/w2Z7kZqZOQdgfhVOAfKI/3jjp91wY\n to0WxnR2XV6KfeNINlEIw1Mv50BPfynQ1D0w5g/7jsICSiC9grefddzNoOVdRd3+swLI\n Xio07ERUGzO4LnN96UyMfNivORw8AKPbfwazs0Rcd+Lo+BIkAdn3R309H/V5Q2ceNL1Y\n Xe6A==","X-Gm-Message-State":"AOJu0YwNhzgklqtk3WDUHDyVJZJvXZQaJ282meflYU3fTyV6e7bpNFSB\n qSj8CL98puOlbedkl/Cj7/U4grpI5YX5HQPtaIqCS1QP4Wm3mBVJmpMnsF6S21ZUYGHSfRFup2c\n U1ExL","X-Gm-Gg":"AY/fxX45v35af1Dm/X2Vqaj3aE2p07FfbYx6ABBKVzQ1783BIIdtlp2GdoIUMngCL9y\n 3MPw6ByJk46QE5TUVV+gtrzgjXBsLJ+6a0SiQZnLaQEvf5ReoO5RdAcLBRZwff97c/yEH9sNiLq\n t+u8TkTfAwjEiL0VAl6ArfWwyXSVO3e3kt9UQEgleKEF07k05jhb9U3pvq7Uil/H2gFKrbEWVSF\n 7PnQhmCBXYPSjQEyOIH6b6iAuSoGUO7k0boUKSzzUgXlOSc4VwYsrXGPcyFKN0Kluq2LtIS9s5p\n 60uZPyUcnjXmuheJY53NehnZxQ01j+7ZLqgPBPBNQwGJj1pqgE/axRnQrg1VBzZOY8GL4BVeHlM\n 61WxfAWT+RSZ7qz+eJicHK9tsZuzbySSBRhtjIanRmxaeN/Ldt54G5GlnXDJodsvbqRm16W7dPg\n zC5Wop+YxuZ1OsRptJm2CcMEM=","X-Google-Smtp-Source":"\n AGHT+IEUW+0ayzT1JMWTJszTF/txBIKQzY3hAfpFRvLIk6YjWm3vdFsMa15viXERvKxDm36oKqA0jw==","X-Received":"by 2002:a05:7022:7f07:b0:11b:65e:f40 with SMTP id\n a92af1059eb24-11f349a4bcbmr13291277c88.5.1765994175048;\n Wed, 17 Dec 2025 09:56:15 -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 8/8] math: Use math_opt_barrier on underflow/overflow","Date":"Wed, 17 Dec 2025 14:51:54 -0300","Message-ID":"<20251217175554.1157780-9-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":"This avoids compiler to move the operation before the 'iy' compare.\n\nIt fixes math/test-float128-pow regreesions when building with clang:\n\nFailure: pow (-0x1.000002p+0, 0xf.ffffffffffff8p+1020): Exception \"Underflow\" set\nFailure: pow (-0x1.000002p+0, 0xf.ffffffffffffbffffffffffffcp+1020): Exception \"Underflow\" set\nFailure: pow (-0x1.000002p+0, 0xf.fffffffffffffffffffffffffff8p+16380): Exception \"Underflow\" set\nFailure: pow (-0x1.000002p+0, 0xf.fffffffffffffffp+16380): Exception \"Underflow\" set\nFailure: pow (-0x1.000002p+0, 0xf.fffffp+124): Exception \"Underflow\" set\nFailure: pow (-0x1.00000ep+0, 0xf.ffffffffffff8p+1020): Exception \"Underflow\" set\nFailure: pow (-0x1.00000ep+0, 0xf.ffffffffffffbffffffffffffcp+1020): Exception \"Underflow\" set\nFailure: pow (-0x1.00000ep+0, 0xf.fffffffffffffffffffffffffff8p+16380): Exception \"Underflow\" set\nFailure: pow (-0x1.00000ep+0, 0xf.fffffffffffffffp+16380): Exception \"Underflow\" set\nFailure: pow (-0x2p+0, -0xf.ffffffffffff8p+1020): Exception \"Overflow\" set\nFailure: pow (-0x2p+0, -0xf.ffffffffffffbffffffffffffcp+1020): Exception \"Overflow\" set\nFailure: pow (-0x2p+0, -0xf.fffffffffffffffffffffffffff8p+16380): Exception \"Overflow\" set\nFailure: pow (-0x2p+0, -0xf.fffffffffffffffp+16380): Exception \"Overflow\" set\nFailure: pow (-0x2p+0, -0xf.fffffp+124): Exception \"Overflow\" set\nFailure: pow (-0x2p+0, 0xf.ffffffffffff8p+1020): Exception \"Underflow\" set\nFailure: pow (-0x2p+0, 0xf.ffffffffffffbffffffffffffcp+1020): Exception \"Underflow\" set\nFailure: pow (-0x2p+0, 0xf.fffffffffffffffffffffffffff8p+16380): Exception \"Underflow\" set\nFailure: pow (-0x2p+0, 0xf.fffffffffffffffp+16380): Exception \"Underflow\" set\nFailure: pow (-0x2p+0, 0xf.fffffp+124): Exception \"Underflow\" set\n[...]\n\nChecked on x86_64-linux-gnu and aarch64-linux-gnu with gcc-15 and\nclang-18.\n---\n sysdeps/ieee754/ldbl-128/e_powl.c | 6 ++++--\n 1 file changed, 4 insertions(+), 2 deletions(-)","diff":"diff --git a/sysdeps/ieee754/ldbl-128/e_powl.c b/sysdeps/ieee754/ldbl-128/e_powl.c\nindex 4e20616705..9ff5a43573 100644\n--- a/sysdeps/ieee754/ldbl-128/e_powl.c\n+++ b/sysdeps/ieee754/ldbl-128/e_powl.c\n@@ -279,9 +279,11 @@ __ieee754_powl (_Float128 x, _Float128 y)\n       if (iy > 0x407d654b)\n \t{\n \t  if (ix <= 0x3ffeffff)\n-\t    return (hy < 0) ? huge * huge : tiny * tiny;\n+\t    return (hy < 0) ? math_opt_barrier (huge * huge)\n+\t      : math_opt_barrier (tiny * tiny);\n \t  if (ix >= 0x3fff0000)\n-\t    return (hy > 0) ? huge * huge : tiny * tiny;\n+\t    return (hy > 0) ? math_opt_barrier (huge * huge)\n+\t      : math_opt_barrier (tiny * tiny);\n \t}\n       /* over/underflow if x is not close to one */\n       if (ix < 0x3ffeffff)\n","prefixes":["8/8"]}