public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [testsuite] Add @ lines to check-function-bodies fluff
@ 2020-03-10 17:22 Matthew Malcomson
  2020-03-10 17:40 ` Fwd: " Matthew Malcomson
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Matthew Malcomson @ 2020-03-10 17:22 UTC (permalink / raw)
  To: gcc-patches; +Cc: nd, richard.sandiford, ro, mikestump

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

When using `check-function-bodies`, the subroutine `parse_function_bodies` uses
the `fluff` regexp to remove uninteresting assembly lines.

Arm targets generate assembly with some lines prefixed by `@`, these lines are
left by this process.

As an example of some lines prefixed by `@': the assembly output from the
`stacktest1` function in "bfloat16_simd_3_1.c" is:

        .align  2
        .global stacktest1
        .arch armv8.2-a
        .syntax unified
        .arm
        .fpu neon-fp-armv8
        .type   stacktest1, %function
stacktest1:
        @ args = 0, pretend = 0, frame = 8
        @ frame_needed = 0, uses_anonymous_args = 0
        @ link register save eliminated.
        sub     sp, sp, #8
        add     r3, sp, #6
        vst1.16 {d0[0]}, [r3]
        vld1.16 {d0[0]}, [r3]
        add     sp, sp, #8
        @ sp needed
        bx      lr
        .size   stacktest1, .-stacktest1



It seems that previous uses of `check-function-bodies` in the arm backend have
avoided problems with such lines since they use the `...` regexp in each place
such fluff occurs.

I'm currently writing a patch that I'd like to match the entire function body,
so I'd like to remove such `@` lines automatically.

gcc/testsuite/ChangeLog:

2020-03-10  Matthew Malcomson  <matthew.malcomson@arm.com>

	* lib/scanasm.exp (parse_function_bodies): Lines starting with '@' also
	counted as fluff.



###############     Attachment also inlined for ease of reply    ###############


diff --git a/gcc/testsuite/lib/scanasm.exp b/gcc/testsuite/lib/scanasm.exp
index 5ca58d4042027683da12bc2a1d161195cd6439e7..f7d27735112f8edd8a39a326020c3d08dd36e765 100644
--- a/gcc/testsuite/lib/scanasm.exp
+++ b/gcc/testsuite/lib/scanasm.exp
@@ -569,7 +569,7 @@ proc parse_function_bodies { filename result } {
     set terminator {^\s*\.size}
 
     # Regexp for lines that aren't interesting.
-    set fluff {^\s*(?:\.|//)}
+    set fluff {^\s*(?:\.|//|@)}
 
     set fd [open $filename r]
     set in_function 0


[-- Attachment #2: at_sign_fluff.patch --]
[-- Type: text/plain, Size: 517 bytes --]

diff --git a/gcc/testsuite/lib/scanasm.exp b/gcc/testsuite/lib/scanasm.exp
index 5ca58d4042027683da12bc2a1d161195cd6439e7..f7d27735112f8edd8a39a326020c3d08dd36e765 100644
--- a/gcc/testsuite/lib/scanasm.exp
+++ b/gcc/testsuite/lib/scanasm.exp
@@ -569,7 +569,7 @@ proc parse_function_bodies { filename result } {
     set terminator {^\s*\.size}
 
     # Regexp for lines that aren't interesting.
-    set fluff {^\s*(?:\.|//)}
+    set fluff {^\s*(?:\.|//|@)}
 
     set fd [open $filename r]
     set in_function 0


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

* Fwd: [testsuite] Add @ lines to check-function-bodies fluff
  2020-03-10 17:22 [testsuite] Add @ lines to check-function-bodies fluff Matthew Malcomson
@ 2020-03-10 17:40 ` Matthew Malcomson
  2020-03-11 12:18 ` Richard Sandiford
  2020-03-12  3:11 ` Jeff Law
  2 siblings, 0 replies; 4+ messages in thread
From: Matthew Malcomson @ 2020-03-10 17:40 UTC (permalink / raw)
  To: gcc-patches

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

Cc'ing maintainers and original author of `check-function-bodies`.

It looks like I missed that the first time around.


-------- Forwarded Message --------
Subject: [testsuite] Add @ lines to check-function-bodies fluff
Date: Tue, 10 Mar 2020 17:22:52 +0000
From: Matthew Malcomson <matthew.malcomson@arm.com>
To: gcc-patches@gcc.gnu.org
CC: nd@arm.com

When using `check-function-bodies`, the subroutine 
`parse_function_bodies` uses
the `fluff` regexp to remove uninteresting assembly lines.

Arm targets generate assembly with some lines prefixed by `@`, these 
lines are
left by this process.

As an example of some lines prefixed by `@': the assembly output from the
`stacktest1` function in "bfloat16_simd_3_1.c" is:

         .align  2
         .global stacktest1
         .arch armv8.2-a
         .syntax unified
         .arm
         .fpu neon-fp-armv8
         .type   stacktest1, %function
stacktest1:
         @ args = 0, pretend = 0, frame = 8
         @ frame_needed = 0, uses_anonymous_args = 0
         @ link register save eliminated.
         sub     sp, sp, #8
         add     r3, sp, #6
         vst1.16 {d0[0]}, [r3]
         vld1.16 {d0[0]}, [r3]
         add     sp, sp, #8
         @ sp needed
         bx      lr
         .size   stacktest1, .-stacktest1



It seems that previous uses of `check-function-bodies` in the arm 
backend have
avoided problems with such lines since they use the `...` regexp in each 
place
such fluff occurs.

I'm currently writing a patch that I'd like to match the entire function 
body,
so I'd like to remove such `@` lines automatically.

gcc/testsuite/ChangeLog:

2020-03-10  Matthew Malcomson  <matthew.malcomson@arm.com>

	* lib/scanasm.exp (parse_function_bodies): Lines starting with '@' also
	counted as fluff.



###############     Attachment also inlined for ease of reply 
###############


diff --git a/gcc/testsuite/lib/scanasm.exp b/gcc/testsuite/lib/scanasm.exp
index 
5ca58d4042027683da12bc2a1d161195cd6439e7..f7d27735112f8edd8a39a326020c3d08dd36e765 
100644
--- a/gcc/testsuite/lib/scanasm.exp
+++ b/gcc/testsuite/lib/scanasm.exp
@@ -569,7 +569,7 @@ proc parse_function_bodies { filename result } {
      set terminator {^\s*\.size}
       # Regexp for lines that aren't interesting.
-    set fluff {^\s*(?:\.|//)}
+    set fluff {^\s*(?:\.|//|@)}
       set fd [open $filename r]
      set in_function 0



[-- Attachment #2: at_sign_fluff.patch --]
[-- Type: text/plain, Size: 517 bytes --]

diff --git a/gcc/testsuite/lib/scanasm.exp b/gcc/testsuite/lib/scanasm.exp
index 5ca58d4042027683da12bc2a1d161195cd6439e7..f7d27735112f8edd8a39a326020c3d08dd36e765 100644
--- a/gcc/testsuite/lib/scanasm.exp
+++ b/gcc/testsuite/lib/scanasm.exp
@@ -569,7 +569,7 @@ proc parse_function_bodies { filename result } {
     set terminator {^\s*\.size}
 
     # Regexp for lines that aren't interesting.
-    set fluff {^\s*(?:\.|//)}
+    set fluff {^\s*(?:\.|//|@)}
 
     set fd [open $filename r]
     set in_function 0


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

* Re: [testsuite] Add @ lines to check-function-bodies fluff
  2020-03-10 17:22 [testsuite] Add @ lines to check-function-bodies fluff Matthew Malcomson
  2020-03-10 17:40 ` Fwd: " Matthew Malcomson
@ 2020-03-11 12:18 ` Richard Sandiford
  2020-03-12  3:11 ` Jeff Law
  2 siblings, 0 replies; 4+ messages in thread
From: Richard Sandiford @ 2020-03-11 12:18 UTC (permalink / raw)
  To: Matthew Malcomson; +Cc: gcc-patches, nd, ro, mikestump

Matthew Malcomson <matthew.malcomson@arm.com> writes:
> When using `check-function-bodies`, the subroutine `parse_function_bodies` uses
> the `fluff` regexp to remove uninteresting assembly lines.
>
> Arm targets generate assembly with some lines prefixed by `@`, these lines are
> left by this process.
>
> As an example of some lines prefixed by `@': the assembly output from the
> `stacktest1` function in "bfloat16_simd_3_1.c" is:
>
>         .align  2
>         .global stacktest1
>         .arch armv8.2-a
>         .syntax unified
>         .arm
>         .fpu neon-fp-armv8
>         .type   stacktest1, %function
> stacktest1:
>         @ args = 0, pretend = 0, frame = 8
>         @ frame_needed = 0, uses_anonymous_args = 0
>         @ link register save eliminated.
>         sub     sp, sp, #8
>         add     r3, sp, #6
>         vst1.16 {d0[0]}, [r3]
>         vld1.16 {d0[0]}, [r3]
>         add     sp, sp, #8
>         @ sp needed
>         bx      lr
>         .size   stacktest1, .-stacktest1
>
>
>
> It seems that previous uses of `check-function-bodies` in the arm backend have
> avoided problems with such lines since they use the `...` regexp in each place
> such fluff occurs.
>
> I'm currently writing a patch that I'd like to match the entire function body,
> so I'd like to remove such `@` lines automatically.
>
> gcc/testsuite/ChangeLog:
>
> 2020-03-10  Matthew Malcomson  <matthew.malcomson@arm.com>
>
> 	* lib/scanasm.exp (parse_function_bodies): Lines starting with '@' also
> 	counted as fluff.

OK, thanks.

Richard

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

* Re: [testsuite] Add @ lines to check-function-bodies fluff
  2020-03-10 17:22 [testsuite] Add @ lines to check-function-bodies fluff Matthew Malcomson
  2020-03-10 17:40 ` Fwd: " Matthew Malcomson
  2020-03-11 12:18 ` Richard Sandiford
@ 2020-03-12  3:11 ` Jeff Law
  2 siblings, 0 replies; 4+ messages in thread
From: Jeff Law @ 2020-03-12  3:11 UTC (permalink / raw)
  To: Matthew Malcomson, gcc-patches; +Cc: nd

On Tue, 2020-03-10 at 17:22 +0000, Matthew Malcomson wrote:
> When using `check-function-bodies`, the subroutine `parse_function_bodies` uses
> the `fluff` regexp to remove uninteresting assembly lines.
> 
> Arm targets generate assembly with some lines prefixed by `@`, these lines are
> left by this process.
> 
> As an example of some lines prefixed by `@': the assembly output from the
> `stacktest1` function in "bfloat16_simd_3_1.c" is:
> 
>         .align  2
>         .global stacktest1
>         .arch armv8.2-a
>         .syntax unified
>         .arm
>         .fpu neon-fp-armv8
>         .type   stacktest1, %function
> stacktest1:
>         @ args = 0, pretend = 0, frame = 8
>         @ frame_needed = 0, uses_anonymous_args = 0
>         @ link register save eliminated.
>         sub     sp, sp, #8
>         add     r3, sp, #6
>         vst1.16 {d0[0]}, [r3]
>         vld1.16 {d0[0]}, [r3]
>         add     sp, sp, #8
>         @ sp needed
>         bx      lr
>         .size   stacktest1, .-stacktest1
> 
> 
> 
> It seems that previous uses of `check-function-bodies` in the arm backend have
> avoided problems with such lines since they use the `...` regexp in each place
> such fluff occurs.
> 
> I'm currently writing a patch that I'd like to match the entire function body,
> so I'd like to remove such `@` lines automatically.
> 
> gcc/testsuite/ChangeLog:
> 
> 2020-03-10  Matthew Malcomson  <matthew.malcomson@arm.com>
> 
> 	* lib/scanasm.exp (parse_function_bodies): Lines starting with '@' also
> 	counted as fluff.
I could see wanting to look at those lines in an ARM specific test.  For example
if there was a test that required a frame, but it was eliminated for some reason
or vice-versa.  Looking at the @ lines might make writing that kind of test
easier.

But I don't mind ACKing this now.  We could come back to the issue in the future.

WRT matching a whole function, I'd be leery of such tests in general, but there
may be times when they're appropriate.  I'll defer to the ARM maintainers on
whether or not they want such tests.

Jeff
> 


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

end of thread, other threads:[~2020-03-12  3:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-10 17:22 [testsuite] Add @ lines to check-function-bodies fluff Matthew Malcomson
2020-03-10 17:40 ` Fwd: " Matthew Malcomson
2020-03-11 12:18 ` Richard Sandiford
2020-03-12  3:11 ` Jeff Law

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