public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Binutils <binutils@sourceware.org>
Subject: Re: [PATCH] x86: don't mistake ordinary immediates for SAE / rounding control
Date: Thu, 14 Apr 2022 08:23:55 -0700	[thread overview]
Message-ID: <CAMe9rOrXE99XcrZrQW-8YO_UUHQgZ2ZBWTiwjbXC5QAH7TRZdQ@mail.gmail.com> (raw)
In-Reply-To: <f59f40ed-50a7-e574-1c6a-adba9c46a922@suse.com>

On Thu, Apr 14, 2022 at 7:12 AM Jan Beulich <jbeulich@suse.com> wrote:
>
> The way SAE templates are constructed was always puzzling me (including
> the need for separate templates in the first place), and expressing the
> extzra attribute via Imm8 actually has a bad effect: Ordinary immediates
> would also be accepted, leading to an extra byte being added after the
> instruction (i.e. generating bad code). Before re-working this (in
> particular to accept proper Intel syntax there), fix the immediate issue
> by adding the so far missing check.
>
> --- a/gas/config/tc-i386.c
> +++ b/gas/config/tc-i386.c
> @@ -6285,6 +6285,11 @@ check_VecOperands (const insn_template *
>           return 1;
>         }
>      }
> +  else if (t->opcode_modifier.sae)
> +    {
> +       i.error = unsupported_syntax;
> +       return 1;
> +    }
>
>    /* Check the special Imm4 cases; must be the first operand.  */
>    if (t->cpu_flags.bitfield.cpuxop && t->operands == 5)
> --- a/gas/testsuite/gas/i386/inval-avx512f.l
> +++ b/gas/testsuite/gas/i386/inval-avx512f.l
> @@ -218,6 +218,8 @@
>  .*:313: Error: .*unsupported broadcast for `vcvtneps2bf16'
>  .*:316: Error: .*unsupported broadcast for `vcvtneps2bf16'
>  .*:319: Error: .*unsupported broadcast for `vcvtneps2bf16'
> +.*:321: Error: .*vaddps.*
> +.*:322: Error: .*vcmpss.*
>  GAS LISTING .*
>
>
> @@ -569,6 +571,7 @@ GAS LISTING .*
>  [      ]*318 \?\?\?\? 62F27E38[        ]+vcvtneps2bf16 \(%eax\)\{1to8\}, %xmm1
>  [      ]*318[  ]+7208
>  [      ]*319[  ]+vcvtneps2bf16 \(%eax\)\{1to16\}, %xmm1
> -[      ]*320[  ]+\?\?\?\? 8DB42600             \.p2align 4
> -[      ]*320[  ]+0000008D
> -[      ]*320[  ]+7600
> +[      ]*320[  ]*
> +[      ]*321[  ]+vaddps \$0xcc, %zmm0, %zmm0, %zmm0
> +[      ]*322[  ]+vcmpss \$0, \$0xcc, %xmm0, %xmm0, %k0
> +#pass
> --- a/gas/testsuite/gas/i386/inval-avx512f.s
> +++ b/gas/testsuite/gas/i386/inval-avx512f.s
> @@ -317,4 +317,8 @@ _start:
>         vcvtneps2bf16 (%eax){1to4}, %xmm1
>         vcvtneps2bf16 (%eax){1to8}, %xmm1
>         vcvtneps2bf16 (%eax){1to16}, %xmm1
> +
> +       vaddps $0xcc, %zmm0, %zmm0, %zmm0
> +       vcmpss $0, $0xcc, %xmm0, %xmm0, %k0
> +
>         .p2align 4
>

OK.

Thanks.

-- 
H.J.

      reply	other threads:[~2022-04-14 15:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-14 14:12 Jan Beulich
2022-04-14 15:23 ` H.J. Lu [this message]

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=CAMe9rOrXE99XcrZrQW-8YO_UUHQgZ2ZBWTiwjbXC5QAH7TRZdQ@mail.gmail.com \
    --to=hjl.tools@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=jbeulich@suse.com \
    /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).