summaryrefslogtreecommitdiffstats
path: root/crypto/bn
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/bn
parentf63e4be392dfc4d5073653a5688d7240b9eaffb9 (diff)
Unify ppc assembler make rules.
Diffstat (limited to 'crypto/bn')
-rw-r--r--crypto/bn/Makefile15
-rw-r--r--crypto/bn/asm/ppc-mont.pl17
-rw-r--r--crypto/bn/asm/ppc.pl11
3 files changed, 17 insertions, 26 deletions
diff --git a/crypto/bn/Makefile b/crypto/bn/Makefile
index f90923b378..d3799ba2a6 100644
--- a/crypto/bn/Makefile
+++ b/crypto/bn/Makefile
@@ -103,19 +103,8 @@ pa-risc2.o: asm/pa-risc2.s
/usr/ccs/bin/as -o pa-risc2.o asm/pa-risc2.s
# ppc - AIX, Linux, MacOS X...
-linux_ppc32.s: asm/ppc.pl; $(PERL) $< $@
-linux_ppc64.s: asm/ppc.pl; $(PERL) $< $@
-aix_ppc32.s: asm/ppc.pl; $(PERL) asm/ppc.pl $@
-aix_ppc64.s: asm/ppc.pl; $(PERL) asm/ppc.pl $@
-osx_ppc32.s: asm/ppc.pl; $(PERL) $< $@
-osx_ppc64.s: asm/ppc.pl; $(PERL) $< $@
-
-linux_ppc32-mont.s: asm/ppc-mont.pl; $(PERL) $< $@
-linux_ppc64-mont.s: asm/ppc-mont.pl; $(PERL) $< $@
-aix_ppc32-mont.s: asm/ppc-mont.pl; $(PERL) asm/ppc-mont.pl $@
-aix_ppc64-mont.s: asm/ppc-mont.pl; $(PERL) asm/ppc-mont.pl $@
-osx_ppc32-mont.s: asm/ppc-mont.pl; $(PERL) $< $@
-osx_ppc64-mont.s: asm/ppc-mont.pl; $(PERL) $< $@
+bn-ppc.s: asm/ppc.pl; $(PERL) asm/ppc.pl $(PERLASM_SCHEME) $@
+ppc-mont.s: asm/ppc-mont.pl;$(PERL) asm/ppc-mont.pl $(PERLASM_SCHEME) $@
alpha-mont.s: asm/alpha-mont.pl
$(PERL) $< | $(CC) -E - | tee $@ > /dev/null
diff --git a/crypto/bn/asm/ppc-mont.pl b/crypto/bn/asm/ppc-mont.pl
index 6028edca22..7849eae959 100644
--- a/crypto/bn/asm/ppc-mont.pl
+++ b/crypto/bn/asm/ppc-mont.pl
@@ -24,9 +24,9 @@
# 2048-bit +18%
# 4096-bit +4%
-$output = shift;
+$flavour = shift;
-if ($output =~ /32\-mont\.s/) {
+if ($flavour =~ /32/) {
$BITS= 32;
$BNSZ= $BITS/8;
$SIZE_T=4;
@@ -46,7 +46,7 @@ if ($output =~ /32\-mont\.s/) {
$SHRI= "srwi"; # unsigned shift right by immediate
$PUSH= $ST;
$POP= $LD;
-} elsif ($output =~ /64\-mont\.s/) {
+} elsif ($flavour =~ /64/) {
$BITS= 64;
$BNSZ= $BITS/8;
$SIZE_T=8;
@@ -67,10 +67,14 @@ if ($output =~ /32\-mont\.s/) {
$SHRI= "srdi"; # unsigned shift right by immediate
$PUSH= $ST;
$POP= $LD;
-} 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 ".shift || die "can't call $xlate: $!";
$sp="r1";
$toc="r2";
@@ -270,7 +274,6 @@ Linner:
addi $num,$num,2 ; restore $num
subfc $j,$j,$j ; j=0 and "clear" XER[CA]
addi $tp,$sp,$FRAME
- addi $ap,$sp,$FRAME
mtctr $num
.align 4
diff --git a/crypto/bn/asm/ppc.pl b/crypto/bn/asm/ppc.pl
index 0c0206b0d7..8da16f92d0 100644
--- a/crypto/bn/asm/ppc.pl
+++ b/crypto/bn/asm/ppc.pl
@@ -100,9 +100,9 @@
# me a note at schari@us.ibm.com
#
-$opf = shift;
+$flavour = shift;
-if ($opf =~ /32\.s/) {
+if ($flavour =~ /32/) {
$BITS= 32;
$BNSZ= $BITS/8;
$ISA= "\"ppc\"";
@@ -125,7 +125,7 @@ if ($opf =~ /32\.s/) {
$INSR= "insrwi"; # insert right
$ROTL= "rotlwi"; # rotate left by immediate
$TR= "tw"; # conditional trap
-} elsif ($opf =~ /64\.s/) {
+} elsif ($flavour =~ /64/) {
$BITS= 64;
$BNSZ= $BITS/8;
$ISA= "\"ppc64\"";
@@ -149,15 +149,14 @@ if ($opf =~ /32\.s/) {
$INSR= "insrdi"; # insert right
$ROTL= "rotldi"; # rotate left by immediate
$TR= "td"; # conditional trap
-} else { die "nonsense $opf"; }
+} 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 $opf" ) ||
- die "can't call $xlate: $!";
+open STDOUT,"| $^X $xlate $flavour ".shift || die "can't call $xlate: $!";
$data=<<EOF;
#--------------------------------------------------------------------