Skip to content

Commit

Permalink
perlasm/ppc-xlate.pl: comply with ABIs that specify vrsave as reserved.
Browse files Browse the repository at this point in the history
RT#4162

Reviewed-by: Richard Levitte <levitte@openssl.org>
  • Loading branch information
Andy Polyakov committed Dec 3, 2015
1 parent 1bbea40 commit b5516cf
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions crypto/perlasm/ppc-xlate.pl
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,26 @@
" vor $vx,$vy,$vy";
};

# Some ABIs specify vrsave, special-purpose register #256, as reserved
# for system use.
my $no_vrsave = ($flavour =~ /aix|linux64le/);
my $mtspr = sub {
my ($f,$idx,$ra) = @_;
if ($idx == 256 && $no_vrsave) {
" or $ra,$ra,$ra";
} else {
" mtspr $idx,$ra";
}
};
my $mfspr = sub {
my ($f,$rd,$idx) = @_;
if ($idx == 256 && $no_vrsave) {
" li $rd,-1";
} else {
" mfspr $rd,$idx";
}
};

# PowerISA 2.06 stuff
sub vsxmem_op {
my ($f, $vrt, $ra, $rb, $op) = @_;
Expand Down

0 comments on commit b5516cf

Please sign in to comment.