From patchwork Tue Mar 6 08:58:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [GASPP,1/3] Document what versions were buggy and required GASPP_ARMASM64_INVERT_SCALE X-Patchwork-Submitter: =?utf-8?q?Martin_Storsj=C3=B6?= X-Patchwork-Id: 64215 Message-Id: <1520326712-19031-1-git-send-email-martin@martin.st> To: libav-devel@libav.org Date: Tue, 6 Mar 2018 10:58:30 +0200 From: Martin Storsjo List-Id: libav development --- gas-preprocessor.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gas-preprocessor.pl b/gas-preprocessor.pl index 3787756..9ff47a9 100755 --- a/gas-preprocessor.pl +++ b/gas-preprocessor.pl @@ -1041,7 +1041,7 @@ sub handle_serialized_line { if ($ENV{GASPP_ARMASM64_INVERT_SCALE}) { # Instructions like fcvtzs and scvtf store the scale value # inverted in the opcode (stored as 64 - scale), but armasm64 - # in early versions stores it as-is. Thus convert from + # in VS < 15.5 stores it as-is. Thus convert from # "fcvtzs w0, s0, #8" into "fcvtzs w0, s0, #56". if ($line =~ /(?:fcvtzs|scvtf)\s+(\w+)\s*,\s*(\w+)\s*,\s*#(\d+)/) { my $scale = $3; From patchwork Tue Mar 6 08:58:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [GASPP,2/3] Don't skip prfum instructions by default for armasm64 X-Patchwork-Submitter: =?utf-8?q?Martin_Storsj=C3=B6?= X-Patchwork-Id: 64217 Message-Id: <1520326712-19031-2-git-send-email-martin@martin.st> To: libav-devel@libav.org Date: Tue, 6 Mar 2018 10:58:31 +0200 From: Martin Storsjo List-Id: libav development 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 + $line =~ s/prfum.*\]//; + } # Convert "ldrb w0, [x0, #-1]" into "ldurb w0, [x0, #-1]". # Don't do this for forms with writeback though. From patchwork Tue Mar 6 08:58:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [GASPP,3/3] Don't skip negative offsets for ldr by default for armasm64 X-Patchwork-Submitter: =?utf-8?q?Martin_Storsj=C3=B6?= X-Patchwork-Id: 64216 Message-Id: <1520326712-19031-3-git-send-email-martin@martin.st> To: libav-devel@libav.org Date: Tue, 6 Mar 2018 10:58:32 +0200 From: Martin Storsjo List-Id: libav development The version of armasm64 in Visual Studio 2017 15.6 can assemble these just fine. --- gas-preprocessor.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gas-preprocessor.pl b/gas-preprocessor.pl index cb2f912..b0c909c 100755 --- a/gas-preprocessor.pl +++ b/gas-preprocessor.pl @@ -973,8 +973,8 @@ sub handle_serialized_line { my $reg = $1; my $sym = $2; my $offset = eval_expr($3); - if ($offset < 0) { - # armasm64 is buggy with ldr x0, =sym+offset where the + if ($offset < 0 and $ENV{GASPP_ARMASM64_SKIP_NEG_OFFSET}) { + # armasm64 in VS < 15.6 is buggy with ldr x0, =sym+offset where the # offset is a negative value; it does write a negative # offset into the literal pool as it should, but the # negative offset only covers the lower 32 bit of the 64