The operand shouldn't be stored as is, but stored as 64-scale, in
the opcode, but armasm64 misses to do this.
This might be a big enough bug to report and try to get fixed, but
that requires removing this workaround at that point.
---
gas-preprocessor.pl | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/gas-preprocessor.pl b/gas-preprocessor.pl
index d9eaf1d..182b684 100755
--- a/gas-preprocessor.pl
+++ b/gas-preprocessor.pl
@@ -1032,6 +1032,16 @@ sub handle_serialized_line {
$line =~ s/$instr$suffix/${instr}u$suffix/;
}
}
+
+ # Instructions like fcvtzs and scvtf store the scale value
+ # inverted in the opcode (stored as 64 - scale), but armasm64
+ # 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;
+ my $inverted_scale = 64 - $3;
+ $line =~ s/#$scale/#$inverted_scale/;
+ }
}
# armasm is unable to parse &0x - add spacing
$line =~ s/&0x/& 0x/g;
--
2.7.4
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel