public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Hongtao Liu <crazylht@gmail.com>
To: Hongyu Wang <wwwhhhyyy333@gmail.com>
Cc: "H.J. Lu" <hjl.tools@gmail.com>, liuhongt <hongtao.liu@intel.com>,
	 GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] x86: Use x constraint on KL patterns
Date: Sat, 26 Mar 2022 14:51:19 +0800	[thread overview]
Message-ID: <CAMZc-bxeJ9EQKv+hrtkB2NyC7-6cXrDuYKjabBpPF-cAUmDXyQ@mail.gmail.com> (raw)
In-Reply-To: <CA+OydWnUchrbHDBQQbCKQArLD9GrUB51avXo=2v0aUk_jBURtA@mail.gmail.com>

On Sat, Mar 26, 2022 at 10:05 AM Hongyu Wang via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> > > Is it possible to create a test case that gas would throw an error for
> > > invalid operands?
> >
> > You can use -ffix-xmmN to disable XMM0-15.
>
> I mean can we create an intrinsic test for this PR that produces xmm16-31?
> And the -ffix-xmmN is an option for assembler or compiler? I didn't
> find it in document.
Can be reproduced by below testcase.
 #include <immintrin.h>

 unsigned int ctrl;
 __m128i k1, k2, k3;

 void
 test_keylocker_11 (void)
 {
   register __m128i k4 __asm ("xmm16") = k2;
  asm volatile ("" : "+v" (k4));
  _mm_loadiwkey (ctrl, k1, k4, k3);
}

/tmp/ccy9VHP9.s: Assembler messages:
/tmp/ccy9VHP9.s:13: Error: unsupported instruction `loadiwkey'

>
> H.J. Lu <hjl.tools@gmail.com> 于2022年3月26日周六 09:22写道:
> >
> > On Fri, Mar 25, 2022 at 6:08 PM Hongyu Wang <wwwhhhyyy333@gmail.com> wrote:
> > >
> > > Is it possible to create a test case that gas would throw an error for
> > > invalid operands?
> >
> > You can use -ffix-xmmN to disable XMM0-15.
> >
> > > H.J. Lu via Gcc-patches <gcc-patches@gcc.gnu.org> 于2022年3月26日周六 04:50写道:
> > > >
> > > > Since KL instructions have no AVX512 version, replace the "v" register
> > > > constraint with the "x" register constraint.
> > > >
> > > >         PR target/105058
> > > >         * config/i386/sse.md (loadiwkey): Replace "v" with "x".
> > > >         (aes<aesklvariant>u8): Likewise.
> > > > ---
> > > >  gcc/config/i386/sse.md | 6 +++---
> > > >  1 file changed, 3 insertions(+), 3 deletions(-)
> > > >
> > > > diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
> > > > index 29802d00ce6..33bd2c4768a 100644
> > > > --- a/gcc/config/i386/sse.md
> > > > +++ b/gcc/config/i386/sse.md
> > > > @@ -28364,8 +28364,8 @@ (define_insn "avx512f_dpbf16ps_<mode>_mask"
> > > >
> > > >  ;; KEYLOCKER
> > > >  (define_insn "loadiwkey"
> > > > -  [(unspec_volatile:V2DI [(match_operand:V2DI 0 "register_operand" "v")
> > > > -                         (match_operand:V2DI 1 "register_operand" "v")
> > > > +  [(unspec_volatile:V2DI [(match_operand:V2DI 0 "register_operand" "x")
> > > > +                         (match_operand:V2DI 1 "register_operand" "x")
> > > >                           (match_operand:V2DI 2 "register_operand" "Yz")
> > > >                           (match_operand:SI   3 "register_operand" "a")]
> > > >                          UNSPECV_LOADIWKEY)
> > > > @@ -28498,7 +28498,7 @@ (define_int_attr aesklvariant
> > > >     (UNSPECV_AESENC256KLU8 "enc256kl")])
> > > >
> > > >  (define_insn "aes<aesklvariant>u8"
> > > > -  [(set (match_operand:V2DI 0 "register_operand" "=v")
> > > > +  [(set (match_operand:V2DI 0 "register_operand" "=x")
> > > >         (unspec_volatile:V2DI [(match_operand:V2DI 1 "register_operand" "0")
> > > >                                (match_operand:BLK   2 "memory_operand" "m")]
> > > >                               AESDECENCKL))
> > > > --
> > > > 2.35.1
> > > >
> >
> >
> >
> > --
> > H.J.



-- 
BR,
Hongtao

  parent reply	other threads:[~2022-03-26  6:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-25 20:50 H.J. Lu
2022-03-26  1:08 ` Hongyu Wang
2022-03-26  1:22   ` H.J. Lu
2022-03-26  2:04     ` Hongyu Wang
2022-03-26  2:08       ` H.J. Lu
2022-03-26  6:51       ` Hongtao Liu [this message]
2022-03-26  6:35 ` Hongtao Liu

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=CAMZc-bxeJ9EQKv+hrtkB2NyC7-6cXrDuYKjabBpPF-cAUmDXyQ@mail.gmail.com \
    --to=crazylht@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hjl.tools@gmail.com \
    --cc=hongtao.liu@intel.com \
    --cc=wwwhhhyyy333@gmail.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).