public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Symbol + Constant output.
@ 2020-11-01 13:04 Iain Sandoe
  2020-11-02 10:21 ` Uros Bizjak
  0 siblings, 1 reply; 8+ messages in thread
From: Iain Sandoe @ 2020-11-01 13:04 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: gcc

Hi Uros,

I was looking into the test fails for the new keylocker-* testcases.

Many are because of missing “_” (which seems to happen more often than  
not).  These I can fix trivially.

But some are because we have:

name+constant(%rip) being emitted on Linux

and

constant+name(%rip) being emitted on Darwin.

——

The reason is that Darwin is always PIC and so outputs
(const:DI (plus:DI (symbol_ref:DI ("h2") [flags 0x2] <var_decl  
0x7ffff55e3c60 h2>)
         (const_int 16 [0x10])))

using - gcc/i386.c:output_pic_addr_const

Linux outputs the same thing

using - gcc/final.c:output_addr_const

====

for the PLUS case final.c says:

       /* Some assemblers need integer constants to appear last (eg masm).  */


for the PLUS case i386.c says:

       /* Some assemblers need integer constants to appear first.  */

=====

So .. I could make a really tedious patch to match the different forms in the
keylocker tests for Darwin ..

.. but ISTM that maybe one of those comments is wrong / out of date - and the
right thing would be to fix that.

Any insight welcome,

thanks
Iain



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

* Re: Symbol + Constant output.
  2020-11-01 13:04 Symbol + Constant output Iain Sandoe
@ 2020-11-02 10:21 ` Uros Bizjak
  2020-11-04  8:08   ` Hongyu Wang
  0 siblings, 1 reply; 8+ messages in thread
From: Uros Bizjak @ 2020-11-02 10:21 UTC (permalink / raw)
  To: GCC Development; +Cc: Iain Sandoe, 玩还有

On Sun, Nov 1, 2020 at 2:04 PM Iain Sandoe <iain@sandoe.co.uk> wrote:
>
> Hi Uros,
>
> I was looking into the test fails for the new keylocker-* testcases.
>
> Many are because of missing “_” (which seems to happen more often than
> not).  These I can fix trivially.
>
> But some are because we have:
>
> name+constant(%rip) being emitted on Linux
>
> and
>
> constant+name(%rip) being emitted on Darwin.
>
> ——
>
> The reason is that Darwin is always PIC and so outputs
> (const:DI (plus:DI (symbol_ref:DI ("h2") [flags 0x2] <var_decl
> 0x7ffff55e3c60 h2>)
>          (const_int 16 [0x10])))
>
> using - gcc/i386.c:output_pic_addr_const
>
> Linux outputs the same thing
>
> using - gcc/final.c:output_addr_const
>
> ====
>
> for the PLUS case final.c says:
>
>        /* Some assemblers need integer constants to appear last (eg masm).  */
>
>
> for the PLUS case i386.c says:
>
>        /* Some assemblers need integer constants to appear first.  */
>
> =====
>
> So .. I could make a really tedious patch to match the different forms in the
> keylocker tests for Darwin ..
>
> .. but ISTM that maybe one of those comments is wrong / out of date - and the
> right thing would be to fix that.

I don't know which assemblers are referred to in the comment, but gas
accepts both forms:

       mov k2+16(%rip), %eax
       mov 16+k2(%rip), %eax

> Any insight welcome,

Maybe those scan-asm regexp are too strict and should be relaxed a
bit. Please resolve this issue with the author (CC'd).

Uros.

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

* Re: Symbol + Constant output.
  2020-11-02 10:21 ` Uros Bizjak
@ 2020-11-04  8:08   ` Hongyu Wang
  2020-11-04  8:26     ` Iain Sandoe
  0 siblings, 1 reply; 8+ messages in thread
From: Hongyu Wang @ 2020-11-04  8:08 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: GCC Development, Iain Sandoe

> Maybe those scan-asm regexp are too strict and should be relaxed a
> bit.

I agree with this, since with -fPIC the code produced would be different,
just use symbol + constant may be too strict.

I think the scan-assembler could be reduced to
/* { dg-final { scan-assembler "(?:movdqu|movups)\[
\\t\]+\[^\n\]*%xmm1,\[^\n\r]*16" } } */

> for the PLUS case i386.c says:
>
>        /* Some assemblers need integer constants to appear first.  */
>
> =====

It seems with pic the format should be opposite to non-pic, if so, the comment
does not need change IMHO.

Uros Bizjak <ubizjak@gmail.com> 于2020年11月2日周一 下午6:21写道:
>
> On Sun, Nov 1, 2020 at 2:04 PM Iain Sandoe <iain@sandoe.co.uk> wrote:
> >
> > Hi Uros,
> >
> > I was looking into the test fails for the new keylocker-* testcases.
> >
> > Many are because of missing “_” (which seems to happen more often than
> > not).  These I can fix trivially.
> >
> > But some are because we have:
> >
> > name+constant(%rip) being emitted on Linux
> >
> > and
> >
> > constant+name(%rip) being emitted on Darwin.
> >
> > ——
> >
> > The reason is that Darwin is always PIC and so outputs
> > (const:DI (plus:DI (symbol_ref:DI ("h2") [flags 0x2] <var_decl
> > 0x7ffff55e3c60 h2>)
> >          (const_int 16 [0x10])))
> >
> > using - gcc/i386.c:output_pic_addr_const
> >
> > Linux outputs the same thing
> >
> > using - gcc/final.c:output_addr_const
> >
> > ====
> >
> > for the PLUS case final.c says:
> >
> >        /* Some assemblers need integer constants to appear last (eg masm).  */
> >
> >
> > for the PLUS case i386.c says:
> >
> >        /* Some assemblers need integer constants to appear first.  */
> >
> > =====
> >
> > So .. I could make a really tedious patch to match the different forms in the
> > keylocker tests for Darwin ..
> >
> > .. but ISTM that maybe one of those comments is wrong / out of date - and the
> > right thing would be to fix that.
>
> I don't know which assemblers are referred to in the comment, but gas
> accepts both forms:
>
>        mov k2+16(%rip), %eax
>        mov 16+k2(%rip), %eax
>
> > Any insight welcome,
>
> Maybe those scan-asm regexp are too strict and should be relaxed a
> bit. Please resolve this issue with the author (CC'd).
>
> Uros.

-- 
Regards,

Hongyu, Wang

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

* Re: Symbol + Constant output.
  2020-11-04  8:08   ` Hongyu Wang
@ 2020-11-04  8:26     ` Iain Sandoe
  2020-11-04  9:01       ` Hongyu Wang
  0 siblings, 1 reply; 8+ messages in thread
From: Iain Sandoe @ 2020-11-04  8:26 UTC (permalink / raw)
  To: Hongyu Wang; +Cc: GCC Development

Hi,

Hongyu Wang via Gcc <gcc@gcc.gnu.org> wrote:

>> Maybe those scan-asm regexp are too strict and should be relaxed a
>> bit.
>
> I agree with this, since with -fPIC the code produced would be different,
> just use symbol + constant may be too strict.
>
> I think the scan-assembler could be reduced to
> /* { dg-final { scan-assembler "(?:movdqu|movups)\[
> \\t\]+\[^\n\]*%xmm1,\[^\n\r]*16" } } */

1. might I suggest using the {} form of quoting these regexes - it makes  
them much more readable.

… e.g. more like this:
{(?:movdqu|movups)[\t]+[^\n]*%xmm1,[^\n\r]*16}

2. I think there are some syntax errors in the regexes for these tests
    (because it’s very hard to check them when using the “” quotes).

  "(?:movdqu|movups)\[ \\t\]+\[^\n\]*%xmm1,\[^\n\r]*16"
………………………………………………………^ missing \ (in several places)

3. are you intending to update the tests?


==== As for the comments on the asm output.

1) it would seem that both comments can’t be correct (since they contradict!)
2) AFAICT, None of the assemblers I use has any issue with either order
3) perhaps there’s no assembler in use that cares any more
4) clang produces symbol+offset for that case on Darwin (i.e. the same as  
final.c).

thanks
Iain


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

* Re: Symbol + Constant output.
  2020-11-04  8:26     ` Iain Sandoe
@ 2020-11-04  9:01       ` Hongyu Wang
  2020-11-04  9:19         ` Iain Sandoe
  0 siblings, 1 reply; 8+ messages in thread
From: Hongyu Wang @ 2020-11-04  9:01 UTC (permalink / raw)
  To: Iain Sandoe; +Cc: GCC Development

Hi,

> 1. might I suggest using the {} form of quoting these regexes - it makes
> them much more readable.

Sure.

> 2. I think there are some syntax errors in the regexes for these tests
>     (because it’s very hard to check them when using the “” quotes).
>
>   "(?:movdqu|movups)\[ \\t\]+\[^\n\]*%xmm1,\[^\n\r]*16"
> ………………………………………………………^ missing \ (in several places)

Sorry, I will change them.

> 3. are you intending to update the tests?

Yes, so could you tell me what does missing “_” means? I have some
trouble building darwin target for now.

> ==== As for the comments on the asm output.
>
> 1) it would seem that both comments can’t be correct (since they contradict!)
> 2) AFAICT, None of the assemblers I use has any issue with either order
> 3) perhaps there’s no assembler in use that cares any more
> 4) clang produces symbol+offset for that case on Darwin (i.e. the same as
> final.c).
>

That means the i386.c part should align with final.c, but I can't make the
decision, and I'm not sure if there is more failure in x86 tests with this
change.

Iain Sandoe <iain@sandoe.co.uk> 于2020年11月4日周三 下午4:27写道:
>
> Hi,
>
> Hongyu Wang via Gcc <gcc@gcc.gnu.org> wrote:
>
> >> Maybe those scan-asm regexp are too strict and should be relaxed a
> >> bit.
> >
> > I agree with this, since with -fPIC the code produced would be different,
> > just use symbol + constant may be too strict.
> >
> > I think the scan-assembler could be reduced to
> > /* { dg-final { scan-assembler "(?:movdqu|movups)\[
> > \\t\]+\[^\n\]*%xmm1,\[^\n\r]*16" } } */
>
> 1. might I suggest using the {} form of quoting these regexes - it makes
> them much more readable.
>
> … e.g. more like this:
> {(?:movdqu|movups)[\t]+[^\n]*%xmm1,[^\n\r]*16}
>
> 2. I think there are some syntax errors in the regexes for these tests
>     (because it’s very hard to check them when using the “” quotes).
>
>   "(?:movdqu|movups)\[ \\t\]+\[^\n\]*%xmm1,\[^\n\r]*16"
> ………………………………………………………^ missing \ (in several places)
>
> 3. are you intending to update the tests?
>
>
> ==== As for the comments on the asm output.
>
> 1) it would seem that both comments can’t be correct (since they contradict!)
> 2) AFAICT, None of the assemblers I use has any issue with either order
> 3) perhaps there’s no assembler in use that cares any more
> 4) clang produces symbol+offset for that case on Darwin (i.e. the same as
> final.c).
>
> thanks
> Iain
>


-- 
Regards,

Hongyu, Wang

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

* Re: Symbol + Constant output.
  2020-11-04  9:01       ` Hongyu Wang
@ 2020-11-04  9:19         ` Iain Sandoe
  2020-11-06  7:23           ` Hongyu Wang
  0 siblings, 1 reply; 8+ messages in thread
From: Iain Sandoe @ 2020-11-04  9:19 UTC (permalink / raw)
  To: Hongyu Wang; +Cc: GCC Development

Hi.

Hongyu Wang <wwwhhhyyy333@gmail.com> wrote:

>> 3. are you intending to update the tests?
>
> Yes, so could you tell me what does missing “_” means? I have some
> trouble building darwin target for now.

Darwin uses a USER_LABEL_PREFIX of ‘_’ (there are a small number of targets
that do this).

So public symbols begin with _

In the case that you match like:

…. ^\n]*%xmm0[^\n\r]*k1

there’s no need to make any amendment (since the _ is covered by [^\n\r]).

if you need to match 16+k1 … then for targets using USER_LABEL_PREFIX,
it would need to be 16+_?k1 (so that it matches _k1 for them and k1 for  
Linux)

OK?

(if you want me to test a potential patch on Darwin, that’s also fine).

>> ==== As for the comments on the asm output.
>>
>> 1) it would seem that both comments can’t be correct (since they  
>> contradict!)
>> 2) AFAICT, None of the assemblers I use has any issue with either order
>> 3) perhaps there’s no assembler in use that cares any more
>> 4) clang produces symbol+offset for that case on Darwin (i.e. the same as
>> final.c).
>
> That means the i386.c part should align with final.c, but I can't make the
> decision, and I'm not sure if there is more failure in x86 tests with this
> change.

agreed, it would need wide testing, and perhaps not urgent at this moment but
it would be nice to make things consistent; it helps with maintainance.

Iain


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

* Re: Symbol + Constant output.
  2020-11-04  9:19         ` Iain Sandoe
@ 2020-11-06  7:23           ` Hongyu Wang
  2020-11-06 10:46             ` Iain Sandoe
  0 siblings, 1 reply; 8+ messages in thread
From: Hongyu Wang @ 2020-11-06  7:23 UTC (permalink / raw)
  To: Iain Sandoe; +Cc: GCC Development

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

Hi,

I've adjust the testcase and now it only contains constant offset, since

with -fPIC the mov target address does not contain any symbol in the assembler.

Could you help to check the attached changes on darwin and see if they
all get passed?
(I still can not build darwin target currently)

Thanks.

Iain Sandoe <iain@sandoe.co.uk> 于2020年11月4日周三 下午5:19写道:
>
> Hi.
>
> Hongyu Wang <wwwhhhyyy333@gmail.com> wrote:
>
> >> 3. are you intending to update the tests?
> >
> > Yes, so could you tell me what does missing “_” means? I have some
> > trouble building darwin target for now.
>
> Darwin uses a USER_LABEL_PREFIX of ‘_’ (there are a small number of targets
> that do this).
>
> So public symbols begin with _
>
> In the case that you match like:
>
> …. ^\n]*%xmm0[^\n\r]*k1
>
> there’s no need to make any amendment (since the _ is covered by [^\n\r]).
>
> if you need to match 16+k1 … then for targets using USER_LABEL_PREFIX,
> it would need to be 16+_?k1 (so that it matches _k1 for them and k1 for
> Linux)
>
> OK?
>
> (if you want me to test a potential patch on Darwin, that’s also fine).
>
> >> ==== As for the comments on the asm output.
> >>
> >> 1) it would seem that both comments can’t be correct (since they
> >> contradict!)
> >> 2) AFAICT, None of the assemblers I use has any issue with either order
> >> 3) perhaps there’s no assembler in use that cares any more
> >> 4) clang produces symbol+offset for that case on Darwin (i.e. the same as
> >> final.c).
> >
> > That means the i386.c part should align with final.c, but I can't make the
> > decision, and I'm not sure if there is more failure in x86 tests with this
> > change.
>
> agreed, it would need wide testing, and perhaps not urgent at this moment but
> it would be nice to make things consistent; it helps with maintainance.
>
> Iain
>


-- 
Regards,

Hongyu, Wang

[-- Attachment #2: 0001-Adjust-Keylocker-regex-pattern-for-darwin-and-add-mi.patch --]
[-- Type: text/x-patch, Size: 24020 bytes --]

From 9009ce97099b3a80fdf61a1927c1fff9c7f5b9bf Mon Sep 17 00:00:00 2001
From: hongyuw1 <hongyuw1@intel.com>
Date: Fri, 6 Nov 2020 15:08:10 +0800
Subject: [PATCH] Adjust Keylocker regex pattern for darwin, and add missing
 aesenc256kl test.

gcc/testsuite/ChangeLog

	* gcc.target/i386/keylocker-aesdec128kl.c: Adjust regex patterns.
	* gcc.target/i386/keylocker-aesdec256kl.c: Likewise.
	* gcc.target/i386/keylocker-aesdecwide128kl.c: Likewise.
	* gcc.target/i386/keylocker-aesdecwide256kl.c: Likewise.
	* gcc.target/i386/keylocker-aesenc128kl.c: Likewise.
	* gcc.target/i386/keylocker-aesencwide128kl.c: Likewise.
	* gcc.target/i386/keylocker-aesencwide256kl.c: Likewise.
	* gcc.target/i386/keylocker-encodekey128.c: Likewise.
	* gcc.target/i386/keylocker-encodekey256.c: Likewise.
	* gcc.target/i386/keylocker-aesenc256kl.c: New test.
---
 .../gcc.target/i386/keylocker-aesdec128kl.c   |  8 ++---
 .../gcc.target/i386/keylocker-aesdec256kl.c   |  8 ++---
 .../i386/keylocker-aesdecwide128kl.c          | 36 +++++++++----------
 .../i386/keylocker-aesdecwide256kl.c          | 36 +++++++++----------
 .../gcc.target/i386/keylocker-aesenc128kl.c   |  8 ++---
 .../gcc.target/i386/keylocker-aesenc256kl.c   | 17 +++++++++
 .../i386/keylocker-aesencwide128kl.c          | 36 +++++++++----------
 .../i386/keylocker-aesencwide256kl.c          | 36 +++++++++----------
 .../gcc.target/i386/keylocker-encodekey128.c  | 14 ++++----
 .../gcc.target/i386/keylocker-encodekey256.c  | 18 +++++-----
 10 files changed, 117 insertions(+), 100 deletions(-)
 create mode 100644 gcc/testsuite/gcc.target/i386/keylocker-aesenc256kl.c

diff --git a/gcc/testsuite/gcc.target/i386/keylocker-aesdec128kl.c b/gcc/testsuite/gcc.target/i386/keylocker-aesdec128kl.c
index 3cdda8ed7b0..9c3c8a88b0e 100644
--- a/gcc/testsuite/gcc.target/i386/keylocker-aesdec128kl.c
+++ b/gcc/testsuite/gcc.target/i386/keylocker-aesdec128kl.c
@@ -1,9 +1,9 @@
 /* { dg-do compile } */
 /* { dg-options "-mkl -O2" } */
-/* { dg-final { scan-assembler "movdqa\[ \\t\]+\[^\n\]*k2\[^\n\r]*%xmm0" } } */
-/* { dg-final { scan-assembler "aesdec128kl\[ \\t\]+\[^\n\]*h1\[^\n\r]*%xmm0" } } */
-/* { dg-final { scan-assembler "sete" } } */
-/* { dg-final { scan-assembler "(?:movdqu|movups)\[ \\t\]+\[^\n\]*%xmm0\[^\n\r]*k1" } } */
+/* { dg-final { scan-assembler {movdqa[ \t]+[^\n\r]*, %xmm0} } } */
+/* { dg-final { scan-assembler {aesdec128kl[ \t]+[^\n\r]*, %xmm0} } } */
+/* { dg-final { scan-assembler {sete} } } */
+/* { dg-final { scan-assembler {(?:movdqu|movups)[ \t]+[^\n\r]*%xmm0,[^\n\r]*} } } */
 
 #include <immintrin.h>
 
diff --git a/gcc/testsuite/gcc.target/i386/keylocker-aesdec256kl.c b/gcc/testsuite/gcc.target/i386/keylocker-aesdec256kl.c
index 70b2c6357fa..6012b69e9bf 100644
--- a/gcc/testsuite/gcc.target/i386/keylocker-aesdec256kl.c
+++ b/gcc/testsuite/gcc.target/i386/keylocker-aesdec256kl.c
@@ -1,9 +1,9 @@
 /* { dg-do compile } */
 /* { dg-options "-mkl -O2" } */
-/* { dg-final { scan-assembler "movdqa\[ \\t\]+\[^\n\]*k2\[^\n\r]*%xmm0" } } */
-/* { dg-final { scan-assembler "aesdec256kl\[ \\t\]+\[^\n\]*h1\[^\n\r]*%xmm0" } } */
-/* { dg-final { scan-assembler "sete" } } */
-/* { dg-final { scan-assembler "(?:movdqu|movups)\[ \\t\]+\[^\n\]*%xmm0\[^\n\r]*k1" } } */
+/* { dg-final { scan-assembler {movdqa[ \t]+[^\n\r]*, %xmm0} } } */
+/* { dg-final { scan-assembler {aesdec256kl[ \t]+[^\n\r]*, %xmm0} } } */
+/* { dg-final { scan-assembler {sete} } } */
+/* { dg-final { scan-assembler {(?:movdqu|movups)[ \t]+[^\n\r]*%xmm0,[^\n\r]*} } } */
 
 #include <immintrin.h>
 
diff --git a/gcc/testsuite/gcc.target/i386/keylocker-aesdecwide128kl.c b/gcc/testsuite/gcc.target/i386/keylocker-aesdecwide128kl.c
index f2806891bff..61c294ee052 100644
--- a/gcc/testsuite/gcc.target/i386/keylocker-aesdecwide128kl.c
+++ b/gcc/testsuite/gcc.target/i386/keylocker-aesdecwide128kl.c
@@ -1,23 +1,23 @@
 /* { dg-do compile } */
 /* { dg-options "-mwidekl -O2" } */
-/* { dg-final { scan-assembler "movdqu\[ \\t\]+\[^\n\]*idata(\\(%rip\\))?\[^\n\r]*%xmm0" } } */
-/* { dg-final { scan-assembler "movdqu\[ \\t\]+\[^\n\]*idata\\+16(\\(%rip\\))?\[^\n\r]*%xmm1" } } */
-/* { dg-final { scan-assembler "movdqu\[ \\t\]+\[^\n\]*idata\\+32(\\(%rip\\))?\[^\n\r]*%xmm2" } } */
-/* { dg-final { scan-assembler "movdqu\[ \\t\]+\[^\n\]*idata\\+48(\\(%rip\\))?\[^\n\r]*%xmm3" } } */
-/* { dg-final { scan-assembler "movdqu\[ \\t\]+\[^\n\]*idata\\+64(\\(%rip\\))?\[^\n\r]*%xmm4" } } */
-/* { dg-final { scan-assembler "movdqu\[ \\t\]+\[^\n\]*idata\\+80(\\(%rip\\))?\[^\n\r]*%xmm5" } } */
-/* { dg-final { scan-assembler "movdqu\[ \\t\]+\[^\n\]*idata\\+96(\\(%rip\\))?\[^\n\r]*%xmm6" } } */
-/* { dg-final { scan-assembler "movdqu\[ \\t\]+\[^\n\]*idata\\+112(\\(%rip\\))?\[^\n\r]*%xmm7" } } */
-/* { dg-final { scan-assembler "aesdecwide128kl\[ \\t\]+\[^\n\]*h1" } } */
-/* { dg-final { scan-assembler "sete" } } */
-/* { dg-final { scan-assembler "(?:movdqu|movups)\[ \\t\]+\[^\n\]*%xmm0\[^\n\r]*odata(\\(%rip\\))?" } } */
-/* { dg-final { scan-assembler "(?:movdqu|movups)\[ \\t\]+\[^\n\]*%xmm1\[^\n\r]*odata\\+16(\\(%rip\\))?" } } */
-/* { dg-final { scan-assembler "(?:movdqu|movups)\[ \\t\]+\[^\n\]*%xmm2\[^\n\r]*odata\\+32(\\(%rip\\))?" } } */
-/* { dg-final { scan-assembler "(?:movdqu|movups)\[ \\t\]+\[^\n\]*%xmm3\[^\n\r]*odata\\+48(\\(%rip\\))?" } } */
-/* { dg-final { scan-assembler "(?:movdqu|movups)\[ \\t\]+\[^\n\]*%xmm4\[^\n\r]*odata\\+64(\\(%rip\\))?" } } */
-/* { dg-final { scan-assembler "(?:movdqu|movups)\[ \\t\]+\[^\n\]*%xmm5\[^\n\r]*odata\\+80(\\(%rip\\))?" } } */
-/* { dg-final { scan-assembler "(?:movdqu|movups)\[ \\t\]+\[^\n\]*%xmm6\[^\n\r]*odata\\+96(\\(%rip\\))?" } } */
-/* { dg-final { scan-assembler "(?:movdqu|movups)\[ \\t\]+\[^\n\]*%xmm7\[^\n\r]*odata\\+112(\\(%rip\\))?" } } */
+/* { dg-final { scan-assembler {movdqu[ \t]+[^\n\r]*, %xmm0} } } */
+/* { dg-final { scan-assembler {movdqu[ \t]+[^\n\r]*16[^\n\r]*, %xmm1} } } */
+/* { dg-final { scan-assembler {movdqu[ \t]+[^\n\r]*32[^\n\r]*, %xmm2} } } */
+/* { dg-final { scan-assembler {movdqu[ \t]+[^\n\r]*48[^\n\r]*, %xmm3} } } */
+/* { dg-final { scan-assembler {movdqu[ \t]+[^\n\r]*64[^\n\r]*, %xmm4} } } */
+/* { dg-final { scan-assembler {movdqu[ \t]+[^\n\r]*80[^\n\r]*, %xmm5} } } */
+/* { dg-final { scan-assembler {movdqu[ \t]+[^\n\r]*96[^\n\r]*, %xmm6} } } */
+/* { dg-final { scan-assembler {movdqu[ \t]+[^\n\r]*112[^\n\r]*, %xmm7} } } */
+/* { dg-final { scan-assembler {aesdecwide128kl[ \t]+[^\n\r]*} } } */
+/* { dg-final { scan-assembler {sete} } } */
+/* { dg-final { scan-assembler {(?:movdqu|movups)[ \t]+[^\n\r]*%xmm0,[^\n\r]*} } } */
+/* { dg-final { scan-assembler {(?:movdqu|movups)[ \t]+[^\n\r]*%xmm1,[^\n\r]*16[^\n\r]*} } } */
+/* { dg-final { scan-assembler {(?:movdqu|movups)[ \t]+[^\n\r]*%xmm2,[^\n\r]*32[^\n\r]*} } } */
+/* { dg-final { scan-assembler {(?:movdqu|movups)[ \t]+[^\n\r]*%xmm3,[^\n\r]*48[^\n\r]*} } } */
+/* { dg-final { scan-assembler {(?:movdqu|movups)[ \t]+[^\n\r]*%xmm4,[^\n\r]*64[^\n\r]*} } } */
+/* { dg-final { scan-assembler {(?:movdqu|movups)[ \t]+[^\n\r]*%xmm5,[^\n\r]*80[^\n\r]*} } } */
+/* { dg-final { scan-assembler {(?:movdqu|movups)[ \t]+[^\n\r]*%xmm6,[^\n\r]*96[^\n\r]*} } } */
+/* { dg-final { scan-assembler {(?:movdqu|movups)[ \t]+[^\n\r]*%xmm7,[^\n\r]*112[^\n\r]*} } } */
 
 #include <immintrin.h>
 
diff --git a/gcc/testsuite/gcc.target/i386/keylocker-aesdecwide256kl.c b/gcc/testsuite/gcc.target/i386/keylocker-aesdecwide256kl.c
index 9c60c84826f..4ad4deab18f 100644
--- a/gcc/testsuite/gcc.target/i386/keylocker-aesdecwide256kl.c
+++ b/gcc/testsuite/gcc.target/i386/keylocker-aesdecwide256kl.c
@@ -1,23 +1,23 @@
 /* { dg-do compile } */
 /* { dg-options "-mwidekl -O2" } */
-/* { dg-final { scan-assembler "movdqu\[ \\t\]+\[^\n\]*idata(\\(%rip\\))?\[^\n\r]*%xmm0" } } */
-/* { dg-final { scan-assembler "movdqu\[ \\t\]+\[^\n\]*idata\\+16(\\(%rip\\))?\[^\n\r]*%xmm1" } } */
-/* { dg-final { scan-assembler "movdqu\[ \\t\]+\[^\n\]*idata\\+32(\\(%rip\\))?\[^\n\r]*%xmm2" } } */
-/* { dg-final { scan-assembler "movdqu\[ \\t\]+\[^\n\]*idata\\+48(\\(%rip\\))?\[^\n\r]*%xmm3" } } */
-/* { dg-final { scan-assembler "movdqu\[ \\t\]+\[^\n\]*idata\\+64(\\(%rip\\))?\[^\n\r]*%xmm4" } } */
-/* { dg-final { scan-assembler "movdqu\[ \\t\]+\[^\n\]*idata\\+80(\\(%rip\\))?\[^\n\r]*%xmm5" } } */
-/* { dg-final { scan-assembler "movdqu\[ \\t\]+\[^\n\]*idata\\+96(\\(%rip\\))?\[^\n\r]*%xmm6" } } */
-/* { dg-final { scan-assembler "movdqu\[ \\t\]+\[^\n\]*idata\\+112(\\(%rip\\))?\[^\n\r]*%xmm7" } } */
-/* { dg-final { scan-assembler "aesdecwide256kl\[ \\t\]+\[^\n\]*h1" } } */
-/* { dg-final { scan-assembler "sete" } } */
-/* { dg-final { scan-assembler "(?:movdqu|movups)\[ \\t\]+\[^\n\]*%xmm0\[^\n\r]*odata(\\(%rip\\))?" } } */
-/* { dg-final { scan-assembler "(?:movdqu|movups)\[ \\t\]+\[^\n\]*%xmm1\[^\n\r]*odata\\+16(\\(%rip\\))?" } } */
-/* { dg-final { scan-assembler "(?:movdqu|movups)\[ \\t\]+\[^\n\]*%xmm2\[^\n\r]*odata\\+32(\\(%rip\\))?" } } */
-/* { dg-final { scan-assembler "(?:movdqu|movups)\[ \\t\]+\[^\n\]*%xmm3\[^\n\r]*odata\\+48(\\(%rip\\))?" } } */
-/* { dg-final { scan-assembler "(?:movdqu|movups)\[ \\t\]+\[^\n\]*%xmm4\[^\n\r]*odata\\+64(\\(%rip\\))?" } } */
-/* { dg-final { scan-assembler "(?:movdqu|movups)\[ \\t\]+\[^\n\]*%xmm5\[^\n\r]*odata\\+80(\\(%rip\\))?" } } */
-/* { dg-final { scan-assembler "(?:movdqu|movups)\[ \\t\]+\[^\n\]*%xmm6\[^\n\r]*odata\\+96(\\(%rip\\))?" } } */
-/* { dg-final { scan-assembler "(?:movdqu|movups)\[ \\t\]+\[^\n\]*%xmm7\[^\n\r]*odata\\+112(\\(%rip\\))?" } } */
+/* { dg-final { scan-assembler {movdqu[ \t]+[^\n\r]*, %xmm0} } } */
+/* { dg-final { scan-assembler {movdqu[ \t]+[^\n\r]*16[^\n\r]*, %xmm1} } } */
+/* { dg-final { scan-assembler {movdqu[ \t]+[^\n\r]*32[^\n\r]*, %xmm2} } } */
+/* { dg-final { scan-assembler {movdqu[ \t]+[^\n\r]*48[^\n\r]*, %xmm3} } } */
+/* { dg-final { scan-assembler {movdqu[ \t]+[^\n\r]*64[^\n\r]*, %xmm4} } } */
+/* { dg-final { scan-assembler {movdqu[ \t]+[^\n\r]*80[^\n\r]*, %xmm5} } } */
+/* { dg-final { scan-assembler {movdqu[ \t]+[^\n\r]*96[^\n\r]*, %xmm6} } } */
+/* { dg-final { scan-assembler {movdqu[ \t]+[^\n\r]*112[^\n\r]*, %xmm7} } } */
+/* { dg-final { scan-assembler {aesdecwide256kl[ \t]+[^\n\r]*} } } */
+/* { dg-final { scan-assembler {sete} } } */
+/* { dg-final { scan-assembler {(?:movdqu|movups)[ \t]+[^\n\r]*%xmm0,[^\n\r]*} } } */
+/* { dg-final { scan-assembler {(?:movdqu|movups)[ \t]+[^\n\r]*%xmm1,[^\n\r]*16[^\n\r]*} } } */
+/* { dg-final { scan-assembler {(?:movdqu|movups)[ \t]+[^\n\r]*%xmm2,[^\n\r]*32[^\n\r]*} } } */
+/* { dg-final { scan-assembler {(?:movdqu|movups)[ \t]+[^\n\r]*%xmm3,[^\n\r]*48[^\n\r]*} } } */
+/* { dg-final { scan-assembler {(?:movdqu|movups)[ \t]+[^\n\r]*%xmm4,[^\n\r]*64[^\n\r]*} } } */
+/* { dg-final { scan-assembler {(?:movdqu|movups)[ \t]+[^\n\r]*%xmm5,[^\n\r]*80[^\n\r]*} } } */
+/* { dg-final { scan-assembler {(?:movdqu|movups)[ \t]+[^\n\r]*%xmm6,[^\n\r]*96[^\n\r]*} } } */
+/* { dg-final { scan-assembler {(?:movdqu|movups)[ \t]+[^\n\r]*%xmm7,[^\n\r]*112[^\n\r]*} } } */
 
 #include <immintrin.h>
 
diff --git a/gcc/testsuite/gcc.target/i386/keylocker-aesenc128kl.c b/gcc/testsuite/gcc.target/i386/keylocker-aesenc128kl.c
index c7bf743015e..a81f94a29ff 100644
--- a/gcc/testsuite/gcc.target/i386/keylocker-aesenc128kl.c
+++ b/gcc/testsuite/gcc.target/i386/keylocker-aesenc128kl.c
@@ -1,9 +1,9 @@
 /* { dg-do compile } */
 /* { dg-options "-mkl -O2" } */
-/* { dg-final { scan-assembler "movdqa\[ \\t\]+\[^\n\]*k2\[^\n\r]*%xmm0" } } */
-/* { dg-final { scan-assembler "aesenc128kl\[ \\t\]+\[^\n\]*h1\[^\n\r]*%xmm0" } } */
-/* { dg-final { scan-assembler "sete" } } */
-/* { dg-final { scan-assembler "(?:movdqu|movups)\[ \\t\]+\[^\n\]*%xmm0\[^\n\r]*k1" } } */
+/* { dg-final { scan-assembler {movdqa[ \t]+[^\n\r]*, %xmm0} } } */
+/* { dg-final { scan-assembler {aesenc128kl[ \t]+[^\n\r]*, %xmm0} } } */
+/* { dg-final { scan-assembler {sete} } } */
+/* { dg-final { scan-assembler {(?:movdqu|movups)[ \t]+[^\n\r]*%xmm0,[^\n\r]*} } } */
 
 #include <immintrin.h>
 
diff --git a/gcc/testsuite/gcc.target/i386/keylocker-aesenc256kl.c b/gcc/testsuite/gcc.target/i386/keylocker-aesenc256kl.c
new file mode 100644
index 00000000000..05df5870f38
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/keylocker-aesenc256kl.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-mkl -O2" } */
+/* { dg-final { scan-assembler {movdqa[ \t]+[^\n\r]*, %xmm0} } } */
+/* { dg-final { scan-assembler {aesenc256kl[ \t]+[^\n\r]*, %xmm0} } } */
+/* { dg-final { scan-assembler {sete} } } */
+/* { dg-final { scan-assembler {(?:movdqu|movups)[ \t]+[^\n\r]*%xmm0,[^\n\r]*} } } */
+
+#include <immintrin.h>
+
+__m128i k1, k2;
+const char h1[48];
+
+unsigned char
+test_keylocker_4 (void)
+{
+  return _mm_aesenc256kl_u8 (&k1, k2, h1);
+}
diff --git a/gcc/testsuite/gcc.target/i386/keylocker-aesencwide128kl.c b/gcc/testsuite/gcc.target/i386/keylocker-aesencwide128kl.c
index d01598c5897..4afbeaeaf8d 100644
--- a/gcc/testsuite/gcc.target/i386/keylocker-aesencwide128kl.c
+++ b/gcc/testsuite/gcc.target/i386/keylocker-aesencwide128kl.c
@@ -1,23 +1,23 @@
 /* { dg-do compile } */
 /* { dg-options "-mwidekl -O2" } */
-/* { dg-final { scan-assembler "movdqu\[ \\t\]+\[^\n\]*idata(\\(%rip\\))?\[^\n\r]*%xmm0" } } */
-/* { dg-final { scan-assembler "movdqu\[ \\t\]+\[^\n\]*idata\\+16(\\(%rip\\))?\[^\n\r]*%xmm1" } } */
-/* { dg-final { scan-assembler "movdqu\[ \\t\]+\[^\n\]*idata\\+32(\\(%rip\\))?\[^\n\r]*%xmm2" } } */
-/* { dg-final { scan-assembler "movdqu\[ \\t\]+\[^\n\]*idata\\+48(\\(%rip\\))?\[^\n\r]*%xmm3" } } */
-/* { dg-final { scan-assembler "movdqu\[ \\t\]+\[^\n\]*idata\\+64(\\(%rip\\))?\[^\n\r]*%xmm4" } } */
-/* { dg-final { scan-assembler "movdqu\[ \\t\]+\[^\n\]*idata\\+80(\\(%rip\\))?\[^\n\r]*%xmm5" } } */
-/* { dg-final { scan-assembler "movdqu\[ \\t\]+\[^\n\]*idata\\+96(\\(%rip\\))?\[^\n\r]*%xmm6" } } */
-/* { dg-final { scan-assembler "movdqu\[ \\t\]+\[^\n\]*idata\\+112(\\(%rip\\))?\[^\n\r]*%xmm7" } } */
-/* { dg-final { scan-assembler "aesencwide128kl\[ \\t\]+\[^\n\]*h1(\\(%rip\\))?" } } */
-/* { dg-final { scan-assembler "sete" } } */
-/* { dg-final { scan-assembler "(?:movdqu|movups)\[ \\t\]+\[^\n\]*%xmm0\[^\n\r]*odata(\\(%rip\\))?" } } */
-/* { dg-final { scan-assembler "(?:movdqu|movups)\[ \\t\]+\[^\n\]*%xmm1\[^\n\r]*odata\\+16(\\(%rip\\))?" } } */
-/* { dg-final { scan-assembler "(?:movdqu|movups)\[ \\t\]+\[^\n\]*%xmm2\[^\n\r]*odata\\+32(\\(%rip\\))?" } } */
-/* { dg-final { scan-assembler "(?:movdqu|movups)\[ \\t\]+\[^\n\]*%xmm3\[^\n\r]*odata\\+48(\\(%rip\\))?" } } */
-/* { dg-final { scan-assembler "(?:movdqu|movups)\[ \\t\]+\[^\n\]*%xmm4\[^\n\r]*odata\\+64(\\(%rip\\))?" } } */
-/* { dg-final { scan-assembler "(?:movdqu|movups)\[ \\t\]+\[^\n\]*%xmm5\[^\n\r]*odata\\+80(\\(%rip\\))?" } } */
-/* { dg-final { scan-assembler "(?:movdqu|movups)\[ \\t\]+\[^\n\]*%xmm6\[^\n\r]*odata\\+96(\\(%rip\\))?" } } */
-/* { dg-final { scan-assembler "(?:movdqu|movups)\[ \\t\]+\[^\n\]*%xmm7\[^\n\r]*odata\\+112(\\(%rip\\))?" } } */
+/* { dg-final { scan-assembler {movdqu[ \t]+[^\n\r]*, %xmm0} } } */
+/* { dg-final { scan-assembler {movdqu[ \t]+[^\n\r]*16[^\n\r]*, %xmm1} } } */
+/* { dg-final { scan-assembler {movdqu[ \t]+[^\n\r]*32[^\n\r]*, %xmm2} } } */
+/* { dg-final { scan-assembler {movdqu[ \t]+[^\n\r]*48[^\n\r]*, %xmm3} } } */
+/* { dg-final { scan-assembler {movdqu[ \t]+[^\n\r]*64[^\n\r]*, %xmm4} } } */
+/* { dg-final { scan-assembler {movdqu[ \t]+[^\n\r]*80[^\n\r]*, %xmm5} } } */
+/* { dg-final { scan-assembler {movdqu[ \t]+[^\n\r]*96[^\n\r]*, %xmm6} } } */
+/* { dg-final { scan-assembler {movdqu[ \t]+[^\n\r]*112[^\n\r]*, %xmm7} } } */
+/* { dg-final { scan-assembler {aesencwide128kl[ \t]+[^\n\r]*} } } */
+/* { dg-final { scan-assembler {sete} } } */
+/* { dg-final { scan-assembler {(?:movdqu|movups)[ \t]+[^\n\r]*%xmm0,[^\n\r]*} } } */
+/* { dg-final { scan-assembler {(?:movdqu|movups)[ \t]+[^\n\r]*%xmm1,[^\n\r]*16[^\n\r]*} } } */
+/* { dg-final { scan-assembler {(?:movdqu|movups)[ \t]+[^\n\r]*%xmm2,[^\n\r]*32[^\n\r]*} } } */
+/* { dg-final { scan-assembler {(?:movdqu|movups)[ \t]+[^\n\r]*%xmm3,[^\n\r]*48[^\n\r]*} } } */
+/* { dg-final { scan-assembler {(?:movdqu|movups)[ \t]+[^\n\r]*%xmm4,[^\n\r]*64[^\n\r]*} } } */
+/* { dg-final { scan-assembler {(?:movdqu|movups)[ \t]+[^\n\r]*%xmm5,[^\n\r]*80[^\n\r]*} } } */
+/* { dg-final { scan-assembler {(?:movdqu|movups)[ \t]+[^\n\r]*%xmm6,[^\n\r]*96[^\n\r]*} } } */
+/* { dg-final { scan-assembler {(?:movdqu|movups)[ \t]+[^\n\r]*%xmm7,[^\n\r]*112[^\n\r]*} } } */
 
 #include <immintrin.h>
 
diff --git a/gcc/testsuite/gcc.target/i386/keylocker-aesencwide256kl.c b/gcc/testsuite/gcc.target/i386/keylocker-aesencwide256kl.c
index f94b05e2868..a139750768d 100644
--- a/gcc/testsuite/gcc.target/i386/keylocker-aesencwide256kl.c
+++ b/gcc/testsuite/gcc.target/i386/keylocker-aesencwide256kl.c
@@ -1,23 +1,23 @@
 /* { dg-do compile } */
 /* { dg-options "-mwidekl -O2" } */
-/* { dg-final { scan-assembler "movdqu\[ \\t\]+\[^\n\]*idata(\\(%rip\\))?\[^\n\r]*%xmm0" } } */
-/* { dg-final { scan-assembler "movdqu\[ \\t\]+\[^\n\]*idata\\+16(\\(%rip\\))?\[^\n\r]*%xmm1" } } */
-/* { dg-final { scan-assembler "movdqu\[ \\t\]+\[^\n\]*idata\\+32(\\(%rip\\))?\[^\n\r]*%xmm2" } } */
-/* { dg-final { scan-assembler "movdqu\[ \\t\]+\[^\n\]*idata\\+48(\\(%rip\\))?\[^\n\r]*%xmm3" } } */
-/* { dg-final { scan-assembler "movdqu\[ \\t\]+\[^\n\]*idata\\+64(\\(%rip\\))?\[^\n\r]*%xmm4" } } */
-/* { dg-final { scan-assembler "movdqu\[ \\t\]+\[^\n\]*idata\\+80(\\(%rip\\))?\[^\n\r]*%xmm5" } } */
-/* { dg-final { scan-assembler "movdqu\[ \\t\]+\[^\n\]*idata\\+96(\\(%rip\\))?\[^\n\r]*%xmm6" } } */
-/* { dg-final { scan-assembler "movdqu\[ \\t\]+\[^\n\]*idata\\+112(\\(%rip\\))?\[^\n\r]*%xmm7" } } */
-/* { dg-final { scan-assembler "aesencwide256kl\[ \\t\]+\[^\n\]*h1(\\(%rip\\))?" } } */
-/* { dg-final { scan-assembler "sete" } } */
-/* { dg-final { scan-assembler "(?:movdqu|movups)\[ \\t\]+\[^\n\]*%xmm0\[^\n\r]*odata(\\(%rip\\))?" } } */
-/* { dg-final { scan-assembler "(?:movdqu|movups)\[ \\t\]+\[^\n\]*%xmm1\[^\n\r]*odata\\+16(\\(%rip\\))?" } } */
-/* { dg-final { scan-assembler "(?:movdqu|movups)\[ \\t\]+\[^\n\]*%xmm2\[^\n\r]*odata\\+32(\\(%rip\\))?" } } */
-/* { dg-final { scan-assembler "(?:movdqu|movups)\[ \\t\]+\[^\n\]*%xmm3\[^\n\r]*odata\\+48(\\(%rip\\))?" } } */
-/* { dg-final { scan-assembler "(?:movdqu|movups)\[ \\t\]+\[^\n\]*%xmm4\[^\n\r]*odata\\+64(\\(%rip\\))?" } } */
-/* { dg-final { scan-assembler "(?:movdqu|movups)\[ \\t\]+\[^\n\]*%xmm5\[^\n\r]*odata\\+80(\\(%rip\\))?" } } */
-/* { dg-final { scan-assembler "(?:movdqu|movups)\[ \\t\]+\[^\n\]*%xmm6\[^\n\r]*odata\\+96(\\(%rip\\))?" } } */
-/* { dg-final { scan-assembler "(?:movdqu|movups)\[ \\t\]+\[^\n\]*%xmm7\[^\n\r]*odata\\+112(\\(%rip\\))?" } } */
+/* { dg-final { scan-assembler {movdqu[ \t]+[^\n\r]*, %xmm0} } } */
+/* { dg-final { scan-assembler {movdqu[ \t]+[^\n\r]*16[^\n\r]*, %xmm1} } } */
+/* { dg-final { scan-assembler {movdqu[ \t]+[^\n\r]*32[^\n\r]*, %xmm2} } } */
+/* { dg-final { scan-assembler {movdqu[ \t]+[^\n\r]*48[^\n\r]*, %xmm3} } } */
+/* { dg-final { scan-assembler {movdqu[ \t]+[^\n\r]*64[^\n\r]*, %xmm4} } } */
+/* { dg-final { scan-assembler {movdqu[ \t]+[^\n\r]*80[^\n\r]*, %xmm5} } } */
+/* { dg-final { scan-assembler {movdqu[ \t]+[^\n\r]*96[^\n\r]*, %xmm6} } } */
+/* { dg-final { scan-assembler {movdqu[ \t]+[^\n\r]*112[^\n\r]*, %xmm7} } } */
+/* { dg-final { scan-assembler {aesencwide256kl[ \t]+[^\n\r]*} } } */
+/* { dg-final { scan-assembler {sete} } } */
+/* { dg-final { scan-assembler {(?:movdqu|movups)[ \t]+[^\n\r]*%xmm0,[^\n\r]*} } } */
+/* { dg-final { scan-assembler {(?:movdqu|movups)[ \t]+[^\n\r]*%xmm1,[^\n\r]*16[^\n\r]*} } } */
+/* { dg-final { scan-assembler {(?:movdqu|movups)[ \t]+[^\n\r]*%xmm2,[^\n\r]*32[^\n\r]*} } } */
+/* { dg-final { scan-assembler {(?:movdqu|movups)[ \t]+[^\n\r]*%xmm3,[^\n\r]*48[^\n\r]*} } } */
+/* { dg-final { scan-assembler {(?:movdqu|movups)[ \t]+[^\n\r]*%xmm4,[^\n\r]*64[^\n\r]*} } } */
+/* { dg-final { scan-assembler {(?:movdqu|movups)[ \t]+[^\n\r]*%xmm5,[^\n\r]*80[^\n\r]*} } } */
+/* { dg-final { scan-assembler {(?:movdqu|movups)[ \t]+[^\n\r]*%xmm6,[^\n\r]*96[^\n\r]*} } } */
+/* { dg-final { scan-assembler {(?:movdqu|movups)[ \t]+[^\n\r]*%xmm7,[^\n\r]*112[^\n\r]*} } } */
 
 #include <immintrin.h>
 
diff --git a/gcc/testsuite/gcc.target/i386/keylocker-encodekey128.c b/gcc/testsuite/gcc.target/i386/keylocker-encodekey128.c
index 8dd1bc634ac..c2bc7ea344d 100644
--- a/gcc/testsuite/gcc.target/i386/keylocker-encodekey128.c
+++ b/gcc/testsuite/gcc.target/i386/keylocker-encodekey128.c
@@ -1,12 +1,12 @@
 /* { dg-do compile } */
 /* { dg-options "-mkl -O2" } */
-/* { dg-final { scan-assembler "movdqa\[ \\t\]+\[^\n\]*k1(\\(%rip\\))?\[^\n\r]*%xmm0" } } */
-/* { dg-final { scan-assembler "movl\[ \\t\]+\[^\n\]*ctrl(\\(%rip\\))?\[^\n\r]*%eax" } } */
-/* { dg-final { scan-assembler "encodekey128\[ \\t\]+\[^\n\]*%eax\[^\n\r]*%eax" } } */
-/* { dg-final { scan-assembler "(?:movdqu|movups)\[ \\t\]+\[^\n\]*%xmm0\[^\n\r]*h2(\\(%rip\\))?" } } */
-/* { dg-final { scan-assembler "(?:movdqu|movups)\[ \\t\]+\[^\n\]*%xmm1\[^\n\r]*h2\\+16(\\(%rip\\))?" } } */
-/* { dg-final { scan-assembler "(?:movdqu|movups)\[ \\t\]+\[^\n\]*%xmm2\[^\n\r]*h2\\+32(\\(%rip\\))?" } } */
-/* { dg-final { scan-assembler "(?:movdqa|movaps)\[ \\t\]+\[^\n\]*%xmm\[4-6\]\[^\n\r]*k2(\\(%rip\\))?" } } */
+/* { dg-final { scan-assembler {movdqa[ \t]+[^\n\r]*, %xmm0} } } */
+/* { dg-final { scan-assembler {movl[ \t]+[^\n\r]*, %eax} } } */
+/* { dg-final { scan-assembler {encodekey128[ \t]+[^\n]*%eax[^\n\r]*%eax} } } */
+/* { dg-final { scan-assembler {(?:movdqu|movups)[ \t]+[^\n]*%xmm0,[^\n\r]*} } } */
+/* { dg-final { scan-assembler {(?:movdqu|movups)[ \t]+[^\n]*%xmm1,[^\n\r]*16[^\n\r]*} } } */
+/* { dg-final { scan-assembler {(?:movdqu|movups)[ \t]+[^\n]*%xmm2,[^\n\r]*32[^\n\r]*} } } */
+/* { dg-final { scan-assembler {(?:movdqa|movaps)[ \t]+[^\n]*%xmm[4-6\],[^\n\r]*} } } */
 
 #include <immintrin.h>
 
diff --git a/gcc/testsuite/gcc.target/i386/keylocker-encodekey256.c b/gcc/testsuite/gcc.target/i386/keylocker-encodekey256.c
index a9e19c6457b..d7d2bc48e18 100644
--- a/gcc/testsuite/gcc.target/i386/keylocker-encodekey256.c
+++ b/gcc/testsuite/gcc.target/i386/keylocker-encodekey256.c
@@ -1,14 +1,14 @@
 /* { dg-do compile } */
 /* { dg-options "-mkl -O2" } */
-/* { dg-final { scan-assembler "movdqa\[ \\t\]+\[^\n\]*k1(\\(%rip\\))?\[^\n\r]*%xmm0" } } */
-/* { dg-final { scan-assembler "movdqa\[ \\t\]+\[^\n\]*k2(\\(%rip\\))?\[^\n\r]*%xmm1" } } */
-/* { dg-final { scan-assembler "movl\[ \\t\]+\[^\n\]*ctrl(\\(%rip\\))?\[^\n\r]*%eax" } } */
-/* { dg-final { scan-assembler "encodekey256\[ \\t\]+\[^\n\]*%eax\[^\n\r]*%eax" } } */
-/* { dg-final { scan-assembler "(?:movdqu|movups)\[ \\t\]+\[^\n\]*%xmm0\[^\n\r]*h2(\\(%rip\\))?" } } */
-/* { dg-final { scan-assembler "(?:movdqu|movups)\[ \\t\]+\[^\n\]*%xmm1\[^\n\r]*h2\\+16(\\(%rip\\))?" } } */
-/* { dg-final { scan-assembler "(?:movdqu|movups)\[ \\t\]+\[^\n\]*%xmm2\[^\n\r]*h2\\+32(\\(%rip\\))?" } } */
-/* { dg-final { scan-assembler "(?:movdqu|movups)\[ \\t\]+\[^\n\]*%xmm3\[^\n\r]*h2\\+48(\\(%rip\\))?" } } */
-/* { dg-final { scan-assembler "(?:movdqa|movaps)\[ \\t\]+\[^\n\]*%xmm\[4-6\]\[^\n\r]*k3(\\(%rip\\))?" } } */
+/* { dg-final { scan-assembler {movdqa[ \t]+[^\n\r]*, %xmm0} } } */
+/* { dg-final { scan-assembler {movdqa[ \t]+[^\n\r]*, %xmm1} } } */
+/* { dg-final { scan-assembler {movl[ \t]+[^\n\r]*, %eax} } } */
+/* { dg-final { scan-assembler {encodekey256[ \t]+[^\n]*%eax[^\n\r]*%eax} } } */
+/* { dg-final { scan-assembler {(?:movdqu|movups)[ \t]+[^\n]*%xmm0,[^\n\r]*} } } */
+/* { dg-final { scan-assembler {(?:movdqu|movups)[ \t]+[^\n]*%xmm1,[^\n\r]*16[^\n\r]*} } } */
+/* { dg-final { scan-assembler {(?:movdqu|movups)[ \t]+[^\n]*%xmm2,[^\n\r]*32[^\n\r]*} } } */
+/* { dg-final { scan-assembler {(?:movdqu|movups)[ \t]+[^\n]*%xmm3,[^\n\r]*48[^\n\r]*} } } */
+/* { dg-final { scan-assembler {(?:movdqa|movaps)[ \t]+[^\n]*%xmm[4-6],[^\n\r]*} } } */
 
 #include <immintrin.h>
 
-- 
2.20.1


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

* Re: Symbol + Constant output.
  2020-11-06  7:23           ` Hongyu Wang
@ 2020-11-06 10:46             ` Iain Sandoe
  0 siblings, 0 replies; 8+ messages in thread
From: Iain Sandoe @ 2020-11-06 10:46 UTC (permalink / raw)
  To: Hongyu Wang; +Cc: GCC Development

Hi,

Hongyu Wang via Gcc <gcc@gcc.gnu.org> wrote:

> I've adjust the testcase and now it only contains constant offset, since
>
> with -fPIC the mov target address does not contain any symbol in the  
> assembler.
>
> Could you help to check the attached changes on darwin and see if they
> all get passed?

LGTM.
OK from a Darwin PoV,

thanks
Iain

make check-gcc-c RUNTESTFLAGS=i386.exp=keylocker*

		=== gcc Summary for unix/-m64 ===

# of expected passes		120


		=== gcc Summary for unix/-m32 ===

# of expected passes		120

		=== gcc Summary ===

# of expected passes		240



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

end of thread, other threads:[~2020-11-06 10:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-01 13:04 Symbol + Constant output Iain Sandoe
2020-11-02 10:21 ` Uros Bizjak
2020-11-04  8:08   ` Hongyu Wang
2020-11-04  8:26     ` Iain Sandoe
2020-11-04  9:01       ` Hongyu Wang
2020-11-04  9:19         ` Iain Sandoe
2020-11-06  7:23           ` Hongyu Wang
2020-11-06 10:46             ` Iain Sandoe

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