Hi,

>> Access to VRSAVE have a high cost in performance.
>> Since ABI was update we don't need to save what
>> vector register we are using. Removing VRSAVE access
>> can improve a bit more our performance.
> 
> ... I'd suggest to implement this in ppc-xlate. I.e. recognize
> 'mtspr 256,rA' and conditionally replace it with some kind of nop, e.g.
> or rA,rA,rA. 'mfspr rD,256' can be replaced with li rD,-1. This way one
> can affect all modules at once without having to examine each one of
> them. I can make suggestion a little bit later...

Question is if the condition for $no_vrsave assignment is proper. Or
rather if it should be /aix|linux64/. As I couldn't see that big-endian
Linux I have access to uses ELF ABI V2, I've settled for /aix|linux64le/.




diff --git a/crypto/perlasm/ppc-xlate.pl b/crypto/perlasm/ppc-xlate.pl
index f89e814..0f46cf0 100755
--- a/crypto/perlasm/ppc-xlate.pl
+++ b/crypto/perlasm/ppc-xlate.pl
@@ -151,6 +151,26 @@ my $vmr = sub {
     "	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) = @_;
_______________________________________________
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev

Reply via email to