x86: Make testcase apx-spill_to_egprs-1.c more robust

Message ID 20231114090044.1452311-1-lehua.ding@rivai.ai
State Unresolved
Headers
Series x86: Make testcase apx-spill_to_egprs-1.c more robust |

Checks

Context Check Description
snail/gcc-patch-check warning Git am fail log

Commit Message

Lehua Ding Nov. 14, 2023, 9 a.m. UTC
  Hi,

This little patch adjust the assert in apx-spill_to_egprs-1.c testcase.
The -mapxf compilation option allows more registers to be used, which in
turn eliminates the need for local variables to be stored in stack memory.
Therefore, the assertion is changed to detects no memory loaded through the
%rsp register.

gcc/testsuite/ChangeLog:

	* gcc.target/i386/apx-spill_to_egprs-1.c: Make sure that no local
	variables are stored on the stack.

---
 .../gcc.target/i386/apx-spill_to_egprs-1.c    | 19 +++----------------
 1 file changed, 3 insertions(+), 16 deletions(-)
  

Comments

Hongtao Liu Nov. 14, 2023, 10:24 a.m. UTC | #1
On Tue, Nov 14, 2023 at 5:01 PM Lehua Ding <lehua.ding@rivai.ai> wrote:
>
> Hi,
>
> This little patch adjust the assert in apx-spill_to_egprs-1.c testcase.
> The -mapxf compilation option allows more registers to be used, which in
> turn eliminates the need for local variables to be stored in stack memory.
> Therefore, the assertion is changed to detects no memory loaded through the
> %rsp register.
Ok, thanks.
>
> gcc/testsuite/ChangeLog:
>
>         * gcc.target/i386/apx-spill_to_egprs-1.c: Make sure that no local
>         variables are stored on the stack.
>
> ---
>  .../gcc.target/i386/apx-spill_to_egprs-1.c    | 19 +++----------------
>  1 file changed, 3 insertions(+), 16 deletions(-)
>
> diff --git a/gcc/testsuite/gcc.target/i386/apx-spill_to_egprs-1.c b/gcc/testsuite/gcc.target/i386/apx-spill_to_egprs-1.c
> index 290863d63a7..d7952b4c550 100644
> --- a/gcc/testsuite/gcc.target/i386/apx-spill_to_egprs-1.c
> +++ b/gcc/testsuite/gcc.target/i386/apx-spill_to_egprs-1.c
> @@ -3,22 +3,9 @@
>
>  #include "spill_to_mask-1.c"
>
> -/* { dg-final { scan-assembler "movl\[ \t]+\[^\\n\\r\]*, %r16d" } } */
> -/* { dg-final { scan-assembler "movl\[ \t]+\[^\\n\\r\]*, %r17d" } } */
> -/* { dg-final { scan-assembler "movl\[ \t]+\[^\\n\\r\]*, %r18d" } } */
> -/* { dg-final { scan-assembler "movq\[ \t]+\[^\\n\\r\]*, %r19" } } */
> -/* { dg-final { scan-assembler "movl\[ \t]+\[^\\n\\r\]*, %r20d" } } */
> -/* { dg-final { scan-assembler "movl\[ \t]+\[^\\n\\r\]*, %r21d" } } */
> -/* { dg-final { scan-assembler "movl\[ \t]+\[^\\n\\r\]*, %r22d" } } */
> -/* { dg-final { scan-assembler "movl\[ \t]+\[^\\n\\r\]*, %r23d" } } */
> -/* { dg-final { scan-assembler "movl\[ \t]+\[^\\n\\r\]*, %r24d" } } */
> -/* { dg-final { scan-assembler "addl\[ \t]+\[^\\n\\r\]*, %r25d" } } */
> -/* { dg-final { scan-assembler "movl\[ \t]+\[^\\n\\r\]*, %r26d" } } */
> -/* { dg-final { scan-assembler "movl\[ \t]+\[^\\n\\r\]*, %r27d" } } */
> -/* { dg-final { scan-assembler "movbel\[ \t]+\[^\\n\\r\]*, %r28d" } } */
> -/* { dg-final { scan-assembler "movbel\[ \t]+\[^\\n\\r\]*, %r29d" } } */
> -/* { dg-final { scan-assembler "movbel\[ \t]+\[^\\n\\r\]*, %r30d" } } */
> -/* { dg-final { scan-assembler "movbel\[ \t]+\[^\\n\\r\]*, %r31d" } } */
> +/* Make sure that no local variables are stored on the stack. */
> +/* { dg-final { scan-assembler-not "\\(%rsp\\)" } } */
> +
>  /* { dg-final { scan-assembler-not "knot" } } */
>  /* { dg-final { scan-assembler-not "kxor" } } */
>  /* { dg-final { scan-assembler-not "kor" } } */
> --
> 2.36.3
>
  
Lehua Ding Nov. 14, 2023, 10:56 a.m. UTC | #2
Committed, thanks Hongtao.

On 2023/11/14 18:24, Hongtao Liu wrote:
> On Tue, Nov 14, 2023 at 5:01 PM Lehua Ding <lehua.ding@rivai.ai> wrote:
>>
>> Hi,
>>
>> This little patch adjust the assert in apx-spill_to_egprs-1.c testcase.
>> The -mapxf compilation option allows more registers to be used, which in
>> turn eliminates the need for local variables to be stored in stack memory..
>> Therefore, the assertion is changed to detects no memory loaded through the
>> %rsp register.
> Ok, thanks.
>>
>> gcc/testsuite/ChangeLog:
>>
>>          * gcc.target/i386/apx-spill_to_egprs-1.c: Make sure that no local
>>          variables are stored on the stack.
>>
>> ---
>>   .../gcc.target/i386/apx-spill_to_egprs-1.c    | 19 +++----------------
>>   1 file changed, 3 insertions(+), 16 deletions(-)
>>
>> diff --git a/gcc/testsuite/gcc.target/i386/apx-spill_to_egprs-1.c b/gcc/testsuite/gcc.target/i386/apx-spill_to_egprs-1.c
>> index 290863d63a7..d7952b4c550 100644
>> --- a/gcc/testsuite/gcc.target/i386/apx-spill_to_egprs-1.c
>> +++ b/gcc/testsuite/gcc.target/i386/apx-spill_to_egprs-1.c
>> @@ -3,22 +3,9 @@
>>
>>   #include "spill_to_mask-1.c"
>>
>> -/* { dg-final { scan-assembler "movl\[ \t]+\[^\\n\\r\]*, %r16d" } } */
>> -/* { dg-final { scan-assembler "movl\[ \t]+\[^\\n\\r\]*, %r17d" } } */
>> -/* { dg-final { scan-assembler "movl\[ \t]+\[^\\n\\r\]*, %r18d" } } */
>> -/* { dg-final { scan-assembler "movq\[ \t]+\[^\\n\\r\]*, %r19" } } */
>> -/* { dg-final { scan-assembler "movl\[ \t]+\[^\\n\\r\]*, %r20d" } } */
>> -/* { dg-final { scan-assembler "movl\[ \t]+\[^\\n\\r\]*, %r21d" } } */
>> -/* { dg-final { scan-assembler "movl\[ \t]+\[^\\n\\r\]*, %r22d" } } */
>> -/* { dg-final { scan-assembler "movl\[ \t]+\[^\\n\\r\]*, %r23d" } } */
>> -/* { dg-final { scan-assembler "movl\[ \t]+\[^\\n\\r\]*, %r24d" } } */
>> -/* { dg-final { scan-assembler "addl\[ \t]+\[^\\n\\r\]*, %r25d" } } */
>> -/* { dg-final { scan-assembler "movl\[ \t]+\[^\\n\\r\]*, %r26d" } } */
>> -/* { dg-final { scan-assembler "movl\[ \t]+\[^\\n\\r\]*, %r27d" } } */
>> -/* { dg-final { scan-assembler "movbel\[ \t]+\[^\\n\\r\]*, %r28d" } } */
>> -/* { dg-final { scan-assembler "movbel\[ \t]+\[^\\n\\r\]*, %r29d" } } */
>> -/* { dg-final { scan-assembler "movbel\[ \t]+\[^\\n\\r\]*, %r30d" } } */
>> -/* { dg-final { scan-assembler "movbel\[ \t]+\[^\\n\\r\]*, %r31d" } } */
>> +/* Make sure that no local variables are stored on the stack. */
>> +/* { dg-final { scan-assembler-not "\\(%rsp\\)" } } */
>> +
>>   /* { dg-final { scan-assembler-not "knot" } } */
>>   /* { dg-final { scan-assembler-not "kxor" } } */
>>   /* { dg-final { scan-assembler-not "kor" } } */
>> --
>> 2.36.3
>>
> 
>
  

Patch

diff --git a/gcc/testsuite/gcc.target/i386/apx-spill_to_egprs-1.c b/gcc/testsuite/gcc.target/i386/apx-spill_to_egprs-1.c
index 290863d63a7..d7952b4c550 100644
--- a/gcc/testsuite/gcc.target/i386/apx-spill_to_egprs-1.c
+++ b/gcc/testsuite/gcc.target/i386/apx-spill_to_egprs-1.c
@@ -3,22 +3,9 @@ 
 
 #include "spill_to_mask-1.c"
 
-/* { dg-final { scan-assembler "movl\[ \t]+\[^\\n\\r\]*, %r16d" } } */
-/* { dg-final { scan-assembler "movl\[ \t]+\[^\\n\\r\]*, %r17d" } } */
-/* { dg-final { scan-assembler "movl\[ \t]+\[^\\n\\r\]*, %r18d" } } */
-/* { dg-final { scan-assembler "movq\[ \t]+\[^\\n\\r\]*, %r19" } } */
-/* { dg-final { scan-assembler "movl\[ \t]+\[^\\n\\r\]*, %r20d" } } */
-/* { dg-final { scan-assembler "movl\[ \t]+\[^\\n\\r\]*, %r21d" } } */
-/* { dg-final { scan-assembler "movl\[ \t]+\[^\\n\\r\]*, %r22d" } } */
-/* { dg-final { scan-assembler "movl\[ \t]+\[^\\n\\r\]*, %r23d" } } */
-/* { dg-final { scan-assembler "movl\[ \t]+\[^\\n\\r\]*, %r24d" } } */
-/* { dg-final { scan-assembler "addl\[ \t]+\[^\\n\\r\]*, %r25d" } } */
-/* { dg-final { scan-assembler "movl\[ \t]+\[^\\n\\r\]*, %r26d" } } */
-/* { dg-final { scan-assembler "movl\[ \t]+\[^\\n\\r\]*, %r27d" } } */
-/* { dg-final { scan-assembler "movbel\[ \t]+\[^\\n\\r\]*, %r28d" } } */
-/* { dg-final { scan-assembler "movbel\[ \t]+\[^\\n\\r\]*, %r29d" } } */
-/* { dg-final { scan-assembler "movbel\[ \t]+\[^\\n\\r\]*, %r30d" } } */
-/* { dg-final { scan-assembler "movbel\[ \t]+\[^\\n\\r\]*, %r31d" } } */
+/* Make sure that no local variables are stored on the stack. */
+/* { dg-final { scan-assembler-not "\\(%rsp\\)" } } */
+
 /* { dg-final { scan-assembler-not "knot" } } */
 /* { dg-final { scan-assembler-not "kxor" } } */
 /* { dg-final { scan-assembler-not "kor" } } */