[{"id":3679785,"web_url":"http://patchwork.ozlabs.org/comment/3679785/","msgid":"<CAH6eHdQUvz1PVLJj06oNWxC24hC9TJPH6tSUZXVwL1i8eeZwiw@mail.gmail.com>","list_archive_url":null,"date":"2026-04-21T09:57:27","subject":"Re: [PATCH] libstdc++: Implement P4012R1 while reverting P3844R2\n (consteval simd broadcast)","submitter":{"id":4329,"url":"http://patchwork.ozlabs.org/api/people/4329/","name":"Jonathan Wakely","email":"jwakely.gcc@gmail.com"},"content":"On Mon, 20 Apr 2026 at 16:52, Matthias Kretz <MatthiasKretz@gmx.net> wrote:\n>\n> Tested on x86_64-linux-gnu (unix/-march=native and unix/-m32/-march=i686).\n>\n> OK for trunk?\n\nOK, thanks\n\n\n>\n> -------- 8< ---------\n>\n> From: Matthias Kretz <m.kretz@gsi.de>\n>\n> P3844R2 added consteval conversion for value-preserving conversion from\n> constants. It had been approved by LEWG in Kona. Therefore, the current\n> implementation has the consteval broadcast constructor. In Croydon, LEWG\n> reversed the decision but changed the overload set to keep the design\n> space open for C++29.\n>\n> This patch implements the removal of the consteval constructor and\n> changes the broadcast constructor according to P4012R1, to keep the\n> design space open.\n>\n> libstdc++-v3/ChangeLog:\n>\n>         * include/bits/simd_details.h (__value_preserving_cast): Remove.\n>         * include/bits/simd_mask.h (basic_mask): Replace plain 0 and 1\n>         literals with cw<0> and cw<1>. Replace explicit basic_vec\n>         construction from 0 and 1 with default init and broadcast from\n>         _Up(1).\n>         (_M_to_uint): Replace 1 with cw<1>.\n>         * include/bits/simd_vec.h (basic_vec): Remove consteval\n>         broadcast overload. Remove explicit broadcast from\n>         non-value-preserving types.\n>         * testsuite/std/simd/arithmetic.cc: Replace ill-formed integer\n>         literals with explicit cast to T or use cw.\n>         * testsuite/std/simd/mask.cc: Likewise.\n>         * testsuite/std/simd/simd_alg.cc: Likewise.\n>         * testsuite/std/simd/traits_common.cc: Adjust for resulting\n>         traits changes.\n>         * testsuite/std/simd/traits_math.cc: Likewise.\n>\n> Signed-off-by: Matthias Kretz <m.kretz@gsi.de>\n> ---\n>  libstdc++-v3/include/bits/simd_details.h      |  9 --------\n>  libstdc++-v3/include/bits/simd_mask.h         | 17 +++++++-------\n>  libstdc++-v3/include/bits/simd_vec.h          | 22 ++++---------------\n>  libstdc++-v3/testsuite/std/simd/arithmetic.cc | 17 +++++++-------\n>  libstdc++-v3/testsuite/std/simd/mask.cc       |  6 ++---\n>  libstdc++-v3/testsuite/std/simd/simd_alg.cc   |  5 ++---\n>  .../testsuite/std/simd/traits_common.cc       |  4 ++--\n>  .../testsuite/std/simd/traits_math.cc         |  2 +-\n>  8 files changed, 30 insertions(+), 52 deletions(-)\n>\n>\n> --\n> ──────────────────────────────────────────────────────────────────────────\n>  Dr. Matthias Kretz                           https://mattkretz.github.io\n>  GSI Helmholtz Center for Heavy Ion Research               https://gsi.de\n>  std::simd\n> ──────────────────────────────────────────────────────────────────────────","headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=EgjE20aw;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=38.145.34.32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org;\n\tdkim=pass (2048-bit key,\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=EgjE20aw","sourceware.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com","sourceware.org; spf=pass smtp.mailfrom=gmail.com","server2.sourceware.org;\n arc=pass smtp.remote-ip=209.85.167.47"],"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 4g0HqB21cvz1yGs\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 21 Apr 2026 19:58:12 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id EF3FC4BA9011\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 21 Apr 2026 09:58:10 +0000 (GMT)","from mail-lf1-f47.google.com (mail-lf1-f47.google.com\n [209.85.167.47])\n by sourceware.org (Postfix) with ESMTPS id B36824BA2E12\n for <gcc-patches@gcc.gnu.org>; Tue, 21 Apr 2026 09:57:41 +0000 (GMT)","by mail-lf1-f47.google.com with SMTP id\n 2adb3069b0e04-5a4113ab355so4227860e87.1\n for <gcc-patches@gcc.gnu.org>; Tue, 21 Apr 2026 02:57:41 -0700 (PDT)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org EF3FC4BA9011","OpenDKIM Filter v2.11.0 sourceware.org B36824BA2E12"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org B36824BA2E12","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org B36824BA2E12","ARC-Seal":["i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1776765462; cv=pass;\n b=dBTYnOrWYiuivqUDv4lAxbxtApCIreJjox9a+U1/LawrS/fctKgX3/8fLE8Ng0aVzZnCBFYxkPQmdcYmo61DMGVQS2h9eq9+ELxMSLB7KsWuY0bKbhfJgDJlC9QRDOVq0i7cVqG6TViCXPw1lgnbxDuDKJHDm5qH4rQBAUhFZwo=","i=1; a=rsa-sha256; t=1776765460; cv=none;\n d=google.com; s=arc-20240605;\n b=HLzWaLZ2WfGhbt5Bvze2+cXEpQg5Enrj2JJ2oHDodntJ5WW2JhFoCyq8yFUl4sORwf\n 2CQz3HpDATS2OO/i1b7FI8/JTZGIVdSqgpcR2UkXNMLC/Ga8tVl/AE1aJt/2nn0chEHl\n bx87qzVN72xpps9Ql9+afAU8Yp4Ajr7Jeck08/ZDnzNYSUz2W58hZCfPJamS2amgdefi\n PmsoxvWMw/gvcoDcpkaMQXA1joePrDktF+fqhpNhDKjEUinIHUbkzjq+3Lu6nXmt6+E3\n dGmPyeRjlVsZMPrOI/ytnsgy5NkHubw3d0RsAJlAGyXJzYFMbuiX4qS2ELs8M7BMNvuO\n 0dbA=="],"ARC-Message-Signature":["i=2; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776765462; c=relaxed/simple;\n bh=hUhIKr0h3zzsSXg3xpGqdw9/sm1td4thla+gYPqkq8Q=;\n h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To;\n b=mSYDdDKKRVaT+ixjcrcsH3EsUriltKh/EyJ+gm9fbS+NpSJUQEVREbipJb5wD4fJek3KfL4Z3nTjavOOt6ChKgcdjkQrz07Q1TCsCsdG+cldDYDRQGX/cPVnO+wy3bg7sW2ZNEWyo3ciK2ntPMAXSUVq2uyAJlxiYzjrdrL4/8I=","i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n s=arc-20240605;\n h=content-transfer-encoding:cc:to:subject:message-id:date:from\n :in-reply-to:references:mime-version:dkim-signature;\n bh=JjPPaVXUAz7kq9wUAgXTKvnvz4jYEuMploOJWJHEIoQ=;\n fh=nqO6zt8dNL7fZwgnhsCpRv1Yt9L9kf5hmMmQgKCNc/o=;\n b=XDK3fyICvjL+gWdYAx+W56lAnbr3CWMXpLN+ulgow75vzh3I4ocAaTc89ypfnYasms\n JL6271EXpsMmFBh3d/1mejX6T7KCZ21++sb2zx0hJpH/RHpgUBoKa1dyuxxFz+mawiqp\n JUwryPYmpzM/S7j076c+CXvif/fFGuGNrbftxRl/cXDInh0k6stWOL6D67DAWMv0x0as\n RHJ85Fl6clCyg2Htf3BA5WGcZqex3H6VK0/mD9bosZxpaEFyA6vGAfMhl9YgHTGHvWfx\n 1RXuyxw12r9Hoj8tfXN3W/Qf4AW5BKw40GGLBYy6EXdkjlW67gyjIqfZ/yoYIW3oxtG5\n hQhA==; darn=gcc.gnu.org"],"ARC-Authentication-Results":["i=2; server2.sourceware.org","i=1; mx.google.com; arc=none"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1776765460; x=1777370260; darn=gcc.gnu.org;\n h=content-transfer-encoding:cc:to:subject:message-id:date:from\n :in-reply-to:references:mime-version:from:to:cc:subject:date\n :message-id:reply-to;\n bh=JjPPaVXUAz7kq9wUAgXTKvnvz4jYEuMploOJWJHEIoQ=;\n b=EgjE20aw/xVFrGFtAuurQhuie6AWCTtro9f/p8PhP90Gb+s4YxCuqNvTVcdX3GEu0A\n v2GQ2acXPeXvE1dl4uG8VU4YrSfRgADl3wBOo4EJYqS52ndHEBdL3eqJB72uQ1O+U0o6\n u5PfExYx+GI9v0fbpf39ewiU9rl0v1t3EMrgd/3Ulbxy3V/yANx26jA4B2epyNAnVvgD\n YShrVUGj6btPw6GsYfSTKxjTBVGssvsshgPz8eLM41YrE25oEHLkHpWMvhpJvMmfhMJ/\n VdWHici+cPVANULqnmtvvTVxxcWzx85inajbJraGVbg+MBVaicyLgV9a8odIFP1+9EbU\n BLRQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776765460; x=1777370260;\n h=content-transfer-encoding:cc:to:subject:message-id:date:from\n :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=JjPPaVXUAz7kq9wUAgXTKvnvz4jYEuMploOJWJHEIoQ=;\n b=qcgjfXi9C09K8+7Zl83Dhc+9L79dP0I+4NPqYH+BoA0e026CYmPpWpCAXl9IVkEo1H\n OV5W8iecMOYnsgkB0wuXH4gW9WYpdyAzf6e4yCTAmtoqoTv0Qf7KlzAVbh0bx4nVgHCz\n PUNPY5tXpiWKhmOj6m3s/G60vi/NWH9uQSTqvr7w7p8lA0tOmaSKazQvvg16xwl4X1q6\n MGmbXlld76u2YV4FWIUWL/CPTDg9+KAi+kSOOXfSeZ2PGGnCOWtZHk8wiC/BcqXjtwwe\n 3rBWDAP/n5jHwXDmtMVWP5WeLF8nsms3hvudewz5O308u1bTEgL6ia5TGzaRaVJW6Rfx\n 9a/Q==","X-Forwarded-Encrypted":"i=1;\n AFNElJ8DNr2pX1AqEuwC6afBcpMINsIFjh1T/eSOUzW924yTPQgSjE5DM5q4I/jVgHa5RKhLHOC3xYNmQM3fNQ==@gcc.gnu.org","X-Gm-Message-State":"AOJu0YxLDXYr/pGLxm475IdYT3a1HBt5Pu8/rIkh2JdWduymFlzjpoHK\n Qt7cERvW/hIR3IjbK7b/xn++9No6cBayesJJcq+3zrpYzR5k52Jjz4jeq4rM8/L8x2UXOulHe6y\n WOjft5eT+V6awEIllTrk4Z8OHGZvzFYo=","X-Gm-Gg":"AeBDietKWwDqQ5lqKxgy7XI1dRLT4dobCy+HYjpyYh+klNbQI18sAh2ZIZifjrBvRMQ\n jZzBPGe6iANHIIfgrR5xFyOjuij4ZtyMOv6ChmjKQTwm1YqiIrw6CvZ7Y2xgdVQW0Fi1zTLYPPx\n Y+l8N8upQ+ghpYTvqdxVousz9WDlG+bmSDtPHJrCGVl2TICg+b7xjPubJ0ufOrWfkqyGvWsoaWi\n MCIyKp37bwVhEo0lrInFNVXdSYBQVHqXB5iybo79TU+oGkIbJ/YgcJpvqCYQzyI9a7c/fOUkIYF\n 7VICeB/vqRr1eEVKgcThYJQxvtYQdLyn20RAUxaFw4IcIFio2QCddMpFyKAvVcEHlLenfmwRkmg\n WYOM=","X-Received":"by 2002:ac2:4c4c:0:b0:5a2:bac1:97bc with SMTP id\n 2adb3069b0e04-5a4172ec416mr5285578e87.44.1776765459897; Tue, 21 Apr 2026\n 02:57:39 -0700 (PDT)","MIME-Version":"1.0","References":"<15809688.uLZWGnKmhe@vir-laptop>","In-Reply-To":"<15809688.uLZWGnKmhe@vir-laptop>","From":"Jonathan Wakely <jwakely.gcc@gmail.com>","Date":"Tue, 21 Apr 2026 10:57:27 +0100","X-Gm-Features":"AQROBzCv-T4iy2qrXdtIuj3_v7dHaPT66Kz4PKE31TeQf7-kn-ZK6OfkHjCzFow","Message-ID":"\n <CAH6eHdQUvz1PVLJj06oNWxC24hC9TJPH6tSUZXVwL1i8eeZwiw@mail.gmail.com>","Subject":"Re: [PATCH] libstdc++: Implement P4012R1 while reverting P3844R2\n (consteval simd broadcast)","To":"Matthias Kretz <MatthiasKretz@gmx.net>","Cc":"libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"quoted-printable","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"}},{"id":3679855,"web_url":"http://patchwork.ozlabs.org/comment/3679855/","msgid":"<14238149.nUPlyArG6x@vir-laptop>","list_archive_url":null,"date":"2026-04-21T12:33:50","subject":"Re: [PATCH] libstdc++: Implement P4012R1 while reverting P3844R2\n (consteval simd broadcast)","submitter":{"id":73288,"url":"http://patchwork.ozlabs.org/api/people/73288/","name":"Matthias Kretz","email":"m.kretz@gsi.de"},"content":"Jonathan Wakely [Tuesday, 21 April 2026, 11:57:27 CEST]:\n> On Mon, 20 Apr 2026 at 16:52, Matthias Kretz <MatthiasKretz@gmx.net> wrote:\n> \n> \n> > Tested on x86_64-linux-gnu (unix/-march=native and unix/-m32/-march=i686).\n> > \n> > OK for trunk?\n> \n> OK, thanks\n\nSorry, my v2 patch for this issue got stuck in my outbox. The additional \nchanges in the v2 patch are (they are needed for -ffast-math tests and even \nthen it still doesn't compile because of missing 'fabs'):\n\nin arithmetic.cc:\n\n@@ -259,10 +260,10 @@ struct Tests\n     ADD_TEST(divide0, std::is_floating_point_v<T> && !is_iec559) {\n       std::tuple{T(2), init_vec<V, 1, 2, 3, 4, 5, 6, 7>},\n       [](auto& t, V x, V y) {\n-\tt.verify_equal_to_ulp(x / x, V(T(1)), 1);\n-\tt.verify_equal_to_ulp(T(3) / x, V(T(3) / T(2)), 1);\n-\tt.verify_equal_to_ulp(x / T(3), V(T(2) / T(3)), 1);\n-\tt.verify_equal_to_ulp(y / x, init_vec<V, .5, 1, 1.5, 2, 2.5, 3, 3.5>, \n1);\n+\tt.verify_equal_to_ulp(x / x, V(T(1)), std::cw<1>);\n+\tt.verify_equal_to_ulp(T(3) / x, V(T(3) / T(2)), std::cw<1>);\n+\tt.verify_equal_to_ulp(x / T(3), V(T(2) / T(3)), std::cw<1>);\n+\tt.verify_equal_to_ulp(y / x, init_vec<V, .5, 1, 1.5, 2, 2.5, 3, 3.5>, \nstd::cw<1>);\n       }\n     };\n \n@@ -272,18 +273,18 @@ struct Tests\n       [](auto& t, V a) {\n \tV b = std::cw<2>;\n \tV ref([&](int i) { return a[i] / 2; });\n-\tt.verify_equal_to_ulp(a / b, ref, 1);\n+\tt.verify_equal_to_ulp(a / b, ref, std::cw<1>);\n \ta = select(a == std::cw<0>, T(1), a);\n \t// -freciprocal-math together with flush-to-zero makes\n \t// the following range restriction necessary (i.e.\n \t// 1/|a| must be >= min). Intel vrcpps and vrcp14ps\n \t// need some extra slack (use 1.1 instead of 1).\n \ta = select(fabs(a) >= T(1.1) / norm_min, T(1), a);\n-\tt.verify_equal_to_ulp(a / a, V(1), 1)(\"\\na = \", a);\n+\tt.verify_equal_to_ulp(a / a, V(std::cw<1>), std::cw<1>)(\"\\na = \", a);\n \tref = V([&](int i) { return 2 / a[i]; });\n-\tt.verify_equal_to_ulp(b / a, ref, 1)(\"\\na = \", a);\n-\tt.verify_equal_to_ulp(b /= a, ref, 1);\n-\tt.verify_equal_to_ulp(b, ref, 1);\n+\tt.verify_equal_to_ulp(b / a, ref, std::cw<1>)(\"\\na = \", a);\n+\tt.verify_equal_to_ulp(b /= a, ref, std::cw<1>);\n+\tt.verify_equal_to_ulp(b, ref, std::cw<1>);\n       }\n     };","headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org;\n dmarc=pass (p=none dis=none) header.from=gsi.de","sourceware.org; spf=pass smtp.mailfrom=gsi.de","server2.sourceware.org;\n arc=none smtp.remote-ip=140.181.3.112"],"Received":["from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::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 4g0MHR4MS6z1yGt\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 21 Apr 2026 22:34:27 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id B628E4BAD15D\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 21 Apr 2026 12:34:25 +0000 (GMT)","from lxmtout2.gsi.de (lxmtout2.gsi.de [140.181.3.112])\n by sourceware.org (Postfix) with ESMTPS id B08924BA9030;\n Tue, 21 Apr 2026 12:33:58 +0000 (GMT)","from localhost (localhost [127.0.0.1])\n by lxmtout2.gsi.de (Postfix) with ESMTP id B21302030FBB;\n Tue, 21 Apr 2026 14:33:56 +0200 (CEST)","from lxmtout2.gsi.de ([127.0.0.1])\n by localhost (lxmtout2.gsi.de [127.0.0.1]) (amavis, port 10024) with LMTP\n id 1nx3RIqajzkD; Tue, 21 Apr 2026 14:33:56 +0200 (CEST)","from srvEX6.campus.gsi.de (unknown [10.10.4.96])\n (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n (No client certificate requested)\n by lxmtout2.gsi.de (Postfix) with ESMTPS id 9EF392030FB7;\n Tue, 21 Apr 2026 14:33:56 +0200 (CEST)","from vir-laptop.localnet (140.181.3.12) by srvEX6.campus.gsi.de\n (10.10.4.96) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.37; Tue, 21 Apr\n 2026 14:33:55 +0200"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org B628E4BAD15D","OpenDKIM Filter v2.11.0 sourceware.org B08924BA9030"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org B08924BA9030","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org B08924BA9030","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776774838; cv=none;\n b=aSYEzHKziBODVaVB+rl2hjUeh1sWpkafYkXLIaCGSy/R5UeluQsmZkeGa1JGw896OEC5VS+r3t8H/to5D/ZUWX9kmKgfqI60deFMdD2zPvF17v3ms5wSWRyIi7gb0hPU2Rf2WV+p5e6CnDkdRa6JxcjJXZV1AvLwqkZSOU8cK54=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776774838; c=relaxed/simple;\n bh=UFHGUqCXQzx+CuExZzAlxtp95u6dbObmx2GlEKQcRgU=;\n h=From:To:Subject:Date:Message-ID:MIME-Version;\n b=aGHMXHOW8Ou7m645JrvTy8iGQs7aYklwgDu/gT6Vf9TLMKN4Z/2mkFht5t2Z6fuCTslmnkCcMcrIm52lm+DencbXxskBKVq2ncnZPzNSjjDh3vk8Tof5BRfUC9ihVPiv9l1ugFZ58sD8S0lDdCayj7K5GPozw6lkexf8AdC29ac=","ARC-Authentication-Results":"i=1; server2.sourceware.org","X-Virus-Scanned":"Debian amavis at lxmtout2.gsi.de","From":"Matthias Kretz <m.kretz@gsi.de>","To":"<gcc-patches@gcc.gnu.org>, Jonathan Wakely <jwakely.gcc@gmail.com>","CC":"<libstdc++@gcc.gnu.org>","Subject":"Re: [PATCH] libstdc++: Implement P4012R1 while reverting P3844R2\n (consteval simd broadcast)","Date":"Tue, 21 Apr 2026 14:33:50 +0200","Message-ID":"<14238149.nUPlyArG6x@vir-laptop>","Organization":"GSI Helmholtz Center for Heavy Ion Research","In-Reply-To":"\n <CAH6eHdQUvz1PVLJj06oNWxC24hC9TJPH6tSUZXVwL1i8eeZwiw@mail.gmail.com>","References":"<15809688.uLZWGnKmhe@vir-laptop>\n <CAH6eHdQUvz1PVLJj06oNWxC24hC9TJPH6tSUZXVwL1i8eeZwiw@mail.gmail.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"base64","Content-Type":"text/plain; charset=\"utf-8\"","X-Originating-IP":"[140.181.3.12]","X-ClientProxiedBy":"srvex5.Campus.gsi.de (10.10.4.95) To srvEX6.campus.gsi.de\n (10.10.4.96)","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"}},{"id":3679895,"web_url":"http://patchwork.ozlabs.org/comment/3679895/","msgid":"<CACb0b4n1ZsiS1em_Ht5_=hKTM4GqwEj3jcmOH5zaHSxs9iCmRA@mail.gmail.com>","list_archive_url":null,"date":"2026-04-21T13:38:29","subject":"Re: [PATCH] libstdc++: Implement P4012R1 while reverting P3844R2\n (consteval simd broadcast)","submitter":{"id":48004,"url":"http://patchwork.ozlabs.org/api/people/48004/","name":"Jonathan Wakely","email":"jwakely@redhat.com"},"content":"On Tue, 21 Apr 2026 at 13:34, Matthias Kretz <m.kretz@gsi.de> wrote:\n>\n> Jonathan Wakely [Tuesday, 21 April 2026, 11:57:27 CEST]:\n> > On Mon, 20 Apr 2026 at 16:52, Matthias Kretz <MatthiasKretz@gmx.net> wrote:\n> >\n> >\n> > > Tested on x86_64-linux-gnu (unix/-march=native and unix/-m32/-march=i686).\n> > >\n> > > OK for trunk?\n> >\n> > OK, thanks\n>\n> Sorry, my v2 patch for this issue got stuck in my outbox. The additional\n> changes in the v2 patch are (they are needed for -ffast-math tests and even\n> then it still doesn't compile because of missing 'fabs'):\n\nStill OK for trunk then.\n\n>\n> in arithmetic.cc:\n>\n> @@ -259,10 +260,10 @@ struct Tests\n>      ADD_TEST(divide0, std::is_floating_point_v<T> && !is_iec559) {\n>        std::tuple{T(2), init_vec<V, 1, 2, 3, 4, 5, 6, 7>},\n>        [](auto& t, V x, V y) {\n> -       t.verify_equal_to_ulp(x / x, V(T(1)), 1);\n> -       t.verify_equal_to_ulp(T(3) / x, V(T(3) / T(2)), 1);\n> -       t.verify_equal_to_ulp(x / T(3), V(T(2) / T(3)), 1);\n> -       t.verify_equal_to_ulp(y / x, init_vec<V, .5, 1, 1.5, 2, 2.5, 3, 3.5>,\n> 1);\n> +       t.verify_equal_to_ulp(x / x, V(T(1)), std::cw<1>);\n> +       t.verify_equal_to_ulp(T(3) / x, V(T(3) / T(2)), std::cw<1>);\n> +       t.verify_equal_to_ulp(x / T(3), V(T(2) / T(3)), std::cw<1>);\n> +       t.verify_equal_to_ulp(y / x, init_vec<V, .5, 1, 1.5, 2, 2.5, 3, 3.5>,\n> std::cw<1>);\n>        }\n>      };\n>\n> @@ -272,18 +273,18 @@ struct Tests\n>        [](auto& t, V a) {\n>         V b = std::cw<2>;\n>         V ref([&](int i) { return a[i] / 2; });\n> -       t.verify_equal_to_ulp(a / b, ref, 1);\n> +       t.verify_equal_to_ulp(a / b, ref, std::cw<1>);\n>         a = select(a == std::cw<0>, T(1), a);\n>         // -freciprocal-math together with flush-to-zero makes\n>         // the following range restriction necessary (i.e.\n>         // 1/|a| must be >= min). Intel vrcpps and vrcp14ps\n>         // need some extra slack (use 1.1 instead of 1).\n>         a = select(fabs(a) >= T(1.1) / norm_min, T(1), a);\n> -       t.verify_equal_to_ulp(a / a, V(1), 1)(\"\\na = \", a);\n> +       t.verify_equal_to_ulp(a / a, V(std::cw<1>), std::cw<1>)(\"\\na = \", a);\n>         ref = V([&](int i) { return 2 / a[i]; });\n> -       t.verify_equal_to_ulp(b / a, ref, 1)(\"\\na = \", a);\n> -       t.verify_equal_to_ulp(b /= a, ref, 1);\n> -       t.verify_equal_to_ulp(b, ref, 1);\n> +       t.verify_equal_to_ulp(b / a, ref, std::cw<1>)(\"\\na = \", a);\n> +       t.verify_equal_to_ulp(b /= a, ref, std::cw<1>);\n> +       t.verify_equal_to_ulp(b, ref, std::cw<1>);\n>        }\n>      };\n>\n> --\n> ──────────────────────────────────────────────────────────────────────────\n>  Dr. Matthias Kretz                           https://mattkretz.github.io\n>  GSI Helmholtz Center for Heavy Ion Research               https://gsi.de\n>  std::simd\n> ──────────────────────────────────────────────────────────────────────────\n>","headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=Lx/OKJgz;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org;\n\tdkim=pass (1024-bit key,\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=Lx/OKJgz","sourceware.org; dmarc=pass (p=quarantine dis=none)\n header.from=redhat.com","sourceware.org; spf=pass smtp.mailfrom=redhat.com","server2.sourceware.org;\n arc=none smtp.remote-ip=170.10.133.124"],"Received":["from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::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 4g0NkZ6gW8z1yGs\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 21 Apr 2026 23:39:34 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id E18634BAD17E\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 21 Apr 2026 13:39:32 +0000 (GMT)","from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.133.124])\n by sourceware.org (Postfix) with ESMTP id EB28D4BA23E8\n for <gcc-patches@gcc.gnu.org>; Tue, 21 Apr 2026 13:38:48 +0000 (GMT)","from mail-yx1-f70.google.com (mail-yx1-f70.google.com\n [74.125.224.70]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-626-60tekZOEMBOwjWZ9g4x6xw-1; Tue, 21 Apr 2026 09:38:46 -0400","by mail-yx1-f70.google.com with SMTP id\n 956f58d0204a3-65079af1ee9so4701258d50.1\n for <gcc-patches@gcc.gnu.org>; Tue, 21 Apr 2026 06:38:46 -0700 (PDT)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org E18634BAD17E","OpenDKIM Filter v2.11.0 sourceware.org EB28D4BA23E8"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org EB28D4BA23E8","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org EB28D4BA23E8","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776778729; cv=none;\n b=WC7ZeH+DqsVdi/yn4KkxXTBLjPYw5ktRLxSb2POrbKzGIZ2fn2Hg15h9Xi5pSgGn5qL5mPm11bw0thwxlX7U6gafEr1R3psSoANJyD/qjRWVyNk+2nk1M9cbIYet5NxfkIDWZPGo/VDtPm3oAUdc0+Fne6qQNLR6yHfVlOn5rLA=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776778729; c=relaxed/simple;\n bh=Dl1ESnw318f6IdYMFq2VUucFKAU1jecq0WirSiutkZs=;\n h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To;\n b=Myl4e+xEsUs5DLPeWZ4rvzQvwwJKnWLMrC+0k0PCu+W+knekbG6SMrCKUyfn9miq/wujiUX2CWMoG2HzKF78ehRAF0pxbeAIRD8ZSVdmigjQZXAx1YdUqPwE96JLV0CBHqot/dAQz28vZiVYq/hlqIiS1e6YEz0IVRR6aFAF/Gc=","ARC-Authentication-Results":"i=1; server2.sourceware.org","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1776778728;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=6+1J2Fom1LrbYLHJcxprn4uzADJzUHqGHOdQy36SE74=;\n b=Lx/OKJgzLfLEOpiHoEGxVrpkXfqAbilcR63CFjZ+KlE+hDNOePhGM2wCDpz72ZxlJcJO00\n /aOzE26VJjnNVSHui2Os8wNd4GuYYQ0EZ6yAA6X+V2YuN7fB5isz8U9iDjdiq+XN6e1B7W\n Ibk4tTTjmme3UBITtCmTnR1Vdz+Xcy0=","X-MC-Unique":"60tekZOEMBOwjWZ9g4x6xw-1","X-Mimecast-MFC-AGG-ID":"60tekZOEMBOwjWZ9g4x6xw_1776778726","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776778726; x=1777383526;\n h=content-transfer-encoding:cc:to:subject:message-id:date:from\n :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=6+1J2Fom1LrbYLHJcxprn4uzADJzUHqGHOdQy36SE74=;\n b=dYq7BHeYF7o1eVI+IZLqxLbWpRKoSsgk0kMeWGRzUJOxYRiU0sfwHhfhm45JT7KhtY\n rgTSTeG7w3EVr0C5vGriTiUfXtmz/44XMVWZ4O61YidoKswLH9HesHGwDxgJILLRdCvC\n fF9SV/qdaiqwCodOvomfjZPW/gT2minnFklPiyhqDvilQ6hjy7AhHP2pYCjzUTAYkoaI\n N523vi8q+dldUmp63MFb6zV2T2aWvUiV6GLBdNaTCEcpAT5WJigdjNz7+QuN26wR9GUe\n UQqkKEaHu/btO7gc+GtZv7Px+lyy+/s6/i9ICosMuKPatomMt4SLwVFKwygN+E4F4Bt0\n vybA==","X-Gm-Message-State":"AOJu0YwhwbfAXcc9WbR+7K6UoAjHOlx/YHr1yXTUEUol6FQiFxIwX6SY\n rEKYz568l9587OtDk2ZElhS4IAHysSgvj6H6650mR5bRrmpKXKToF0FFdZOuHLd/ZzOaV4jcOow\n PiRYrRkwjscl+f4DpaxOdfVokvQH4VvfkiSSCHtASlvu58f4MiLV1XS5T3eWPK3Iqk99Cmhjmk6\n scTGwDxFyEd2kVqdocTKmJ6qqzEaTP5jhCGQ==","X-Gm-Gg":"AeBDietj2nuy0Pv+CoBzoxlEGOobkavC/D/daoa55b5qCg+YbqpylS0rybOpqLPtYHl\n dnaAHchqINzezxV8v396bTbSU7bP79pZQer/66u2wHiVwAOhjl+Wx6Fqxlr8eom8FMwy9wh5KXj\n ES1V/t3AFV5+YxGnyMgHLvkqDzrna0y8C0AAt5ESelf300lgRmTd7iDOR52XLM6yNItUAtciqlz\n lYQRjqMXNfWINs2ZuXAh0NyilAB5edza1l+ELCQiVy7Uo/ibF/ECAHxzaFznSwAfqPvtzrRK9U9\n cg==","X-Received":["by 2002:a05:690e:1586:20b0:650:7b5b:ed00 with SMTP id\n 956f58d0204a3-653108402f4mr14127696d50.23.1776778726005;\n Tue, 21 Apr 2026 06:38:46 -0700 (PDT)","by 2002:a05:690e:1586:20b0:650:7b5b:ed00 with SMTP id\n 956f58d0204a3-653108402f4mr14127664d50.23.1776778725612; Tue, 21 Apr 2026\n 06:38:45 -0700 (PDT)"],"MIME-Version":"1.0","References":"<15809688.uLZWGnKmhe@vir-laptop>\n <CAH6eHdQUvz1PVLJj06oNWxC24hC9TJPH6tSUZXVwL1i8eeZwiw@mail.gmail.com>\n <14238149.nUPlyArG6x@vir-laptop>","In-Reply-To":"<14238149.nUPlyArG6x@vir-laptop>","From":"Jonathan Wakely <jwakely@redhat.com>","Date":"Tue, 21 Apr 2026 14:38:29 +0100","X-Gm-Features":"AQROBzDUVoNN1rD30EGlGUkeYM0nKV8wJ1YoORcx8b6c4vUU3HXt4xxcrEI9STM","Message-ID":"\n <CACb0b4n1ZsiS1em_Ht5_=hKTM4GqwEj3jcmOH5zaHSxs9iCmRA@mail.gmail.com>","Subject":"Re: [PATCH] libstdc++: Implement P4012R1 while reverting P3844R2\n (consteval simd broadcast)","To":"Matthias Kretz <m.kretz@gsi.de>","Cc":"gcc-patches@gcc.gnu.org, Jonathan Wakely <jwakely.gcc@gmail.com>,\n libstdc++@gcc.gnu.org","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"_MwuyWdTY5dJlobISeIGRi9jPGDUJUFVq5PQx4bgi3I_1776778726","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"quoted-printable","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"}}]