nss/bug432146.patch

131 lines
4.5 KiB
Diff
Raw Normal View History

Index: mozilla/security/nss/lib/freebl/mpi/mp_comba.c
===================================================================
RCS file: /cvsroot/mozilla/security/nss/lib/freebl/mpi/mp_comba.c,v
retrieving revision 1.2
diff -u -u -8 -p -r1.2 mp_comba.c
--- mozilla/security/nss/lib/freebl/mpi/mp_comba.c 16 Aug 2005 19:25:48 -0000 1.2
+++ mozilla/security/nss/lib/freebl/mpi/mp_comba.c 14 Feb 2008 22:36:54 -0000
@@ -87,22 +87,22 @@ __asm__ (
"adcq $0,%2 \n\t" \
"addq %%rax,%0 \n\t" \
"adcq %%rdx,%1 \n\t" \
"adcq $0,%2 \n\t" \
:"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) :"%rax","%rdx","%cc");
#define SQRADDSC(i, j) \
__asm__ ( \
- "movq %6,%%rax \n\t" \
- "mulq %7 \n\t" \
+ "movq %3,%%rax \n\t" \
+ "mulq %4 \n\t" \
"movq %%rax,%0 \n\t" \
"movq %%rdx,%1 \n\t" \
"xorq %2,%2 \n\t" \
- :"=r"(sc0), "=r"(sc1), "=r"(sc2): "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) :"%rax","%rdx","%cc");
+ :"=r"(sc0), "=r"(sc1), "=r"(sc2): "g"(i), "g"(j) :"%rax","%rdx","%cc");
#define SQRADDAC(i, j) \
__asm__ ( \
"movq %6,%%rax \n\t" \
"mulq %7 \n\t" \
"addq %%rax,%0 \n\t" \
"adcq %%rdx,%1 \n\t" \
"adcq $0,%2 \n\t" \
@@ -111,17 +111,17 @@ __asm__ (
#define SQRADDDB \
__asm__ ( \
"addq %3,%0 \n\t" \
"adcq %4,%1 \n\t" \
"adcq %5,%2 \n\t" \
"addq %3,%0 \n\t" \
"adcq %4,%1 \n\t" \
"adcq %5,%2 \n\t" \
- :"=r"(c0), "=r"(c1), "=r"(c2), "=r"(sc0), "=r"(sc1), "=r"(sc2) : "0"(c0), "1"(c1), "2"(c2), "3"(sc0), "4"(sc1), "5"(sc2) : "%cc");
+ :"=&r"(c0), "=&r"(c1), "=&r"(c2) : "r"(sc0), "r"(sc1), "r"(sc2), "0"(c0), "1"(c1), "2"(c2) : "%cc");
void s_mp_mul_comba_4(const mp_int *A, const mp_int *B, mp_int *C)
{
mp_digit c0, c1, c2, at[8];
@@ -645,19 +645,17 @@ void s_mp_mul_comba_32(const mp_int *A,
mp_clamp(C);
COMBA_FINI;
}
void s_mp_sqr_comba_4(const mp_int *A, mp_int *B)
{
- mp_digit *a, b[8], c0, c1, c2, sc0, sc1, sc2;
- /* get rid of some compiler warnings */
- sc0 = 0; sc1 = 0; sc2 = 0;
+ mp_digit *a, b[8], c0, c1, c2;
a = A->dp;
COMBA_START;
/* clear carries */
CLEAR_CARRY;
/* output 0 */
@@ -700,18 +698,16 @@ void s_mp_sqr_comba_4(const mp_int *A, m
B->sign = ZPOS;
memcpy(B->dp, b, 8 * sizeof(mp_digit));
mp_clamp(B);
}
void s_mp_sqr_comba_8(const mp_int *A, mp_int *B)
{
mp_digit *a, b[16], c0, c1, c2, sc0, sc1, sc2;
- /* get rid of some compiler warnings */
- sc0 = 0; sc1 = 0; sc2 = 0;
a = A->dp;
COMBA_START;
/* clear carries */
CLEAR_CARRY;
/* output 0 */
@@ -794,18 +790,16 @@ void s_mp_sqr_comba_8(const mp_int *A, m
B->sign = ZPOS;
memcpy(B->dp, b, 16 * sizeof(mp_digit));
mp_clamp(B);
}
void s_mp_sqr_comba_16(const mp_int *A, mp_int *B)
{
mp_digit *a, b[32], c0, c1, c2, sc0, sc1, sc2;
- /* get rid of some compiler warnings */
- sc0 = 0; sc1 = 0; sc2 = 0;
a = A->dp;
COMBA_START;
/* clear carries */
CLEAR_CARRY;
/* output 0 */
@@ -969,18 +963,16 @@ void s_mp_sqr_comba_16(const mp_int *A,
memcpy(B->dp, b, 32 * sizeof(mp_digit));
mp_clamp(B);
}
void s_mp_sqr_comba_32(const mp_int *A, mp_int *B)
{
mp_digit *a, b[64], c0, c1, c2, sc0, sc1, sc2;
- /* get rid of some compiler warnings */
- sc0 = 0; sc1 = 0; sc2 = 0;
a = A->dp;
COMBA_START;
/* clear carries */
CLEAR_CARRY;
/* output 0 */