From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7857) id 14389385842B; Thu, 23 Feb 2023 19:45:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 14389385842B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677181555; bh=9l7gNiboGCriNIwpWvcdE53/eTJPpO6LuNT8shurMYI=; h=From:To:Subject:Date:From; b=X7UbR7Ewr54/QaUxl3obX6MuyTboQNjARmIGJp8GekcsbjLx8FIbSPy7JcM/TuR7X D3BLLS3SH/Qzw3y4ZOIRqhwZRI0Z5QQjTCvG2Drsrrzt9Xm1cvOf+dQ52Fu0cbSTTq 51QO4pWoLD+9nG2qoz7apu/vMRXAmZdkwBICfr/s= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Matthias Kretz To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r11-10541] libstdc++: Add missing constexpr on simd shift implementation X-Act-Checkin: gcc X-Git-Author: Matthias Kretz X-Git-Refname: refs/heads/releases/gcc-11 X-Git-Oldrev: 5ecf4567452cf10d3f9970d414f1c21622c122f8 X-Git-Newrev: 42ae5e24b9a320b89415b37254e1edcca425aec6 Message-Id: <20230223194555.14389385842B@sourceware.org> Date: Thu, 23 Feb 2023 19:45:55 +0000 (GMT) List-Id: https://gcc.gnu.org/g:42ae5e24b9a320b89415b37254e1edcca425aec6 commit r11-10541-g42ae5e24b9a320b89415b37254e1edcca425aec6 Author: Matthias Kretz Date: Mon Feb 20 17:35:59 2023 +0100 libstdc++: Add missing constexpr on simd shift implementation Resolves -Wtautological-compare warnings about `if (__builtin_is_constant_evaluated())` in the implementations of these functions. Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: * include/experimental/bits/simd_x86.h (_S_bit_shift_left) (_S_bit_shift_right): Declare constexpr. The implementation was already expecting constexpr evaluation. (cherry picked from commit fa37ac2b59ed1c379b35dbf9bd58f7849f9fd5b5) Diff: --- libstdc++-v3/include/experimental/bits/simd_x86.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libstdc++-v3/include/experimental/bits/simd_x86.h b/libstdc++-v3/include/experimental/bits/simd_x86.h index db4c744d6e4..8df230fb773 100644 --- a/libstdc++-v3/include/experimental/bits/simd_x86.h +++ b/libstdc++-v3/include/experimental/bits/simd_x86.h @@ -1524,7 +1524,7 @@ template // values. #ifndef _GLIBCXX_SIMD_NO_SHIFT_OPT template > - inline _GLIBCXX_CONST static typename _TVT::type + constexpr inline _GLIBCXX_CONST static typename _TVT::type _S_bit_shift_left(_Tp __xx, int __y) { using _V = typename _TVT::type; @@ -1629,7 +1629,7 @@ template } template > - inline _GLIBCXX_CONST static typename _TVT::type + constexpr inline _GLIBCXX_CONST static typename _TVT::type _S_bit_shift_left(_Tp __xx, typename _TVT::type __y) { using _V = typename _TVT::type; @@ -1798,7 +1798,7 @@ template // _S_bit_shift_right {{{ #ifndef _GLIBCXX_SIMD_NO_SHIFT_OPT template > - inline _GLIBCXX_CONST static typename _TVT::type + constexpr inline _GLIBCXX_CONST static typename _TVT::type _S_bit_shift_right(_Tp __xx, int __y) { using _V = typename _TVT::type; @@ -1848,7 +1848,7 @@ template } template > - inline _GLIBCXX_CONST static typename _TVT::type + constexpr inline _GLIBCXX_CONST static typename _TVT::type _S_bit_shift_right(_Tp __xx, typename _TVT::type __y) { using _V = typename _TVT::type;