From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7857) id B76EF38515FF; Thu, 23 Feb 2023 14:04:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B76EF38515FF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677161047; bh=43/awu6cBxts63kF9L3zN1DSHPzqc5kY3xIs65C2SjI=; h=From:To:Subject:Date:From; b=ZN9d7YF1gUAHsk4q/7athOr+vn0loZG5eDwKempFei27J3aa7X67AYV9EqruMxewL A7823QM8PC4RicXfmVCAMoV5jM4SzWq4tU9MdGwMLZVkj2gDE3dm+KgbhP//z0b0id lbnb+zuhwFCjXvFmh0M9s6zKpxM2PcOFGPl7ZNeI= 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 r13-6300] libstdc++: Add missing constexpr on simd shift implementation X-Act-Checkin: gcc X-Git-Author: Matthias Kretz X-Git-Refname: refs/heads/master X-Git-Oldrev: 92c47b15d5af3e7f93d11ad69a45b6d1cb8661c5 X-Git-Newrev: fa37ac2b59ed1c379b35dbf9bd58f7849f9fd5b5 Message-Id: <20230223140407.B76EF38515FF@sourceware.org> Date: Thu, 23 Feb 2023 14:04:07 +0000 (GMT) List-Id: https://gcc.gnu.org/g:fa37ac2b59ed1c379b35dbf9bd58f7849f9fd5b5 commit r13-6300-gfa37ac2b59ed1c379b35dbf9bd58f7849f9fd5b5 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. 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 dcfdc2a9496..cd642cb3290 100644 --- a/libstdc++-v3/include/experimental/bits/simd_x86.h +++ b/libstdc++-v3/include/experimental/bits/simd_x86.h @@ -1526,7 +1526,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; @@ -1631,7 +1631,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; @@ -1800,7 +1800,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; @@ -1850,7 +1850,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;