Merge pull request #240 from Ko-/development

Enable 64-bit bignum limbs and add optimized multiplication for Aarch64
This commit is contained in:
Jaeden Amero 2019-09-04 11:11:51 +01:00 committed by GitHub
commit 5656623d9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 1 deletions

View File

@ -129,7 +129,8 @@
defined(__ppc64__) || defined(__powerpc64__) || \ defined(__ppc64__) || defined(__powerpc64__) || \
defined(__ia64__) || defined(__alpha__) || \ defined(__ia64__) || defined(__alpha__) || \
( defined(__sparc__) && defined(__arch64__) ) || \ ( defined(__sparc__) && defined(__arch64__) ) || \
defined(__s390x__) || defined(__mips64) ) defined(__s390x__) || defined(__mips64) || \
defined(__aarch64__) )
#if !defined(MBEDTLS_HAVE_INT64) #if !defined(MBEDTLS_HAVE_INT64)
#define MBEDTLS_HAVE_INT64 #define MBEDTLS_HAVE_INT64
#endif /* MBEDTLS_HAVE_INT64 */ #endif /* MBEDTLS_HAVE_INT64 */

View File

@ -198,6 +198,30 @@
#endif /* AMD64 */ #endif /* AMD64 */
#if defined(__aarch64__)
#define MULADDC_INIT \
asm(
#define MULADDC_CORE \
"ldr x4, [%2], #8 \n\t" \
"ldr x5, [%1] \n\t" \
"mul x6, x4, %3 \n\t" \
"umulh x7, x4, %3 \n\t" \
"adds x5, x5, x6 \n\t" \
"adc x7, x7, xzr \n\t" \
"adds x5, x5, %0 \n\t" \
"adc %0, x7, xzr \n\t" \
"str x5, [%1], #8 \n\t"
#define MULADDC_STOP \
: "+r" (c), "+r" (d), "+r" (s) \
: "r" (b) \
: "x4", "x5", "x6", "x7", "cc" \
);
#endif /* Aarch64 */
#if defined(__mc68020__) || defined(__mcpu32__) #if defined(__mc68020__) || defined(__mcpu32__)
#define MULADDC_INIT \ #define MULADDC_INIT \