On 2017-10-16 22:38:19 +0300, Martin Storsjö wrote:
> 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.

Please report this as bug. I'd propose a environment variable or version 
check for this fixup.

> ---
>  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;

The fixup itself is ok

Janne
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to