forked from wolfSSL/wolfssl
add NO_64BIT flag to normal and fastmath to use a 32 bit accumulator for multiply when 64 bit actually slows it down
This commit is contained in:
@ -82,9 +82,9 @@ extern "C" {
|
|||||||
#ifdef MP_8BIT
|
#ifdef MP_8BIT
|
||||||
typedef unsigned char mp_digit;
|
typedef unsigned char mp_digit;
|
||||||
typedef unsigned short mp_word;
|
typedef unsigned short mp_word;
|
||||||
#elif defined(MP_16BIT)
|
#elif (defined(MP_16BIT) || defined(NO_64BIT))
|
||||||
typedef unsigned short mp_digit;
|
typedef unsigned short mp_digit;
|
||||||
typedef unsigned long mp_word;
|
typedef unsigned int mp_word;
|
||||||
#elif defined(MP_64BIT)
|
#elif defined(MP_64BIT)
|
||||||
/* for GCC only on supported platforms */
|
/* for GCC only on supported platforms */
|
||||||
#ifndef CRYPT
|
#ifndef CRYPT
|
||||||
|
@ -54,6 +54,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef NO_64BIT
|
||||||
/* autodetect x86-64 and make sure we are using 64-bit digits with x86-64 asm */
|
/* autodetect x86-64 and make sure we are using 64-bit digits with x86-64 asm */
|
||||||
#if defined(__x86_64__)
|
#if defined(__x86_64__)
|
||||||
#if defined(TFM_X86) || defined(TFM_SSE2) || defined(TFM_ARM)
|
#if defined(TFM_X86) || defined(TFM_SSE2) || defined(TFM_ARM)
|
||||||
@ -72,6 +73,7 @@
|
|||||||
#if defined(__x86_64__) && !defined(FP_64BIT)
|
#if defined(__x86_64__) && !defined(FP_64BIT)
|
||||||
#define FP_64BIT
|
#define FP_64BIT
|
||||||
#endif
|
#endif
|
||||||
|
#endif /* NO_64BIT */
|
||||||
|
|
||||||
/* try to detect x86-32 */
|
/* try to detect x86-32 */
|
||||||
#if defined(__i386__) && !defined(TFM_SSE2)
|
#if defined(__i386__) && !defined(TFM_SSE2)
|
||||||
@ -214,8 +216,15 @@
|
|||||||
typedef signed long long long64;
|
typedef signed long long long64;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
typedef unsigned int fp_digit;
|
#ifndef NO_64BIT
|
||||||
typedef ulong64 fp_word;
|
typedef unsigned int fp_digit;
|
||||||
|
typedef ulong64 fp_word;
|
||||||
|
#else
|
||||||
|
/* some procs like coldfire prefer not to place multiply into 64bit type
|
||||||
|
even though it exists */
|
||||||
|
typedef unsigned short fp_digit;
|
||||||
|
typedef unsigned int fp_word;
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* # of digits this is */
|
/* # of digits this is */
|
||||||
|
Reference in New Issue
Block a user