public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-6300] libstdc++: Add missing constexpr on simd shift implementation
@ 2023-02-23 14:04 Matthias Kretz
0 siblings, 0 replies; only message in thread
From: Matthias Kretz @ 2023-02-23 14:04 UTC (permalink / raw)
To: gcc-cvs, libstdc++-cvs
https://gcc.gnu.org/g:fa37ac2b59ed1c379b35dbf9bd58f7849f9fd5b5
commit r13-6300-gfa37ac2b59ed1c379b35dbf9bd58f7849f9fd5b5
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.
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 <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;
@@ -1631,7 +1631,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;
@@ -1800,7 +1800,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;
@@ -1850,7 +1850,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;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-02-23 14:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-23 14:04 [gcc r13-6300] libstdc++: Add missing constexpr on simd shift implementation Matthias Kretz
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).