public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "nikita.shulga at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/97028] New: Compilation errors for AVX512 intrinsic with -masm=intel
Date: Sat, 12 Sep 2020 00:38:37 +0000	[thread overview]
Message-ID: <bug-97028-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 97028
           Summary: Compilation errors for AVX512 intrinsic with
                    -masm=intel
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nikita.shulga at gmail dot com
  Target Milestone: ---

Following code snippet, containing no asm blocks can be compiled just fine with
'-Os -mavx512f' options, by compilation fails using gcc-9.0 or newer if
'-masm=intel' is added:
#include <immintrin.h>

float foo(float* con) {
    __mmask16 msk = 0x00ff;
    __m512 a = _mm512_maskz_loadu_ps(msk, con);
    __m512 b = _mm512_set1_ps(con[1]);
    __m512 c = _mm512_mul_ps(a,b);
    return ((float *)&c)[0];
}

That is:
$ gcc -c -Os -mavx512f mul.c ; echo $?
0
$ gcc -c -Os -masm=intel -mavx512f mul.c ; echo $?
/tmp/ccmeN1OP.s: Assembler messages:
/tmp/ccmeN1OP.s:12: Error: invalid use of register
1

And the offending instruction looks as follows:
$ gcc -S -o - -Os -masm=intel -mavx512f mul.c|head -n 12|tail -n1
        vmulps  zmm0, zmm0, DWORD PTR [rdi+4]<{1to16}>

But compilation works just fine if gcc-8 is used instead.

             reply	other threads:[~2020-09-12  0:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-12  0:38 nikita.shulga at gmail dot com [this message]
2020-09-12  0:44 ` [Bug target/97028] " nikita.shulga at gmail dot com
2020-09-14  7:10 ` rguenth at gcc dot gnu.org
2020-09-14  7:25 ` [Bug target/97028] [9/10/11 Regression] " jakub at gcc dot gnu.org
2020-09-14  7:29 ` jakub at gcc dot gnu.org
2020-09-14  7:47 ` jakub at gcc dot gnu.org
2020-09-15  7:40 ` cvs-commit at gcc dot gnu.org
2020-09-15  8:29 ` cvs-commit at gcc dot gnu.org
2020-09-15  8:29 ` cvs-commit at gcc dot gnu.org
2020-09-15  8:29 ` jakub at gcc dot gnu.org

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=bug-97028-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).