public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/110227] New: gcc generates invalid AVX-512 code
@ 2023-06-12 14:47 joseph.weening at gmail dot com
  2023-06-12 14:51 ` [Bug target/110227] " joseph.weening at gmail dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: joseph.weening at gmail dot com @ 2023-06-12 14:47 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110227

            Bug ID: 110227
           Summary: gcc generates invalid AVX-512 code
           Product: gcc
           Version: 13.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: joseph.weening at gmail dot com
  Target Milestone: ---

gcc version 13.1.0 (GCC)
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-13.1.0/configure --prefix=/usr/local/gcc/13.1.0
--disable-multilib --enable-languages=c,c++,fortran
--with-gmp=/usr/local/gmp/6.2.1 --with-mpc=/usr/local/mpc/1.3.1
--with-mpfr=/usr/local/mpfr/4.2.0 --with-isl=/usr/local/isl/0.24

The following program generates an error:
  /tmp/ccAuHFqz.s: Assembler messages:
  /tmp/ccAuHFqz.s:28: Error: unsupported instruction `vpcmpeqd'
The assembly code contains
        vpcmpeqd         %xmm16, %xmm16, %xmm16
which perhaps is invalid for xmm registers above 15.

#include <immintrin.h>

__attribute__((noinline))
static void vswap(int32_t *x) {
  __m256i x0 = _mm256_loadu_si256((__m256i *) (&x[0]));
  __m256i x1 = _mm256_loadu_si256((__m256i *) (&x[1]));
  _mm256_storeu_si256((__m256i *) (&x[0]),(x1));
  _mm256_storeu_si256((__m256i *) (&x[1]),(x0));
}

void vproc(int32_t *x) {
  for (int32_t p=4; p>=1; p>>=1) {
    if (p == 4) {
      __m256i mask = _mm256_set_epi32(0, 0, 0, 0, -1, -1, -1, -1);
      __m256i x0 = _mm256_loadu_si256((__m256i *) (&x[0]));
      x0 = _mm256_xor_si256(x0, mask);
      _mm256_storeu_si256((__m256i *) (&x[0]),(x0));
    }
    vswap(x);
  }
}

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-11-30 10:54 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-12 14:47 [Bug target/110227] New: gcc generates invalid AVX-512 code joseph.weening at gmail dot com
2023-06-12 14:51 ` [Bug target/110227] " joseph.weening at gmail dot com
2023-06-12 15:43 ` [Bug target/110227] [13/14 Regression] " pinskia at gcc dot gnu.org
2023-06-13  3:06 ` crazylht at gmail dot com
2023-06-13 11:41 ` jakub at gcc dot gnu.org
2023-06-13 13:55 ` rguenth at gcc dot gnu.org
2023-06-14  8:19 ` cvs-commit at gcc dot gnu.org
2023-06-14  8:20 ` cvs-commit at gcc dot gnu.org
2023-06-14  8:21 ` crazylht at gmail dot com
2023-07-27  9:26 ` rguenth at gcc dot gnu.org
2023-11-30 10:54 ` liuhongt at gcc dot gnu.org

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).