summaryrefslogtreecommitdiffstats
path: root/crypto/bn/asm/ppc-mont.pl
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2009-12-26 21:30:13 +0000
committerAndy Polyakov <appro@openssl.org>2009-12-26 21:30:13 +0000
commitb4b48a107cc5f0a6c50b26ec5f088484affde81b (patch)
tree91a233778a2741cc8802aaa84313a2d7ec25cfa0 /crypto/bn/asm/ppc-mont.pl
parent7e765bf29a1ab015af0db6095b30adaab44b6635 (diff)
ppc64-mont.pl: adapt for 32-bit and engage for all builds.
Diffstat (limited to 'crypto/bn/asm/ppc-mont.pl')
-rw-r--r--crypto/bn/asm/ppc-mont.pl11
1 files changed, 8 insertions, 3 deletions
diff --git a/crypto/bn/asm/ppc-mont.pl b/crypto/bn/asm/ppc-mont.pl
index 7849eae959..9257b2cd71 100644
--- a/crypto/bn/asm/ppc-mont.pl
+++ b/crypto/bn/asm/ppc-mont.pl
@@ -108,14 +108,19 @@ $code=<<___;
.machine "any"
.text
-.globl .bn_mul_mont
+.globl .bn_mul_mont_int
.align 4
-.bn_mul_mont:
+.bn_mul_mont_int:
cmpwi $num,4
mr $rp,r3 ; $rp is reassigned
li r3,0
bltlr
-
+___
+$code.=<<___ if ($BNSZ==4);
+ cmpwi $num,32 ; longer key performance is not better
+ bgelr
+___
+$code.=<<___;
slwi $num,$num,`log($BNSZ)/log(2)`
li $tj,-4096
addi $ovf,$num,`$FRAME+$RZONE`