зеркало из https://github.com/mozilla/pjs.git
Add support for unsigned long long mp_digits.
Revise and simplify the scheme of feature test macros used in mpi.h. Remove all NSS_ and SOLARIS ifdefs from the source.
This commit is contained in:
Родитель
d3d39e5100
Коммит
11802cc244
|
@ -36,7 +36,7 @@
|
|||
## GPL.
|
||||
##
|
||||
##
|
||||
## $Id: Makefile,v 1.12 2000-12-02 02:37:22 nelsonb%netscape.com Exp $
|
||||
## $Id: Makefile,v 1.13 2000-12-13 01:22:21 nelsonb%netscape.com Exp $
|
||||
##
|
||||
|
||||
## Define CC to be the C compiler you wish to use. The GNU cc
|
||||
|
@ -67,15 +67,16 @@ CFLAGS= -O $(MPICMN)
|
|||
|
||||
ifeq ($(TARGET),mipsIRIX)
|
||||
#IRIX
|
||||
MPICMN += -DMP_MONT_USE_MP_MUL -DMP_ASSEMBLY_MULTIPLY -DMP_ASSEMBLY_SQUARE
|
||||
#MPICMN += -DMP_MONT_USE_MP_MUL
|
||||
MPICMN += -DMP_ASSEMBLY_MULTIPLY -DMP_ASSEMBLY_SQUARE
|
||||
MPICMN += -DMP_USE_UINT_DIGIT
|
||||
#MPICMN += -DMP_NO_MP_WORD
|
||||
AS_OBJS = mpi_mips.o
|
||||
#ASFLAGS = -O -OPT:Olimit=4000 -dollar -fullwarn -xansi -n32 -mips3 -exceptions
|
||||
ASFLAGS = -O -OPT:Olimit=4000 -dollar -fullwarn -xansi -n32 -mips3
|
||||
#CFLAGS=-ansi -n32 -O3 -fullwarn -woff 1429 -D_SGI_SOURCE $(MPICMN)
|
||||
CFLAGS=-ansi -n32 -O2 -fullwarn -woff 1429 -D_SGI_SOURCE $(MPICMN)
|
||||
#CFLAGS=-ansi -n32 -g -fullwarn -woff 1429 -D_SGI_SOURCE $(MPICMN)
|
||||
#CFLAGS=-ansi -n32 -g -fullwarn -woff 1429 -D_SGI_SOURCE -DMP_NO_MP_WORD \
|
||||
$(MPICMN)
|
||||
#CFLAGS=-ansi -64 -O2 -fullwarn -woff 1429 -D_SGI_SOURCE -DMP_NO_MP_WORD \
|
||||
$(MPICMN)
|
||||
endif
|
||||
|
@ -83,43 +84,98 @@ endif
|
|||
ifeq ($(TARGET),alphaOSF1)
|
||||
#Alpha/OSF1
|
||||
#CFLAGS= -O -Olimit 4000 -ieee_with_inexact -std1 -DOSF1 -D_REENTRANT $(MPICMN)
|
||||
#CFLAGS= -O -Olimit 4000 -ieee_with_inexact -std1 -DOSF1 -D_REENTRANT \
|
||||
CFLAGS= -O -Olimit 4000 -ieee_with_inexact -std1 -DOSF1 -D_REENTRANT \
|
||||
-DMP_NO_MP_WORD $(MPICMN)
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET),v9SOLARIS)
|
||||
#Solaris 64
|
||||
SOLARIS_ASM_FLAGS = -fast -xO5 -xrestrict=%all -xdepend -xchip=ultra -xarch=v9a -KPIC -mt
|
||||
AS_OBJS = montmulfv9.o mpi_sparc.o mpv_sparc.o
|
||||
MPICMN += -DMP_USE_UINT_DIGIT -DMP_NO_MP_WORD -DMP_ASSEMBLY_MULTIPLY
|
||||
SOLARIS_FPU_FLAGS = -fast -xO5 -xrestrict=%all -xchip=ultra -xarch=v9a -KPIC -mt
|
||||
#SOLARIS_FPU_FLAGS = -fast -xO5 -xrestrict=%all -xdepend -xchip=ultra -xarch=v9a -KPIC -mt
|
||||
SOLARIS_ASM_FLAGS = -xchip=ultra -xarch=v9a -KPIC -mt
|
||||
AS_OBJS += montmulfv9.o
|
||||
AS_OBJS += mpi_sparc.o mpv_sparcv9.o
|
||||
MPICMN += -DMP_USE_UINT_DIGIT
|
||||
#MPICMN += -DMP_NO_MP_WORD
|
||||
MPICMN += -DMP_ASSEMBLY_MULTIPLY
|
||||
MPICMN += -DMP_USING_MONT_MULF
|
||||
CFLAGS= -O -KPIC -DSVR4 -DSYSV -D__svr4 -D__svr4__ -DSOLARIS -D_REENTRANT \
|
||||
-DSOLARIS2_8 -D_SVID_GETTOD -xarch=v9 -DXP_UNIX -DNSS_USE_64 $(MPICMN)
|
||||
-DSOLARIS2_8 -D_SVID_GETTOD -xarch=v9 -DXP_UNIX $(MPICMN)
|
||||
#CFLAGS= -g -KPIC -DSVR4 -DSYSV -D__svr4 -D__svr4__ -DSOLARIS -D_REENTRANT \
|
||||
-DSOLARIS2_8 -D_SVID_GETTOD -xarch=v9 -DXP_UNIX -DNSS_USE_64 $(MPICMN)
|
||||
-DSOLARIS2_8 -D_SVID_GETTOD -xarch=v9 -DXP_UNIX $(MPICMN)
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET),v8plusSOLARIS)
|
||||
#Solaris 32
|
||||
SOLARIS_FPU_FLAGS = -fast -xO5 -xrestrict=%all -xdepend -xchip=ultra -xarch=v8plusa -KPIC -mt
|
||||
SOLARIS_ASM_FLAGS = -xchip=ultra -xarch=v8plusa -KPIC -mt
|
||||
AS_OBJS = montmulfv8.o mpi_sparc.o mpv_sparcv8.o
|
||||
#AS_OBJS = montmulf.o
|
||||
MPICMN += -DMP_ASSEMBLY_MULTIPLY
|
||||
MPICMN += -DMP_USING_MONT_MULF -DMP_USE_UINT_DIGIT
|
||||
MPICMN += -DMP_NO_MP_WORD
|
||||
CFLAGS=-O -KPIC -DSVR4 -DSYSV -D__svr4 -D__svr4__ -DSOLARIS -D_REENTRANT \
|
||||
-DSOLARIS2_6 -D_SVID_GETTOD -xarch=v8plus -DXP_UNIX $(MPICMN)
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET),v8SOLARIS)
|
||||
#Solaris 32
|
||||
SOLARIS_ASM_FLAGS = -xchip=ultra -xarch=v8plusa -KPIC -mt
|
||||
AS_OBJS = montmulfv8.o mpi_sparc.o mpv_sparc32.o
|
||||
MPICMN += -DMP_ASSEMBLY_MULTIPLY
|
||||
MPICMN += -DMP_USING_MONT_MULF
|
||||
#SOLARIS_FPU_FLAGS = -fast -xO5 -xrestrict=%all -xdepend -xchip=ultra -xarch=v8 -KPIC -mt
|
||||
#SOLARIS_ASM_FLAGS = -xchip=ultra -xarch=v8plusa -KPIC -mt
|
||||
#AS_OBJS = montmulfv8.o mpi_sparc.o mpv_sparcv8.o
|
||||
#AS_OBJS = montmulf.o
|
||||
#MPICMN += -DMP_USING_MONT_MULF
|
||||
#MPICMN += -DMP_ASSEMBLY_MULTIPLY
|
||||
MPICMN += -DMP_USE_LONG_LONG_MULTIPLY -DMP_USE_UINT_DIGIT
|
||||
MPICMN += -DMP_NO_MP_WORD
|
||||
CFLAGS=-O -KPIC -DSVR4 -DSYSV -D__svr4 -D__svr4__ -DSOLARIS -D_REENTRANT \
|
||||
-DSOLARIS2_6 -D_SVID_GETTOD -xarch=v8 -DXP_UNIX -DMP_NO_MP_WORD $(MPICMN)
|
||||
#CFLAGS=-O -KPIC -DSVR4 -DSYSV -D__svr4 -D__svr4__ -DSOLARIS -D_REENTRANT \
|
||||
-DSOLARIS2_6 -D_SVID_GETTOD -xarch=v8 -DXP_UNIX $(MPICMN)
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET),HPUX)
|
||||
#HPUX
|
||||
#ifeq ($(TARGET),PA2.0WHPUX)
|
||||
##HPUX64 (HP PA 2.0 Wide) using MAXPY and 64-bit digits
|
||||
#MPICMN += -DMP_ASSEMBLY_MULTIPLY -DMP_ASSEMBLY_SQUARE
|
||||
#AS_OBJS = mpi_hp.o hppa20.o
|
||||
#CFLAGS= -O -DHPUX10 -D_POSIX_C_SOURCE=199506L -Ae +Z -DHPUX -Dhppa \
|
||||
-D_HPUX_SOURCE -Aa +e +DA2.0W +DS2.0 +DChpux -DHPUX11 -DXP_UNIX \
|
||||
-DNSS_USE_64 $(MPICMN)
|
||||
#CFLAGS= -O -DHPUX10 -D_POSIX_C_SOURCE=199506L -Ae +Z -DHPUX -Dhppa \
|
||||
-D_HPUX_SOURCE +DAportable +DS1.1 -DHPUX11 -DXP_UNIX -DMP_NO_MP_WORD $(MPICMN)
|
||||
-D_HPUX_SOURCE -Aa +e -z +DA2.0W +DS2.0 +O3 +DChpux -DHPUX11 -DXP_UNIX \
|
||||
$(MPICMN)
|
||||
#endif
|
||||
|
||||
ifeq ($(TARGET),PA2.0WHPUX)
|
||||
#HPUX64 (HP PA 2.0 Wide) using 32-bit digits and FPU code
|
||||
# This one is for DA2.0W which is the LP64 ABI.
|
||||
AS_OBJS += montmulf.o
|
||||
MPICMN += -DMP_USING_MONT_MULF -DMP_USE_UINT_DIGIT
|
||||
MPICMN += -DMP_USE_LONG_LONG_MULTIPLY -DMP_NO_MP_WORD
|
||||
CFLAGS= -O -DHPUX10 -D_POSIX_C_SOURCE=199506L -Ae +Z -DHPUX -Dhppa \
|
||||
-D_HPUX_SOURCE -Aa +e -z +DA2.0W +DS2.0 +O3 +DChpux -DHPUX11 -DXP_UNIX \
|
||||
$(MPICMN)
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET),PA2.0NHPUX)
|
||||
#HPUX32 (HP PA 2.0 Narrow) hybrid model, using 32-bit digits
|
||||
# This one is for DA2.0 (N) which is the 32-bit ABI with 64-bit registers.
|
||||
AS_OBJS += montmulf.o
|
||||
MPICMN += -DMP_USING_MONT_MULF -DMP_USE_UINT_DIGIT
|
||||
MPICMN += -DMP_USE_LONG_LONG_MULTIPLY -DMP_NO_MP_WORD
|
||||
CFLAGS= -O -DHPUX10 -D_POSIX_C_SOURCE=199506L -Ae +Z -DHPUX -Dhppa \
|
||||
-D_HPUX_SOURCE -Aa +e -z +DA2.0 +DS2.0 +O3 +DChpux -DHPUX11 -DXP_UNIX \
|
||||
$(MPICMN)
|
||||
#CFLAGS += -DMP_ASSEMBLY_MULTIPLY
|
||||
#AS_OBJS = mpi_hp.o mpv_sparc.o
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET),PA1.1HPUX)
|
||||
#HPUX32 (HP PA 1.1) Pure 32 bit
|
||||
MPICMN += -DMP_USE_UINT_DIGIT -DMP_NO_MP_WORD
|
||||
#MPICMN += -DMP_USE_LONG_LONG_MULTIPLY
|
||||
CFLAGS= -O -DHPUX10 -D_POSIX_C_SOURCE=199506L -Ae +Z -DHPUX -Dhppa \
|
||||
-D_HPUX_SOURCE +DAportable +DS1.1 -DHPUX11 -DXP_UNIX $(MPICMN)
|
||||
##CFLAGS= -g -DHPUX10 -D_POSIX_C_SOURCE=199506L -Ae +Z -DHPUX -Dhppa \
|
||||
# -D_HPUX_SOURCE +DAportable +DS1.1 -DHPUX11 -DXP_UNIX $(MPICMN)
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(TARGET),x86LINUX)
|
||||
#Linux
|
||||
AS_OBJS = mpi_x86.o
|
||||
|
@ -143,6 +199,7 @@ endif
|
|||
## left alone, unless your system has other peculiar requirements.
|
||||
##
|
||||
LIBS=#-lmalloc#-lefence#-lm
|
||||
#LIBS=-lm
|
||||
|
||||
##
|
||||
## Define RANLIB to be the library header randomizer; you might not
|
||||
|
@ -231,13 +288,13 @@ mpi_mips.o: mpi_mips.s
|
|||
|
||||
mpi_sparc.o : montmulf.h
|
||||
|
||||
mpv_sparc32.o: mpv_sparc32.S
|
||||
$(CC) -o $@ $(SOLARIS_ASM_FLAGS) -c mpv_sparc32.S
|
||||
mpv_sparcv9.s: vis_64.il mpv_sparc.c
|
||||
$(CC) -o $@ $(SOLARIS_FPU_FLAGS) -S vis_64.il mpv_sparc.c
|
||||
|
||||
mpv_sparc.o: vis_64.il mpv_sparc.c
|
||||
$(CC) -o $@ $(SOLARIS_ASM_FLAGS) -c vis_64.il mpv_sparc.c
|
||||
mpv_sparcv8.s: vis_64.il mpv_sparc.c
|
||||
$(CC) -o $@ $(SOLARIS_FPU_FLAGS) -S vis_32.il mpv_sparc.c
|
||||
|
||||
montmulfv8.o montmulfv9.o : %.o : %.s
|
||||
montmulfv8.o montmulfv9.o mpv_sparcv8.o mpv_sparcv9.o : %.o : %.s
|
||||
$(CC) -o $@ $(SOLARIS_ASM_FLAGS) -c $<
|
||||
|
||||
# This rule is used to build the .s sources, which are then hand optimized.
|
||||
|
@ -249,6 +306,8 @@ libmpi.a: $(LIBOBJS)
|
|||
ar -cvr libmpi.a $(LIBOBJS)
|
||||
$(RANLIB) libmpi.a
|
||||
|
||||
lib libs: libmpi.a
|
||||
|
||||
mpi.i: mpi.h
|
||||
|
||||
#---------------------------------------
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
* the GPL. If you do not delete the provisions above, a recipient
|
||||
* may use your version of this file under either the MPL or the GPL.
|
||||
*
|
||||
* $Id: mpi.c,v 1.28 2000-12-09 03:36:41 nelsonb%netscape.com Exp $
|
||||
* $Id: mpi.c,v 1.29 2000-12-13 01:22:22 nelsonb%netscape.com Exp $
|
||||
*/
|
||||
|
||||
#include "mpi-priv.h"
|
||||
|
@ -340,7 +340,7 @@ void mp_set(mp_int *mp, mp_digit d)
|
|||
mp_err mp_set_int(mp_int *mp, long z)
|
||||
{
|
||||
int ix;
|
||||
unsigned long v = abs(z);
|
||||
unsigned long v = labs(z);
|
||||
mp_err res;
|
||||
|
||||
ARGCHK(mp != NULL, MP_BADARG);
|
||||
|
@ -1990,7 +1990,7 @@ mp_size mp_trailing_zeros(const mp_int *mp)
|
|||
n += MP_DIGIT_BIT;
|
||||
if (!d)
|
||||
return 0; /* shouldn't happen, but ... */
|
||||
#if (MP_DIGIT_MAX > MP_32BIT_MAX)
|
||||
#if !defined(MP_USE_UINT_DIGIT)
|
||||
if (!(d & 0xffffffffU)) {
|
||||
d >>= 32;
|
||||
n += 32;
|
||||
|
@ -2105,7 +2105,7 @@ mp_digit s_mp_invmod_radix(mp_digit P)
|
|||
T *= 2 - (P * T);
|
||||
T *= 2 - (P * T);
|
||||
T *= 2 - (P * T);
|
||||
#if MP_DIGIT_MAX > MP_32BIT_MAX
|
||||
#if !defined(MP_USE_UINT_DIGIT)
|
||||
T *= 2 - (P * T);
|
||||
T *= 2 - (P * T);
|
||||
#endif
|
||||
|
@ -3791,7 +3791,7 @@ mp_err s_mp_mul(mp_int *a, const mp_int *b)
|
|||
|
||||
/* }}} */
|
||||
|
||||
#if defined(SOLARIS) && (ULONG_MAX == UINT_MAX)
|
||||
#if defined(MP_USE_UINT_DIGIT) && defined(MP_USE_LONG_LONG_MULTIPLY)
|
||||
/* This trick works on Sparc V8 CPUs with the Workshop compilers. */
|
||||
#define MP_MUL_DxD(a, b, Phi, Plo) \
|
||||
{ unsigned long long product = (unsigned long long)a * b; \
|
||||
|
@ -3934,7 +3934,7 @@ void s_mpv_mul_d_add_prop(const mp_digit *a, mp_size a_len, mp_digit b, mp_digit
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(SOLARIS) && (ULONG_MAX == UINT_MAX)
|
||||
#if defined(MP_USE_UINT_DIGIT) && defined(MP_USE_LONG_LONG_MULTIPLY)
|
||||
/* This trick works on Sparc V8 CPUs with the Workshop compilers. */
|
||||
#define MP_SQR_D(a, Phi, Plo) \
|
||||
{ unsigned long long square = (unsigned long long)a * a; \
|
||||
|
@ -4429,18 +4429,31 @@ int s_mp_ispow2d(mp_digit d)
|
|||
{
|
||||
if ((d != 0) && ((d & (d-1)) == 0)) { /* d is a power of 2 */
|
||||
int pow = 0;
|
||||
#if MP_DIGIT_MAX == MP_32BIT_MAX
|
||||
if (d & 0xffff0000)
|
||||
#if defined (MP_USE_UINT_DIGIT)
|
||||
if (d & 0xffff0000U)
|
||||
pow += 16;
|
||||
if (d & 0xff00ff00)
|
||||
if (d & 0xff00ff00U)
|
||||
pow += 8;
|
||||
if (d & 0xf0f0f0f0)
|
||||
if (d & 0xf0f0f0f0U)
|
||||
pow += 4;
|
||||
if (d & 0xcccccccc)
|
||||
if (d & 0xccccccccU)
|
||||
pow += 2;
|
||||
if (d & 0xaaaaaaaa)
|
||||
if (d & 0xaaaaaaaaU)
|
||||
pow += 1;
|
||||
#else
|
||||
#elif defined(MP_USE_LONG_LONG_DIGIT)
|
||||
if (d & 0xffffffff00000000ULL)
|
||||
pow += 32;
|
||||
if (d & 0xffff0000ffff0000ULL)
|
||||
pow += 16;
|
||||
if (d & 0xff00ff00ff00ff00ULL)
|
||||
pow += 8;
|
||||
if (d & 0xf0f0f0f0f0f0f0f0ULL)
|
||||
pow += 4;
|
||||
if (d & 0xccccccccccccccccULL)
|
||||
pow += 2;
|
||||
if (d & 0xaaaaaaaaaaaaaaaaULL)
|
||||
pow += 1;
|
||||
#elif defined(MP_USE_LONG_DIGIT)
|
||||
if (d & 0xffffffff00000000UL)
|
||||
pow += 32;
|
||||
if (d & 0xffff0000ffff0000UL)
|
||||
|
@ -4453,6 +4466,8 @@ int s_mp_ispow2d(mp_digit d)
|
|||
pow += 2;
|
||||
if (d & 0xaaaaaaaaaaaaaaaaUL)
|
||||
pow += 1;
|
||||
#else
|
||||
#error "unknown type for mp_digit"
|
||||
#endif
|
||||
return pow;
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
* may use your version of this file under either the MPL or the
|
||||
* GPL.
|
||||
*
|
||||
* $Id: mpi.h,v 1.16 2000-11-08 01:10:44 javi%netscape.com Exp $
|
||||
* $Id: mpi.h,v 1.17 2000-12-13 01:22:21 nelsonb%netscape.com Exp $
|
||||
*/
|
||||
|
||||
#ifndef _H_MPI_
|
||||
|
@ -87,20 +87,6 @@ typedef int mp_err;
|
|||
#error "USHRT_MAX not defined"
|
||||
#endif
|
||||
|
||||
#if !defined(MP_USE_UINT_DIGIT) && ULONG_MAX > MP_32BIT_MAX
|
||||
typedef unsigned long mp_digit;
|
||||
#define MP_DIGIT_MAX ULONG_MAX
|
||||
#define MP_HALF_DIGIT_MAX UINT_MAX
|
||||
#undef MP_NO_MP_WORD
|
||||
#define MP_NO_MP_WORD 1
|
||||
#else
|
||||
typedef unsigned int mp_digit;
|
||||
#define MP_DIGIT_MAX UINT_MAX
|
||||
#define MP_HALF_DIGIT_MAX USHRT_MAX
|
||||
#endif
|
||||
|
||||
#ifndef MP_NO_MP_WORD
|
||||
|
||||
#if defined(ULONG_LONG_MAX) /* GCC, HPUX */
|
||||
#define MP_ULONG_LONG_MAX ULONG_LONG_MAX
|
||||
#elif defined(ULLONG_MAX) /* Solaris */
|
||||
|
@ -110,27 +96,59 @@ typedef unsigned int mp_digit;
|
|||
#define MP_ULONG_LONG_MAX ULONGLONG_MAX
|
||||
#endif
|
||||
|
||||
#if defined(MP_ULONG_LONG_MAX)
|
||||
#if (MP_ULONG_LONG_MAX > UINT_MAX) || defined(SOLARIS)
|
||||
#if MP_ULONG_LONG_MAX == ULONG_MAX || (defined(SOLARIS) && defined(NSS_USE_64))
|
||||
/* We only use unsigned long for mp_digit iff long is more than 32 bits. */
|
||||
#if !defined(MP_USE_UINT_DIGIT) && ULONG_MAX > MP_32BIT_MAX
|
||||
typedef unsigned long mp_digit;
|
||||
#define MP_DIGIT_MAX ULONG_MAX
|
||||
#define MP_DIGIT_FMT "%016lX" /* printf() format for 1 digit */
|
||||
#define MP_HALF_DIGIT_MAX UINT_MAX
|
||||
#undef MP_NO_MP_WORD
|
||||
#define MP_NO_MP_WORD 1
|
||||
#undef MP_USE_LONG_DIGIT
|
||||
#define MP_USE_LONG_DIGIT 1
|
||||
#undef MP_USE_LONG_LONG_DIGIT
|
||||
|
||||
#elif !defined(MP_USE_UINT_DIGIT) && defined(MP_ULONG_LONG_MAX)
|
||||
typedef unsigned long long mp_digit;
|
||||
#define MP_DIGIT_MAX MP_ULONG_LONG_MAX
|
||||
#define MP_DIGIT_FMT "%016llX" /* printf() format for 1 digit */
|
||||
#define MP_HALF_DIGIT_MAX UINT_MAX
|
||||
#undef MP_NO_MP_WORD
|
||||
#define MP_NO_MP_WORD 1
|
||||
#undef MP_USE_LONG_LONG_DIGIT
|
||||
#define MP_USE_LONG_LONG_DIGIT 1
|
||||
#undef MP_USE_LONG_DIGIT
|
||||
|
||||
#else
|
||||
typedef unsigned int mp_digit;
|
||||
#define MP_DIGIT_MAX UINT_MAX
|
||||
#define MP_DIGIT_FMT "%08X" /* printf() format for 1 digit */
|
||||
#define MP_HALF_DIGIT_MAX USHRT_MAX
|
||||
#undef MP_USE_UINT_DIGIT
|
||||
#define MP_USE_UINT_DIGIT 1
|
||||
#undef MP_USE_LONG_LONG_DIGIT
|
||||
#undef MP_USE_LONG_DIGIT
|
||||
#endif
|
||||
|
||||
#if !defined(MP_NO_MP_WORD)
|
||||
#if defined(MP_USE_UINT_DIGIT) && \
|
||||
(defined(MP_ULONG_LONG_MAX) || (ULONG_MAX > UINT_MAX))
|
||||
|
||||
#if (ULONG_MAX > UINT_MAX)
|
||||
typedef unsigned long mp_word;
|
||||
typedef long mp_sword;
|
||||
#define MP_WORD_MAX ULONG_MAX
|
||||
|
||||
#else
|
||||
typedef unsigned long long mp_word;
|
||||
typedef long long mp_sword;
|
||||
#define MP_WORD_MAX MP_ULONG_LONG_MAX
|
||||
#endif
|
||||
#else
|
||||
/* MP_ULONG_LONG_MAX <= UINT_MAX */
|
||||
#define MP_NO_MP_WORD 1
|
||||
#endif
|
||||
#else
|
||||
/* MP_ULONG_LONG_MAX not defined */
|
||||
#define MP_NO_MP_WORD 1
|
||||
#endif
|
||||
|
||||
#endif /* !MP_NO_MP_WORD */
|
||||
#else
|
||||
#define MP_NO_MP_WORD 1
|
||||
#endif
|
||||
#endif /* !defined(MP_NO_MP_WORD) */
|
||||
|
||||
#if !defined(MP_WORD_MAX) && defined(MP_DEFINE_SMALL_WORD)
|
||||
typedef unsigned int mp_word;
|
||||
|
@ -149,15 +167,6 @@ typedef int mp_sword;
|
|||
** consistent with the other _HALF_ names.
|
||||
*/
|
||||
|
||||
#if MP_DIGIT_MAX == USHRT_MAX
|
||||
#define MP_DIGIT_FMT "%04X" /* printf() format for 1 digit */
|
||||
#elif MP_DIGIT_MAX == UINT_MAX
|
||||
#define MP_DIGIT_FMT "%08X" /* printf() format for 1 digit */
|
||||
#elif MP_DIGIT_MAX == ULONG_MAX
|
||||
#define MP_DIGIT_FMT "%016lX" /* printf() format for 1 digit */
|
||||
#else
|
||||
#define MP_DIGIT_FMT "%016llX" /* printf() format for 1 digit */
|
||||
#endif
|
||||
|
||||
/* Macros for accessing the mp_int internals */
|
||||
#define MP_SIGN(MP) ((MP)->sign)
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
* the GPL. If you do not delete the provisions above, a recipient
|
||||
* may use your version of this file under either the MPL or the
|
||||
* GPL.
|
||||
* $Id: mpi_sparc.c,v 1.3 2000-11-29 01:30:28 nelsonb%netscape.com Exp $
|
||||
* $Id: mpi_sparc.c,v 1.4 2000-12-13 01:22:22 nelsonb%netscape.com Exp $
|
||||
*/
|
||||
|
||||
/* Multiplication performance enhancements for sparc v8+vis CPUs. */
|
||||
|
@ -277,7 +277,7 @@ isSparcV8PlusVis(void)
|
|||
char buf[256];
|
||||
buflen = sysinfo(SI_ISALIST, buf, sizeof buf);
|
||||
if (buflen > 0) {
|
||||
#if defined(NSS_USE_64)
|
||||
#if defined(MP_USE_LONG_DIGIT)
|
||||
char * found = strstr(buf, "sparcv9+vis");
|
||||
#else
|
||||
char * found = strstr(buf, "sparcv8plus+vis");
|
||||
|
|
Загрузка…
Ссылка в новой задаче