public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
From: Matthias Kretz <mkretz@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org
Subject: [gcc r12-9198] libstdc++: Add missing constexpr on simd shift implementation
Date: Thu, 23 Feb 2023 16:31:00 +0000 (GMT)	[thread overview]
Message-ID: <20230223163100.65EF63856975@sourceware.org> (raw)

https://gcc.gnu.org/g:4f9d81ef7899437bb5d461e1e034592972f6d04e

commit r12-9198-g4f9d81ef7899437bb5d461e1e034592972f6d04e
Author: Matthias Kretz <m.kretz@gsi.de>
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 <m.kretz@gsi.de>
    
    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 c809520dcdd..b9af1ce538c 100644
--- a/libstdc++-v3/include/experimental/bits/simd_x86.h
+++ b/libstdc++-v3/include/experimental/bits/simd_x86.h
@@ -1524,7 +1524,7 @@ template <typename _Abi, typename>
     // values.
   #ifndef _GLIBCXX_SIMD_NO_SHIFT_OPT
     template <typename _Tp, typename _TVT = _VectorTraits<_Tp>>
-      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 <typename _Abi, typename>
       }
 
     template <typename _Tp, typename _TVT = _VectorTraits<_Tp>>
-      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 <typename _Abi, typename>
     // _S_bit_shift_right {{{
 #ifndef _GLIBCXX_SIMD_NO_SHIFT_OPT
     template <typename _Tp, typename _TVT = _VectorTraits<_Tp>>
-      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 <typename _Abi, typename>
       }
 
     template <typename _Tp, typename _TVT = _VectorTraits<_Tp>>
-      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;

                 reply	other threads:[~2023-02-23 16:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230223163100.65EF63856975@sourceware.org \
    --to=mkretz@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    --cc=libstdc++-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).