Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for latest FFmpeg version when compiling for aarch64 using armasm64 #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 27 additions & 2 deletions gas-preprocessor.pl
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ sub handle_serialized_line {
($arch eq "aarch64" and !is_aarch64_register($target))) {
$call_targets{$target}++;
}
} elsif ($line =~ /(?:^|\n)\s*(\w+\s*:\s*)?(cbn?z|adr|tbz)\s+(\w+)\s*,(\s*#\d+\s*,)?\s*(\w+)/) {
} elsif ($line =~ /(?:^|\n)\s*(\w+\s*:\s*)?(cbn?z|adr|tbn?z)\s+(\w+)\s*,(\s*#\d+\s*,)?\s*(\w+)/) {
my $instr = $2;
my $reg = $3;
my $bit = $4;
Expand All @@ -922,6 +922,13 @@ sub handle_serialized_line {
$xreg =~ s/w/x/;
$line =~ s/\b$reg\b/$xreg/;
}

# Same with tbnz
if ($instr eq "tbnz" and $reg =~ /w\d+/) {
my $xreg = $reg;
$xreg =~ s/w/x/;
$line =~ s/\b$reg\b/$xreg/;
}
} elsif ($line =~ /^\s*.h?word.*\b\d+[bf]\b/) {
while ($line =~ /\b(\d+)([bf])\b/g) {
$line = handle_local_label($line, $1, $2);
Expand Down Expand Up @@ -1063,7 +1070,25 @@ sub handle_serialized_line {
}

# Convert "ld1 {v0.4h-v3.4h}" into "ld1 {v0.4h,v1.4h,v2.4h,v3.4h}"
if ($line =~ /(?:ld|st)\d\s+({\s*v(\d+)\.(\d[bhsdBHSD])\s*-\s*v(\d+)\.(\d[bhsdBHSD])\s*})/) {
if ($line =~ /(?:ld|st)\d\s+({\s*v(\d+)\.(\d+[bhsdBHSD])\s*-\s*v(\d+)\.(\d+[bhsdBHSD])\s*})/) {
my $regspec = $1;
my $reg1 = $2;
my $layout1 = $3;
my $reg2 = $4;
my $layout2 = $5;
if ($layout1 eq $layout2) {
my $new_regspec = "{";
foreach my $i ($reg1 .. $reg2) {
$new_regspec .= "," if ($i > $reg1);
$new_regspec .= "v$i.$layout1";
}
$new_regspec .= "}";
$line =~ s/$regspec/$new_regspec/;
}
}

# Convert "tbx vXX, {v0.4h-v3.4h}" into "tbx vXX, {v0.4h,v1.4h,v2.4h,v3.4h}"
if ($line =~ /tbx\s+v\d+\.\d+[bhsdBHSD]\s*,\s*({\s*v(\d+)\.(\d+[bhsdBHSD])\s*-\s*v(\d+)\.(\d+[bhsdBHSD])\s*})/) {
my $regspec = $1;
my $reg1 = $2;
my $layout1 = $3;
Expand Down