{"id":2221602,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2221602/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/patch/orwlyf233o.fsf_-_@lxoliva.fsfla.org/","project":{"id":17,"url":"http://patchwork.ozlabs.org/api/1.1/projects/17/?format=json","name":"GNU Compiler Collection","link_name":"gcc","list_id":"gcc-patches.gcc.gnu.org","list_email":"gcc-patches@gcc.gnu.org","web_url":null,"scm_url":null,"webscm_url":null},"msgid":"<orwlyf233o.fsf_-_@lxoliva.fsfla.org>","date":"2026-04-09T22:14:35","name":"[RFC] libstdc++: simd: accept 64-bit long double as double in _S_*_of [PR124657]","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"5ea86c3834a67a4b4ef9346fc1217d9337e68cf0","submitter":{"id":74937,"url":"http://patchwork.ozlabs.org/api/1.1/people/74937/?format=json","name":"Alexandre Oliva","email":"oliva@adacore.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/gcc/patch/orwlyf233o.fsf_-_@lxoliva.fsfla.org/mbox/","series":[{"id":499367,"url":"http://patchwork.ozlabs.org/api/1.1/series/499367/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/list/?series=499367","date":"2026-04-09T22:14:35","name":"[RFC] libstdc++: simd: accept 64-bit long double as double in _S_*_of [PR124657]","version":1,"mbox":"http://patchwork.ozlabs.org/series/499367/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2221602/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2221602/checks/","tags":{},"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 secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256\n header.s=google header.b=Bq3V8lcv;\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 (2048-bit key,\n secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256\n header.s=google header.b=Bq3V8lcv","sourceware.org; dmarc=pass (p=quarantine dis=none)\n header.from=adacore.com","sourceware.org; spf=pass smtp.mailfrom=adacore.com","server2.sourceware.org;\n arc=none smtp.remote-ip=74.125.82.171"],"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 4fsDly4FxYz1y05\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 10 Apr 2026 08:15:58 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 954D14BA23C1\n\tfor <incoming@patchwork.ozlabs.org>; Thu,  9 Apr 2026 22:15:56 +0000 (GMT)","from mail-dy1-f171.google.com (mail-dy1-f171.google.com\n [74.125.82.171])\n by sourceware.org (Postfix) with ESMTPS id 38FF54BA2E0F\n for <gcc-patches@gcc.gnu.org>; Thu,  9 Apr 2026 22:14:49 +0000 (GMT)","by mail-dy1-f171.google.com with SMTP id\n 5a478bee46e88-2ce102afb0aso1785427eec.1\n for <gcc-patches@gcc.gnu.org>; Thu, 09 Apr 2026 15:14:49 -0700 (PDT)","from free.home ([2804:14c:4d1:41a6::1455])\n by smtp.gmail.com with ESMTPSA id\n 5a478bee46e88-2d562ac344csm1501320eec.25.2026.04.09.15.14.46\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 09 Apr 2026 15:14:47 -0700 (PDT)","from livre (livre.home [172.31.160.2])\n by free.home (8.15.2/8.15.2) with ESMTPS id 639MEZOO326230\n (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT);\n Thu, 9 Apr 2026 19:14:36 -0300"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 954D14BA23C1","OpenDKIM Filter v2.11.0 sourceware.org 38FF54BA2E0F"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 38FF54BA2E0F","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 38FF54BA2E0F","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1775772889; cv=none;\n b=ZQqzDSsnsM9sqrsYIVachZNC9tzZ/E4zCx/p9sTEzJ+8e+Upi82YD+shVZ5VyYMYSHzupKasbZkJMRKWE3zp4QI/AuhXcBstUPdDLr4TGEmGeTYtHHii0ggkkZQsC+eLUU1qPmQyzk4aqVI77nGwl96qPRsknCGrGhlKNBqCJR8=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1775772889; c=relaxed/simple;\n bh=nqa7NX6W6RL0jA8JUOZ91hpznUSlS5qZI+INXvDcyTo=;\n h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version;\n b=Cd8DIXk6rRf844u/oQ3RfWfZFh8uu2RUyqsia8puj9h4YULjKsRvq1KuD0/hSXsSTO9zEPIk4WFMLl6bGr7fm+g6tIT3gVttY6n333aRvEHCxSGuaSYJ0V6mJY4/8PeLUV0hMpbjIuwpIZ89jc7Hsoc7g77I/1vIe3e+Y5E/SJA=","ARC-Authentication-Results":"i=1; server2.sourceware.org","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=adacore.com; s=google; t=1775772888; x=1776377688; darn=gcc.gnu.org;\n h=mime-version:user-agent:message-id:in-reply-to:date:references\n :organization:subject:cc:to:from:from:to:cc:subject:date:message-id\n :reply-to; bh=iPTT8kOpGVAvlvrbidapaQbuHFKEVO/hgNuO2d3wpYU=;\n b=Bq3V8lcvuKvRct9SClO/Ec3kAU5dSbsBfGLOVs/7CeFGSFSLBYQ5vu1i9hj/+f30mi\n V+dNucIvWJOD4j1I8tXD7OzT/a5y3JCD8iwU2RSiCo3x4ixOWb6oMw5Wjrthra3lHpDs\n iUaXaEX5q+ZZKFdn93EdnvF59Jc11VzbLIHesJYolCivCMN3ndMlnM1rBDpb5R9Z8VAO\n mwhku7/sPZMolrdp2fRvm/nQGam9j/aGGCx2SUmr/QJ+/lELUANwMxJhcngnPqo0IK4q\n LfUqZ48CtHUvvcR5sjbPC6mCdvZsANcwpraiLNWaFgExylcupzoD1mLDbSsPHzncTWID\n lQgg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775772888; x=1776377688;\n h=mime-version:user-agent:message-id:in-reply-to:date:references\n :organization:subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to\n :cc:subject:date:message-id:reply-to;\n bh=iPTT8kOpGVAvlvrbidapaQbuHFKEVO/hgNuO2d3wpYU=;\n b=o/RT14PnYYRnEh6w3NcGzXZOt96GGZ1jx8o2OqhndKtYnOOmPx7iB9ncfKDPaTpLW8\n TxFT5QEuxEiwoWdl+TorO130q29fDyZihyQViyNbwsV5I1m095G3mxkKv2V1hhZBf3Ex\n k1TcsYoPmE2t8tkzhNwvXZBTJ3HcGrE9gY5l4j40YAa0Mt6WbzR8pYD+lWJ0WMZtZrQX\n meReTnS7ZiUhIYsq9xPXy/V/NKJ97UuhL1/gE2RX8lU+C4jNFhIqfdS9vFAO660H9P0R\n KmTPYqq3ZYD6NAzbF3yrInIK1x3tPfEv/++ek/cAGXdlgKCaK+E9wuMMLqlcwjeTF4Ux\n 7ZHg==","X-Forwarded-Encrypted":"i=1;\n AJvYcCXrHuCwn2gzuortD4qJC8PnoBWuE/IZT/va71LS3FoUO1WfSBDXzHahBA79YPbyfZE06SBhYDUfJ6FHDg==@gcc.gnu.org","X-Gm-Message-State":"AOJu0Yx8R8PhHiYxerQcLls4L/QcF7B20gh5lCVVe7DSD01oyzj94aqb\n hKsRabrtEWcYisq4yzAcN3p2+tD0z0D80tTK1uCQj2fh9ezvXsttpxQm6J6CIR1+wA==","X-Gm-Gg":"AeBDieveOhQZYeJC1/j1DVUq3mCGLhHDFZTMqMC+jPyRPPjnX95MNuXjb/0pErIkWJN\n 7ETW1dr7+2e33+P0Mx5lGsEIRxpBiFLXOrtv+wf9UCS+7wkC/GAvU/V+Kk7CNa7CAxjtpHLcpVe\n Xmlc1ZWaM6kHzkh5bxFbQBi/mGKfH9A+JKnAT0+1zL/Y+m0k1rLvyqToc+waJ+vcMirsdC6u079\n ymmPZ3QHraUaGyytYEoN4AYOm0Sgwf1dxd9sKqjGE7fRvNhrfRPC7peFf3ovvX9mKbE+pn3or4k\n MeqirDn9jgcAMclaMpmzIpr2f89BQPUXFmR1uFmKPX7Wt9XssedLnBKAAOPq9qhqLFQIGkg6QjZ\n dpzJtYvuJIku0OrmGzmsvNBS+9u+/PUsoz5MFRP6kendcsNgXWRX2M60e+XLWV2mIwxOQzcqwWI\n kUHd12k8NZRA==","X-Received":"by 2002:a05:7301:4083:b0:2d3:2983:c890 with SMTP id\n 5a478bee46e88-2d588e838b5mr511568eec.15.1775772887917;\n Thu, 09 Apr 2026 15:14:47 -0700 (PDT)","From":"Alexandre Oliva <oliva@adacore.com>","To":"Matthias Kretz <MatthiasKretz@gmx.net>","Cc":"libstdc++@gcc.gnu.org, Jonathan Wakely <jwakely.gcc@gmail.com>,\n gcc-patches <gcc-patches@gcc.gnu.org>","Subject":"[PATCH, RFC] libstdc++: simd: accept 64-bit long double as double\n in _S_*_of [PR124657]","Organization":"Free thinker, does not speak for AdaCore","References":"<oro6kdd9ji.fsf@lxoliva.fsfla.org>\n <orse9oaxa9.fsf@lxoliva.fsfla.org>\n <CAH6eHdS9SWeUfmEe+G43tMUZuR-oSAP1rf8qjUPYdx+psJFagQ@mail.gmail.com>\n <47992676.fMDQidcC6G@vir-laptop>","Date":"Thu, 09 Apr 2026 19:14:35 -0300","In-Reply-To":"<47992676.fMDQidcC6G@vir-laptop> (Matthias Kretz's message of\n \"Thu, 26 Mar 2026 14:03:47 +0000\")","Message-ID":"<orwlyf233o.fsf_-_@lxoliva.fsfla.org>","User-Agent":"Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)","MIME-Version":"1.0","Content-Type":"text/plain","X-Scanned-By":"MIMEDefang 2.84","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"},"content":"Various simd_x86 functions that handle double need to be adjusted to\nmatch 64-bit long double as well.\n\nThis patch deals with _S_*_of, to test the concept.\n\nThere are many occurrences of double in simd_x86.h file, and we\nprobably have to adjust them all.  But this is more than enough to get\npr109261_constexpr_simd.cc to compile with -mlong-double-64.\n\nWe probably need a better abstraction.\n\n\nRegstrapped on x86_64-linux-gnu.  With this change on top of the\nprevious one, experimental/simd/pr109261_constexpr_simd.cc compiles\nsuccessfully with -mlong-double-64.  This works, but I realize it's ugly\nand incomplete, so take this as a conversation starter about preferences\non how to spell out the long-double-64 equivalence to double all over\nsimd_x86.h.  Unless you like it, in which case, ok to install? :-)\n\n\nfor  libstdc++-v3/ChangeLog\n\n\tPR libstdc++/124657\n\t* include/experimental/bits/simd_x86.h (_S_all_of): Handle\n\tlong double like double.\n\t(_S_any_of, _S_none_of, _S_some_of): Likewise.\n---\n libstdc++-v3/include/experimental/bits/simd_x86.h |   16 ++++++++++++----\n 1 file changed, 12 insertions(+), 4 deletions(-)","diff":"diff --git a/libstdc++-v3/include/experimental/bits/simd_x86.h b/libstdc++-v3/include/experimental/bits/simd_x86.h\nindex 74c7a61998e0d..400b56e40b33f 100644\n--- a/libstdc++-v3/include/experimental/bits/simd_x86.h\n+++ b/libstdc++-v3/include/experimental/bits/simd_x86.h\n@@ -5024,7 +5024,9 @@ template <typename _Abi, typename>\n \t    else if constexpr (is_same_v<_Tp, float>)\n \t      return (_mm_movemask_ps(__a) & ((1 << _Np) - 1))\n \t\t     == (1 << _Np) - 1;\n-\t    else if constexpr (is_same_v<_Tp, double>)\n+\t    else if constexpr (is_same_v<_Tp, double>\n+\t\t\t       || (sizeof (long double) == sizeof (double)\n+\t\t\t\t   && is_same_v<_Tp, long double>))\n \t      return (_mm_movemask_pd(__a) & ((1 << _Np) - 1))\n \t\t     == (1 << _Np) - 1;\n \t    else\n@@ -5086,7 +5088,9 @@ template <typename _Abi, typename>\n \t      }\n \t    else if constexpr (is_same_v<_Tp, float>)\n \t      return (_mm_movemask_ps(__a) & ((1 << _Np) - 1)) != 0;\n-\t    else if constexpr (is_same_v<_Tp, double>)\n+\t    else if constexpr (is_same_v<_Tp, double>\n+\t\t\t       || (sizeof (long double) == sizeof (double)\n+\t\t\t\t   && is_same_v<_Tp, long double>))\n \t      return (_mm_movemask_pd(__a) & ((1 << _Np) - 1)) != 0;\n \t    else\n \t      return (_mm_movemask_epi8(__a) & ((1 << (_Np * sizeof(_Tp))) - 1))\n@@ -5122,7 +5126,9 @@ template <typename _Abi, typename>\n \t      }\n \t    else if constexpr (is_same_v<_Tp, float>)\n \t      return (__movemask(__a) & ((1 << _Np) - 1)) == 0;\n-\t    else if constexpr (is_same_v<_Tp, double>)\n+\t    else if constexpr (is_same_v<_Tp, double>\n+\t\t\t       || (sizeof (long double) == sizeof (double)\n+\t\t\t\t   && is_same_v<_Tp, long double>))\n \t      return (__movemask(__a) & ((1 << _Np) - 1)) == 0;\n \t    else\n \t      return (__movemask(__a) & int((1ull << (_Np * sizeof(_Tp))) - 1))\n@@ -5156,7 +5162,9 @@ template <typename _Abi, typename>\n \t\tconst auto __tmp = _mm_movemask_ps(__a) & __allbits;\n \t\treturn __tmp > 0 && __tmp < __allbits;\n \t      }\n-\t    else if constexpr (is_same_v<_Tp, double>)\n+\t    else if constexpr (is_same_v<_Tp, double>\n+\t\t\t       || (sizeof (long double) == sizeof (double)\n+\t\t\t\t   && is_same_v<_Tp, long double>))\n \t      {\n \t\tconstexpr int __allbits = (1 << _Np) - 1;\n \t\tconst auto __tmp = _mm_movemask_pd(__a) & __allbits;\n","prefixes":["RFC"]}