- replace the revert for the s390x bignum asm routines with

fix from upstream
This commit is contained in:
Tomas Mraz 2010-11-23 09:51:17 +01:00
parent 23675ff78b
commit 6e7d6d4dfd
2 changed files with 15 additions and 174 deletions

View File

@ -1,177 +1,14 @@
diff -up openssl-1.0.0b/crypto/bn/asm/s390x.S.s390bn openssl-1.0.0b/crypto/bn/asm/s390x.S
--- openssl-1.0.0b/crypto/bn/asm/s390x.S.s390bn 2010-09-10 16:55:24.000000000 +0200
+++ openssl-1.0.0b/crypto/bn/asm/s390x.S 2007-06-20 16:10:16.000000000 +0200
@@ -1,4 +1,4 @@
-.ident "s390x.S, version 1.1"
+.ident "s390x.S, version 1.0"
// ====================================================================
// Written by Andy Polyakov <appro@fy.chalmers.se> for the OpenSSL
// project.
@@ -24,67 +24,67 @@ bn_mul_add_words:
bler %r14 // if (len<=0) return 0;
Index: openssl/crypto/bn/asm/s390x.S
RCS File: /v/openssl/cvs/openssl/crypto/bn/asm/s390x.S,v
rcsdiff -q -kk '-r1.1.4.1' '-r1.1.4.2' -u '/v/openssl/cvs/openssl/crypto/bn/asm/s390x.S,v' 2>/dev/null
--- openssl/crypto/bn/asm/s390x.S 2010/09/10 14:55:24 1.1.4.1
+++ openssl/crypto/bn/asm/s390x.S 2010/11/22 21:57:07 1.1.4.2
@@ -131,7 +131,7 @@
brct %r4,.Loop4_mul
stmg %r6,%r10,48(%r15)
- lghi %r10,3
lghi %r8,0 // carry = 0
- nr %r10,%r4 // len%4
- sra %r4,2 // cnt=len/4
- jz .Loop1_madd // carry is incidentally cleared if branch taken
- algr zero,zero // clear carry
+ srag %r10,%r4,2 // cnt=len/4
+ jz .Loop1_madd
.Loop4_madd:
lg %r7,0(%r2,%r3) // ap[i]
mlgr %r6,%r5 // *=w
- alcgr %r7,%r8 // +=carry
+ algr %r7,%r8 // +=carry
alcgr %r6,zero
alg %r7,0(%r2,%r1) // +=rp[i]
+ alcgr %r6,zero
stg %r7,0(%r2,%r1) // rp[i]=
lg %r9,8(%r2,%r3)
mlgr %r8,%r5
- alcgr %r9,%r6
+ algr %r9,%r6
alcgr %r8,zero
alg %r9,8(%r2,%r1)
+ alcgr %r8,zero
stg %r9,8(%r2,%r1)
lg %r7,16(%r2,%r3)
mlgr %r6,%r5
- alcgr %r7,%r8
+ algr %r7,%r8
alcgr %r6,zero
alg %r7,16(%r2,%r1)
+ alcgr %r6,zero
stg %r7,16(%r2,%r1)
lg %r9,24(%r2,%r3)
mlgr %r8,%r5
- alcgr %r9,%r6
+ algr %r9,%r6
alcgr %r8,zero
alg %r9,24(%r2,%r1)
+ alcgr %r8,zero
stg %r9,24(%r2,%r1)
la %r2,32(%r2) // i+=4
- brct %r4,.Loop4_madd
-
- la %r10,1(%r10) // see if len%4 is zero ...
la %r10,1(%r10) // see if len%4 is zero ...
- brct %r10,.Loop1_madd // without touching condition code:-)
+ brct %r10,.Loop4_madd
+ brct %r10,.Loop1_mul // without touching condition code:-)
-.Lend_madd:
- alcgr %r8,zero // collect carry bit
- lgr %r2,%r8
- lmg %r6,%r10,48(%r15)
- br %r14
+ lghi %r10,3
+ nr %r4,%r10 // cnt=len%4
+ jz .Lend_madd
.Loop1_madd:
lg %r7,0(%r2,%r3) // ap[i]
mlgr %r6,%r5 // *=w
- alcgr %r7,%r8 // +=carry
+ algr %r7,%r8 // +=carry
alcgr %r6,zero
alg %r7,0(%r2,%r1) // +=rp[i]
+ alcgr %r6,zero
stg %r7,0(%r2,%r1) // rp[i]=
lgr %r8,%r6
la %r2,8(%r2) // i++
- brct %r10,.Loop1_madd
+ brct %r4,.Loop1_madd
- j .Lend_madd
+.Lend_madd:
+ lgr %r2,%r8
+ lmg %r6,%r10,48(%r15)
+ br %r14
.size bn_mul_add_words,.-bn_mul_add_words
// BN_ULONG bn_mul_words(BN_ULONG *r2,BN_ULONG *r3,int r4,BN_ULONG r5);
@@ -99,57 +99,57 @@ bn_mul_words:
bler %r14 // if (len<=0) return 0;
stmg %r6,%r10,48(%r15)
- lghi %r10,3
lghi %r8,0 // carry = 0
- nr %r10,%r4 // len%4
- sra %r4,2 // cnt=len/4
- jz .Loop1_mul // carry is incidentally cleared if branch taken
- algr zero,zero // clear carry
+ srag %r10,%r4,2 // cnt=len/4
+ jz .Loop1_mul
.Loop4_mul:
lg %r7,0(%r2,%r3) // ap[i]
mlgr %r6,%r5 // *=w
- alcgr %r7,%r8 // +=carry
+ algr %r7,%r8 // +=carry
+ alcgr %r6,zero
stg %r7,0(%r2,%r1) // rp[i]=
lg %r9,8(%r2,%r3)
mlgr %r8,%r5
- alcgr %r9,%r6
+ algr %r9,%r6
+ alcgr %r8,zero
stg %r9,8(%r2,%r1)
lg %r7,16(%r2,%r3)
mlgr %r6,%r5
- alcgr %r7,%r8
+ algr %r7,%r8
+ alcgr %r6,zero
stg %r7,16(%r2,%r1)
lg %r9,24(%r2,%r3)
mlgr %r8,%r5
- alcgr %r9,%r6
+ algr %r9,%r6
+ alcgr %r8,zero
stg %r9,24(%r2,%r1)
la %r2,32(%r2) // i+=4
- brct %r4,.Loop4_mul
-
- la %r10,1(%r10) // see if len%4 is zero ...
- brct %r10,.Loop1_madd // without touching condition code:-)
+ brct %r10,.Loop4_mul
-.Lend_mul:
- alcgr %r8,zero // collect carry bit
- lgr %r2,%r8
- lmg %r6,%r10,48(%r15)
- br %r14
+ lghi %r10,3
+ nr %r4,%r10 // cnt=len%4
+ jz .Lend_mul
.Loop1_mul:
lg %r7,0(%r2,%r3) // ap[i]
mlgr %r6,%r5 // *=w
- alcgr %r7,%r8 // +=carry
+ algr %r7,%r8 // +=carry
+ alcgr %r6,zero
stg %r7,0(%r2,%r1) // rp[i]=
lgr %r8,%r6
la %r2,8(%r2) // i++
- brct %r10,.Loop1_mul
+ brct %r4,.Loop1_mul
- j .Lend_mul
+.Lend_mul:
+ lgr %r2,%r8
+ lmg %r6,%r10,48(%r15)
+ br %r14
.size bn_mul_words,.-bn_mul_words
// void bn_sqr_words(BN_ULONG *r2,BN_ULONG *r2,int r4)
.Lend_mul:
alcgr %r8,zero // collect carry bit

View File

@ -395,6 +395,10 @@ rm -rf $RPM_BUILD_ROOT/%{_libdir}/fipscanister.*
%postun -p /sbin/ldconfig
%changelog
* Tue Nov 23 2010 Tomas Mraz <tmraz@redhat.com> 1.0.0b-3
- replace the revert for the s390x bignum asm routines with
fix from upstream
* Mon Nov 22 2010 Tomas Mraz <tmraz@redhat.com> 1.0.0b-2
- revert upstream change in s390x bignum asm routines