[GASPP,2/3] Don't skip prfum instructions by default for armasm64

Message ID 1520326712-19031-2-git-send-email-martin@martin.st
State Committed
Headers show
Series
  • [GASPP,1/3] Document what versions were buggy and required GASPP_ARMASM64_INVERT_SCALE
Related show

Commit Message

Martin Storsjö March 6, 2018, 8:58 a.m.
The version of armasm64 in Visual Studio 2017 15.5 can assemble
these just fine.
---
 gas-preprocessor.pl | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Comments

Janne Grunau March 14, 2018, 10:04 p.m. | #1
On 2018-03-06 10:58:31 +0200, Martin Storsjö wrote:
> The version of armasm64 in Visual Studio 2017 15.5 can assemble
> these just fine.
> ---
>  gas-preprocessor.pl | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/gas-preprocessor.pl b/gas-preprocessor.pl
> index 9ff47a9..cb2f912 100755
> --- a/gas-preprocessor.pl
> +++ b/gas-preprocessor.pl
> @@ -1020,10 +1020,12 @@ sub handle_serialized_line {
>              # Convert "cset w0, lo" into "csetlo w0"
>              $line =~ s/(cset)\s+([xw]\w+)\s*,\s*($arm_cond_codes)/\1\3 \2/;
>  
> -            # Strip out prfum; armasm64 fails to assemble any
> -            # variant/combination of prfum tested so far, but it can be
> -            # left out without any
> -            $line =~ s/prfum.*\]//;
> +            if ($ENV{GASPP_ARMASM64_SKIP_PRFUM}) {
> +                # Strip out prfum; armasm64 (VS < 15.5) fails to assemble any
> +                # variant/combination of prfum tested so far, but it can be
> +                # left out without any

Maybe replace the last incomplete sentence after the comma with "Since 
it is a prefetch instruction it can be skipped without changing 
results."

> +                $line =~ s/prfum.*\]//;
> +            }
>  
>              # Convert "ldrb w0, [x0, #-1]" into "ldurb w0, [x0, #-1]".
>              # Don't do this for forms with writeback though.

otherwise ok

Janne

Patch

diff --git a/gas-preprocessor.pl b/gas-preprocessor.pl
index 9ff47a9..cb2f912 100755
--- a/gas-preprocessor.pl
+++ b/gas-preprocessor.pl
@@ -1020,10 +1020,12 @@  sub handle_serialized_line {
             # Convert "cset w0, lo" into "csetlo w0"
             $line =~ s/(cset)\s+([xw]\w+)\s*,\s*($arm_cond_codes)/\1\3 \2/;
 
-            # Strip out prfum; armasm64 fails to assemble any
-            # variant/combination of prfum tested so far, but it can be
-            # left out without any
-            $line =~ s/prfum.*\]//;
+            if ($ENV{GASPP_ARMASM64_SKIP_PRFUM}) {
+                # Strip out prfum; armasm64 (VS < 15.5) fails to assemble any
+                # variant/combination of prfum tested so far, but it can be
+                # left out without any
+                $line =~ s/prfum.*\]//;
+            }
 
             # Convert "ldrb w0, [x0, #-1]" into "ldurb w0, [x0, #-1]".
             # Don't do this for forms with writeback though.