[PATCH] libstdc++: Rewrite or avoid casts to 64-bit element types
Jonathan Wakely
jwakely@redhat.com
Tue Jun 6 15:54:47 GMT 2023
On Tue, 6 Jun 2023 at 15:14, Matthias Kretz via Libstdc++ <
libstdc++@gcc.gnu.org> wrote:
> Last part to resolve test failure introduced with PR109822.
>
> OK for master and backports (gcc-11 doesn't have __builtin_shufflevector,
> though)?
>
Yep, OK.
>
> 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 targets.
>
> Replace __extract_part implementation (which was the only user of
> __shift_elements_right) by relying on __builtin_shufflevector (not
> available in GCC 11). This removes another cast to 64-bit element type,
> which breaks on non-VSX POWER.
>
> Signed-off-by: Matthias Kretz <m.kretz@gsi.de>
>
> libstdc++-v3/ChangeLog:
>
> PR libstdc++/109822
> * include/experimental/bits/simd.h: Include <bits/stl_algo.h>
> for min(initializer_list).
> Define __intrinsic_type_impl for all vectorizable types, but
> without type member, if the target doesn't support it.
> * include/experimental/bits/simd_builtin.h (__idx_permute): New.
> (__shift_elements_right): Removed.
> (__extract_part): Rewrite using __idx_permute.
> (_S_reduce): Avoid unconditional cast to 64-bit element type
> when the element type is known to be smaller.
> ---
> libstdc++-v3/include/experimental/bits/simd.h | 34 ++-
> .../include/experimental/bits/simd_builtin.h | 250 +++++-------------
> 2 files changed, 96 insertions(+), 188 deletions(-)
>
>
> --
> ──────────────────────────────────────────────────────────────────────────
> Dr. Matthias Kretz https://mattkretz.github.io
> GSI Helmholtz Centre for Heavy Ion Research https://gsi.de
> stdₓ::simd
> ──────────────────────────────────────────────────────────────────────────
More information about the Libstdc++
mailing list