summaryrefslogtreecommitdiffstats
path: root/crypto/sha
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2008-01-13 22:01:30 +0000
committerAndy Polyakov <appro@openssl.org>2008-01-13 22:01:30 +0000
commitaddd641f3a5e99ed90e3369914af5b356b725590 (patch)
tree1a6e7498fecce05807ee71d0641823e8422dbb02 /crypto/sha
parentf63e4be392dfc4d5073653a5688d7240b9eaffb9 (diff)
Unify ppc assembler make rules.
Diffstat (limited to 'crypto/sha')
-rw-r--r--crypto/sha/Makefile16
-rwxr-xr-xcrypto/sha/asm/sha1-ppc.pl11
-rwxr-xr-xcrypto/sha/asm/sha512-ppc.pl17
3 files changed, 20 insertions, 24 deletions
diff --git a/crypto/sha/Makefile b/crypto/sha/Makefile
index fc69e5e664..809fde6002 100644
--- a/crypto/sha/Makefile
+++ b/crypto/sha/Makefile
@@ -67,18 +67,10 @@ sha1-sparcv9.s: asm/sha1-sparcv9.pl; $(PERL) asm/sha1-sparcv9.pl $@ $(CFLAGS)
sha256-sparcv9.s:asm/sha512-sparcv9.pl; $(PERL) asm/sha512-sparcv9.pl $@ $(CFLAGS)
sha512-sparcv9.s:asm/sha512-sparcv9.pl; $(PERL) asm/sha512-sparcv9.pl $@ $(CFLAGS)
-# AIX make has to be explicitly told
-sha1-ppc_aix32.s: asm/sha1-ppc.pl; $(PERL) asm/sha1-ppc.pl $@
-sha1-ppc_aix64.s: asm/sha1-ppc.pl; $(PERL) asm/sha1-ppc.pl $@
-sha256-ppc_aix32.s: asm/sha512-ppc.pl; $(PERL) asm/sha512-ppc.pl $@
-sha256-ppc_aix64.s: asm/sha512-ppc.pl; $(PERL) asm/sha512-ppc.pl $@
-sha512-ppc_aix32.s: asm/sha512-ppc.pl; $(PERL) asm/sha512-ppc.pl $@
-sha512-ppc_aix64.s: asm/sha512-ppc.pl; $(PERL) asm/sha512-ppc.pl $@
-
-# non-AIX ppc targets are believed to be armed with GNU make
-sha1-ppc_%.s: asm/sha1-ppc.pl; $(PERL) $< $@
-sha256-ppc_%.s: asm/sha512-ppc.pl; $(PERL) $< $@
-sha512-ppc_%.s: asm/sha512-ppc.pl; $(PERL) $< $@
+sha1-ppc.s: asm/sha1-ppc.pl; $(PERL) asm/sha1-ppc.pl $(PERLASM_SCHEME) $@
+sha256-ppc.s: asm/sha512-ppc.pl; $(PERL) asm/sha512-ppc.pl $(PERLASM_SCHEME) $@
+sha512-ppc.s: asm/sha512-ppc.pl; $(PERL) asm/sha512-ppc.pl $(PERLASM_SCHEME) $@
+
# GNU make "catch all"
sha1-%.s: asm/sha1-%.pl; $(PERL) $< $@
sha256-%.s: asm/sha512-%.pl; $(PERL) $< $@
diff --git a/crypto/sha/asm/sha1-ppc.pl b/crypto/sha/asm/sha1-ppc.pl
index 2c84d59149..d2c0c2c464 100755
--- a/crypto/sha/asm/sha1-ppc.pl
+++ b/crypto/sha/asm/sha1-ppc.pl
@@ -20,29 +20,28 @@
# PPC970,gcc-4.0.0 +76% +59%
# Power6,xlc-7 +68% +33%
-$output = shift;
+$flavour = shift;
-if ($output =~ /64\.s/) {
+if ($flavour =~ /64/) {
$SIZE_T =8;
$UCMP ="cmpld";
$STU ="stdu";
$POP ="ld";
$PUSH ="std";
-} elsif ($output =~ /32\.s/) {
+} elsif ($flavour =~ /32/) {
$SIZE_T =4;
$UCMP ="cmplw";
$STU ="stwu";
$POP ="lwz";
$PUSH ="stw";
-} else { die "nonsense $output"; }
+} else { die "nonsense $flavour"; }
$0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
( $xlate="${dir}ppc-xlate.pl" and -f $xlate ) or
( $xlate="${dir}../../perlasm/ppc-xlate.pl" and -f $xlate) or
die "can't locate ppc-xlate.pl";
-( defined shift || open STDOUT,"| $^X $xlate $output" ) ||
- die "can't call $xlate: $!";
+open STDOUT,"| $^X $xlate $flavour ".shift || die "can't call $xlate: $!";
$FRAME=24*$SIZE_T;
diff --git a/crypto/sha/asm/sha512-ppc.pl b/crypto/sha/asm/sha512-ppc.pl
index 0ec4b0bcc3..7da9cf96ce 100755
--- a/crypto/sha/asm/sha512-ppc.pl
+++ b/crypto/sha/asm/sha512-ppc.pl
@@ -35,26 +35,31 @@
# block signals prior calling this routine. For the record, in 32-bit
# context R2 serves as TLS pointer, while in 64-bit context - R13.
-$output=shift;
+$flavour=shift;
+$output =shift;
-if ($output =~ /64/) {
+if ($flavour =~ /64/) {
$SIZE_T=8;
$STU="stdu";
$UCMP="cmpld";
$SHL="sldi";
$POP="ld";
$PUSH="std";
-} elsif ($output =~ /32/) {
+} elsif ($flavour =~ /32/) {
$SIZE_T=4;
$STU="stwu";
$UCMP="cmplw";
$SHL="slwi";
$POP="lwz";
$PUSH="stw";
-} else { die "nonsense $output"; }
+} else { die "nonsense $flavour"; }
-( defined shift || open STDOUT,"| $^X ../perlasm/ppc-xlate.pl $output" ) ||
- die "can't call ../perlasm/ppc-xlate.pl: $!";
+$0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
+( $xlate="${dir}ppc-xlate.pl" and -f $xlate ) or
+( $xlate="${dir}../../perlasm/ppc-xlate.pl" and -f $xlate) or
+die "can't locate ppc-xlate.pl";
+
+open STDOUT,"| $^X $xlate $flavour $output" || die "can't call $xlate: $!";
if ($output =~ /512/) {
$func="sha512_block_data_order";