Last part to resolve test failure introduced with PR109822.
OK for master and backports (gcc-11 doesn't have __builtin_shufflevector,
though)?
Tested on x86_64-pc-linux-gnu and powerpc64le-linux-gnu
- >8 -
Fix SFINAE on __is_intrinsic_type for 64-bit element types on non-VSX
POWER targ
This is the first part of a fix for the failure of the new simd test on non-
VSX POWER targets. There are more casts to unavailable vectors of 64-bit
element types to be rewritten.
OK for master and backports?
Tested on x86_64-pc-linux-gnu and powerpc64le-linux-gnu
-- >8 ---
Signed-off
OK for master and backports?
Tested on x86_64-pc-linux-gnu
- >8 -
The call to the base implementation sometimes didn't find a matching
signature because the _Abi parameter of _SimdImpl* was "wrong" after
conversion. It has to call into ::_SimdImpl instead of the
current ABI tag's _SimdIm
pushed to trunk, will backport later
tested on x86_64-pc-linux-gnu
--- >8
Signed-off-by: Matthias Kretz
libstdc++-v3/ChangeLog:
* include/experimental/bits/simd.h (__bit_cast): Use
__gnu__::__vector_size__ instead of gnu::vector_size.
---
libstdc++-v3/include/exp
On Friday, 2 June 2023 11:30:17 CEST Alexandre Oliva wrote:
> I also noticed the same test is failing on rtems6 (at least with gcc
> 11). AFAICT the problem is that _GLIBCXX_SIMD_MATH_CALL* macros in
> simd_math.h expect the named functions to be in std::, but I get such
> errors as:
>
> .../aarc
On Friday, 2 June 2023 11:24:23 CEST Alexander Monakov wrote:
> > > I'm not sure what you consider a breaking change here. Is that the
> > > implied
> > > threat to use undefinedness for range deduction and other optimizations?
> >
> > Consider the stdx::simd implementation. It currently follows s
On Friday, 2 June 2023 09:49:26 CEST Alexander Monakov wrote:
> > simd x = ...;
> > bool t = all_of(x < x + 1); // unconditionally true or not?
> >
> > I'd expect t to be unconditionally true. Because simd simply is a
> > data- parallel version of int.
>
> Okay, I see opinions will vary here. I w
Hello Alexandre,
On Friday, 2 June 2023 10:32:40 CEST Alexandre Oliva wrote:
> On May 26, 2023, Matthias Kretz via Libstdc++ wrote:
> > OK for master and all backports (after 11.4 is done)?
> > tested on powerpc64le-linux-gnu and x86_64-pc-linux-gnu
> >
> > * testsuite/experimental/simd/pr10
On Thursday, 1 June 2023 20:25:14 CEST Alexander Monakov wrote:
> On Wed, 31 May 2023, Richard Biener wrote:
> > So yes, we probably should clarify the semantics to match the
> > implementation (since we have two targets doing things differently
> > since forever we can only document it as UB) and
pushed to trunk, will backport
tested on arm-linux-gnueabihf
-- 8< --
Signed-off-by: Matthias Kretz
libstdc++-v3/ChangeLog:
PR libstdc++/110050
* include/experimental/bits/simd.h (__vectorized_sizeof): With
__have_neon_a32 only single-precision float wo
OK for master and all backports (after 11.4 is done)?
tested on powerpc64le-linux-gnu and x86_64-pc-linux-gnu
--- 8<
Signed-off-by: Matthias Kretz
libstdc++-v3/ChangeLog:
PR libstdc++/109822
* include/experimental/bits/simd.h (to_native): Use int NTTP
OK for master and all backports (after 11.4 is done)?
tested on powerpc64le-linux-gnu
--- 8<
This avoids a failure on PR109964.
Signed-off-by: Matthias Kretz
libstdc++-v3/ChangeLog:
* testsuite/experimental/simd/tests/integer_operators.cc:
Compute expecte
OK for master and all backports (after 11.4 is done)
tested on powerpc64le-linux-gnu (with 64-bit long double)
--- 8<
Expect that long might not fit into the long double mantissa bits.
Signed-off-by: Matthias Kretz
libstdc++-v3/ChangeLog:
* testsuite/experimental
pushed to master, will backport later
tested on x86_64-pc-linux-gnu and powerpc64le-linux-gnu
--- 8<
Signed-off-by: Matthias Kretz
libstdc++-v3/ChangeLog:
* include/experimental/bits/simd_ppc.h (_S_bit_shift_left):
Negative __y is UB, so prefer signed com
OK for master and backports? (also a long-standing bug that didn't surface
until the new constexpr test was added)
tested on powerpc64le-linux-gnu
- 8< -
Signed-off-by: Matthias Kretz
libstdc++-v3/ChangeLog:
PR libstdc++/109949
* include/experiment
OK for master and all branches? (this issue only surfaced because of the new
test)
8< -
On ARM NEON doesn't support double, so __is_intrinsic_type_v should say false (instead of being ill-formed).
Signed-off-by: Matthias Kretz
libstdc++-v3/ChangeLog:
PR l
Signed-off-by: Matthias Kretz
libstdc++-v3/ChangeLog:
PR libstdc++/109261
* include/experimental/bits/simd_neon.h (_S_reduce): Add
constexpr and make NEON implementation conditional on
not __builtin_is_constant_evaluated.
---
.../include/experimental/bits/simd_n
I pushed the attached patch.
I kept the operator names... too late, there were already operator names in
the stdx::simd implemenation anyway. ;)
- Matthias
On Monday, 22 May 2023 22:51:49 CEST Jonathan Wakely wrote:
> On Mon, 22 May 2023 at 21:27, Matthias Kretz wrote:
> > On Monday, 22 May 20
On Monday, 22 May 2023 18:25:15 CEST Jonathan Wakely wrote:
> I note that using if (not __builtin_constant_evaluated()) will fail if
> compiled with -fno-operator-names, which is why we don't use 'not', 'and',
> etc. elsewhere in libstdc++. I don't know if (or why) anybody uses that
> option though
OK for trunk and backporting?
regtested on x86_64-linux and aarch64-linux
The constexpr API is only available with -std=gnu++XX (and proposed for
C++26). The proposal is to have the complete simd API usable in constant
expressions.
This patch resolves several issues with using simd in constant
e
pushed to master, will backport later
regtested on x86_64-linux
Signed-off-by: Matthias Kretz
libstdc++-v3/ChangeLog:
* include/experimental/bits/simd_builtin.h (_S_fpclassify): Move
__infn into #ifdef'ed block.
* testsuite/experimental/simd/tests/fpclassify.cc: Declare
This resolves a regression of my previous fix where Clang would ICE on
_S_divides.
Signed-off-by: Matthias Kretz
libstdc++-v3/ChangeLog:
* include/experimental/bits/simd_x86.h (_SimdImplX86): Use
_Base::_S_divides if the optimized _S_divides function is hidden
via the
I don't know how, but I forgot to implement the
is_simd_flag_type trait. This fixes it.
No new check-simd failures on x86_64-pc-linux-gnu
--- 8< --
Signed-off-by: Matthias Kretz
libstdc++-v3/ChangeLog:
* include/experimental/bits/simd.h (is_simd_flag_type)
Tested on x86_64-pc-linux-gnu.
- 8< ---
Signed-off-by: Matthias Kretz
libstdc++-v3/ChangeLog:
* include/experimental/bits/simd_x86.h
(_SimdImplX86::_S_divides): Replace test for __GCC_IEC_559 == 0
with __RECIPROCAL_MATH__.
---
libstdc++-v3/include/exper
Tested on x86_64-pc-linux-gnu.
- 8< ---
Clang ICEs on _SimdImplX86::_S_divides. The function is only working
around a missed optimization and not necessary for correctness.
Therefore, don't use it for Clang.
Signed-off-by: Matthias Kretz
libstdc++-v3/ChangeLog:
* inclu
Slightly modified patch. I had to fix floating-point AVX512 blending on
Clang by removing a cast. While at it I cleaned up the -Wundef noise.
- 8< --
Clang fails to compile some constant expressions involving simd.
Therefore, just disable this non-conforming extension for clang.
Fix AVX
Clang fails to compile some constant expressions involving simd.
Therefore, just disable this non-conforming extension for clang.
Fix AVX512 blend implementation for Clang. It was converting the bitmask
to bool before, which is obviously wrong. Instead use a Clang builtin to
convert the bitmask
Signed-off-by: Matthias Kretz
libstdc++-v3/ChangeLog:
* testsuite/experimental/simd/tests/operators.cc: Clang doesn't
define __GCC_IEC_559. Use __STDC_IEC_559__ instead.
---
.../testsuite/experimental/simd/tests/operators.cc | 9 -
1 file changed, 8 insertions(+)
Up to now, compiling std::experimental::simd with Clang would lead to wrong
code, not compiling, or ICEs. After these patches I hope it's only ICEs.
Tested on x86_64-pc-linux-gnu.
Matthias Kretz (2):
libstdc++: Fix simd test compilation with Clang
libstdc++: Fix simd compilation with Clang
On Friday, 24 February 2023 18:14:53 CET Jonathan Wakely wrote:
> Looks like there are a few remaining spaces that could be removed
> where you've joined lines, e.g.
Fixed and pushed.
> OK for trunk anyway (and the branches if you want).
I'll likely backport after I backported all other patches
On Thursday, 23 February 2023 12:07:11 CET Jonathan Wakely wrote:
> On Thu, 23 Feb 2023 at 08:55, Matthias Kretz via Libstdc++
>
> wrote:
> > Resolves -Wtautological-compare warnings about `if
> > (__builtin_is_constant_evaluated())` in the implementations of these
> > functions.
>
> The 'inline
Tested on x86_64-pc-linux.
This patchset provides the final changes for PR108030 and resolves
PR108856. The latter is a pure optimization and could wait for Stage 1 (I'm
submitting the patch because simd is experimental/TS)
Matthias Kretz (8):
libstdc++: Simplify three helper functions into o
Broadcast is a very common function. This should reduce compile-time
effort.
Signed-off-by: Matthias Kretz
libstdc++-v3/ChangeLog:
PR libstdc++/108030
* include/experimental/bits/simd.h (__vector_broadcast):
Implement via __vector_broadcast_impl instead of
__ca
Signed-off-by: Matthias Kretz
libstdc++-v3/ChangeLog:
PR libstdc++/108856
* include/experimental/bits/simd_builtin.h
(_SimdImplBuiltin::_S_masked_unary): More efficient
implementation of masked inc-/decrement for integers and floats
without AVX2.
For simd, the inlining behavior should be similar to builtin types. (No
operator on buitin types is ever translated into a function call.)
Therefore, always_inline is the right choice (i.e. inline on -O0 as
well).
Signed-off-by: Matthias Kretz
libstdc++-v3/ChangeLog:
PR libstdc++/1080
Clang does not support __attribute__ on lambdas. Therefore, only set
_GLIBCXX_SIMD_ALWAYS_INLINE_LAMBDA if __clang__ is not defined.
Signed-off-by: Matthias Kretz
libstdc++-v3/ChangeLog:
PR libstdc++/108030
* include/experimental/bits/simd_detail.h
(_GLIBCXX_SIMD_ALWAY
Signed-off-by: Matthias Kretz
libstdc++-v3/ChangeLog:
* include/experimental/bits/simd_builtin.h (_S_set): Compare as
int. The actual range of these indexes is very small.
---
libstdc++-v3/include/experimental/bits/simd_builtin.h | 2 +-
1 file changed, 1 insertion(+), 1 delet
Whitespace changes only.
Signed-off-by: Matthias Kretz
libstdc++-v3/ChangeLog:
* include/experimental/bits/simd.h: Line breaks and indenting
fixed to follow the libstdc++ standard.
* include/experimental/bits/simd_builtin.h: Likewise.
* include/experimental/bit
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 con
Signed-off-by: Matthias Kretz
libstdc++-v3/ChangeLog:
* testsuite/experimental/simd/tests/reductions.cc: Introduce
max_distance as the type-dependent max error.
---
libstdc++-v3/testsuite/experimental/simd/tests/reductions.cc | 3 ++-
1 file changed, 2 insertions(+), 1 deletio
Tested x86_64-pc-linux. Pushed to trunk.
-- >8 --
Signed-off-by: Matthias Kretz
libstdc++-v3/ChangeLog:
* include/experimental/bits/simd.h (__extract_part, split):
Use reserved name for template parameter.
---
libstdc++-v3/include/experimental/bits/simd.h | 22 +---
Signed-off-by: Matthias Kretz
libstdc++-v3/ChangeLog:
* include/experimental/bits/simd_x86.h
(_SimdImplX86::_S_not_equal_to, _SimdImplX86::_S_less)
(_SimdImplX86::_S_less_equal): Do not call
__builtin_is_constant_evaluated in constexpr-if.
---
.../include/exper
Signed-off-by: Matthias Kretz
libstdc++-v3/ChangeLog:
* testsuite/experimental/simd/generate_makefile.sh: Generate and
pre-compile pch.h, which includes all headers that do not depend
on command-line macros.
* testsuite/experimental/simd/tests/bits/conversions.h:
Signed-off-by: Matthias Kretz
libstdc++-v3/ChangeLog:
* testsuite/experimental/simd/tests/bits/verify.h
(verify::verify): Use %zx for size_t in format string.
---
libstdc++-v3/testsuite/experimental/simd/tests/bits/verify.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
All of the annotated lambdas are simply a necessary means for
implementing these functions and should never result in an actual
function call. Many of these lambdas would go away if C++ had better
language support for packs.
Signed-off-by: Matthias Kretz
libstdc++-v3/ChangeLog:
PR lib
Signed-off-by: Matthias Kretz
libstdc++-v3/ChangeLog:
* include/experimental/bits/simd_math.h (__hypot): Bitcasting
between scalars requires the __bit_cast helper function instead
of simd_bit_cast.
---
libstdc++-v3/include/experimental/bits/simd_math.h | 4 ++--
1 file
Signed-off-by: Matthias Kretz
libstdc++-v3/ChangeLog:
* testsuite/experimental/simd/README.md: Document the timeout
and timeout-factor directives. Minor typo fixed.
---
libstdc++-v3/testsuite/experimental/simd/README.md | 10 --
1 file changed, 8 insertions(+), 2 delet
The more expensive code path should only be taken if it can be optimized
away.
Signed-off-by: Matthias Kretz
libstdc++-v3/ChangeLog:
* include/experimental/bits/simd.h
(_SimdWrapper::_M_is_constprop_none_of)
(_SimdWrapper::_M_is_constprop_all_of): Return false unless t
As suggested in PR108030, I used __attribute__ syntax to annotate lambdas
as always_inline. In few cases the lambda was meant to be a function
boundary and the attribute was omitted.
PR108030 mentions a few more functions as problematic. But ideally these
should not be inline in some fixed_size
On Friday, 29 April 2022 03:53:40 CEST Alexandre Oliva via Gcc-patches wrote:
> Thanks, awaiting feedback on the suggestion above to post the consolidated
> patch.
LGTM. I think this improves clarity for the __intrisic_type static assertions
significantly.
And don't bother with my other mail. If
On Thursday, 28 April 2022 08:09:54 CEST Alexandre Oliva via Gcc-patches
wrote:
> libstdc++'s bits/simd.h section for PPC (Altivec) defines various
> intrinsic vector types that are only available along with VSX: 64-bit
> long double, double, (un)signed long long, and 64-bit (un)signed long.
Oh,
On Friday, 1 April 2022 13:33:42 CEST Jonathan Wakely wrote:
> Matthias didn't like my Princess Bride easter egg :-)
> Would the attached be better?
LGTM.
--
──
Dr. Matthias Kretz https://mattkretz
I like it. But I'd like it even more if we could have
#elif defined _UBSAN
__ubsan_invoke_ub("reached std::unreachable()");
But to my knowledge UBSAN has no hooks for the library like this (yet).
and...
On Thursday, 31 March 2022 17:30:29 CEST Jonathan Wakely via Gcc-patches
wrote:
> diff
53 matches
Mail list logo