public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: Matthias Kretz <m.kretz@gsi.de>
Cc: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org
Subject: Re: [PATCH 2/2] libstdc++: Fix simd compilation with Clang
Date: Tue, 21 Mar 2023 11:19:35 +0000	[thread overview]
Message-ID: <CACb0b4nf-+u34UiV7DZ=v-06_qjBWVddihSWdTtOyg0c5fvfDg@mail.gmail.com> (raw)
In-Reply-To: <25835488.EfDdHjke4D@minbar>

[-- Attachment #1: Type: text/plain, Size: 1338 bytes --]

On Tue, 21 Mar 2023 at 09:24, Matthias Kretz via Libstdc++ <
libstdc++@gcc.gnu.org> wrote:

>
>
> 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 to vector-mask before using a vector blend ?:. A
> similar change is required for the masked unary implementation, because
> the GCC builtins do not exist on Clang.
>
> Signed-off-by: Matthias Kretz <m.kretz@gsi.de>
>
> libstdc++-v3/ChangeLog:
>
>         * include/experimental/bits/simd_detail.h: Don't declare the
>         simd API as constexpr with Clang.
>         * include/experimental/bits/simd_x86.h (__movm): New.
>         (_S_blend_avx512): Resolve FIXME. Implement blend using __movm
>         and ?:.
>         (_SimdImplX86::_S_masked_unary): Clang does not implement the
>         same builtins. Implement the function using __movm, ?:, and -
>         operators on vector_size types instead.
>


+#if (defined __STRICT_ANSI__ && __STRICT_ANSI__) || defined __clang__

We don't generally are about -Wundef so this could be simplified to:

#if __STRICT_ANSI__ || defined __clang__

But it's OK as it is. OK for trunk.

  reply	other threads:[~2023-03-21 11:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-21  9:22 [PATCH 0/2] Make std::experimental::simd (more) usable " Matthias Kretz
2023-03-21  9:23 ` [PATCH 1/2] libstdc++: Fix simd test compilation " Matthias Kretz
2023-03-21 11:16   ` Jonathan Wakely
2023-03-21  9:23 ` [PATCH 2/2] libstdc++: Fix simd " Matthias Kretz
2023-03-21 11:19   ` Jonathan Wakely [this message]
2023-03-21 17:01     ` [committed] " Matthias Kretz

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='CACb0b4nf-+u34UiV7DZ=v-06_qjBWVddihSWdTtOyg0c5fvfDg@mail.gmail.com' \
    --to=jwakely@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    --cc=m.kretz@gsi.de \
    /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).