Merge pull request #3469 from SparkiDev/cpuid_sp_asm

cpuid and SP ASM: ensure WOLFSSL_X86_64_BUILD is defined
This commit is contained in:
toddouska
2020-11-06 10:34:40 -08:00
committed by GitHub
3 changed files with 8 additions and 3 deletions

View File

@ -4883,11 +4883,16 @@ if test "$ENABLED_SP_ASM" = "yes"; then
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_X86_64_ASM" AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_X86_64_ASM"
AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_SP_X86_64_ASM" AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_SP_X86_64_ASM"
ENABLED_SP_X86_64_ASM=yes ENABLED_SP_X86_64_ASM=yes
if test "x$ENABLED_FASTMATH" = "xno"
then
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_X86_64_BUILD"
fi
;; ;;
*) *)
AC_MSG_ERROR([ASM not available for CPU. Supported CPUs: x86_64, aarch64, arm]) AC_MSG_ERROR([ASM not available for CPU. Supported CPUs: x86_64, aarch64, arm])
;; ;;
esac esac
fi fi
if test "$ENABLED_SP_MATH" = "yes"; then if test "$ENABLED_SP_MATH" = "yes"; then

View File

@ -29,8 +29,7 @@
#include <wolfssl/wolfcrypt/cpuid.h> #include <wolfssl/wolfcrypt/cpuid.h>
#if (defined(WOLFSSL_X86_64_BUILD) || defined(USE_INTEL_SPEEDUP) || \ #if (defined(WOLFSSL_X86_64_BUILD) || defined(USE_INTEL_SPEEDUP) || \
defined(WOLFSSL_AESNI) || defined(WOLFSSL_SP_ASM)) && \ defined(WOLFSSL_AESNI)) && !defined(WOLFSSL_NO_ASM)
!defined(WOLFSSL_NO_ASM)
/* Each platform needs to query info type 1 from cpuid to see if aesni is /* Each platform needs to query info type 1 from cpuid to see if aesni is
* supported. Also, let's setup a macro for proper linkage w/o ABI conflicts * supported. Also, let's setup a macro for proper linkage w/o ABI conflicts
*/ */

View File

@ -33,7 +33,8 @@
#endif #endif
#if defined(WOLFSSL_X86_64_BUILD) || defined(USE_INTEL_SPEEDUP) || \ #if defined(WOLFSSL_X86_64_BUILD) || defined(USE_INTEL_SPEEDUP) || \
defined(WOLFSSL_AESNI) || defined(WOLFSSL_SP_ASM) defined(WOLFSSL_AESNI)
#define CPUID_AVX1 0x0001 #define CPUID_AVX1 0x0001
#define CPUID_AVX2 0x0002 #define CPUID_AVX2 0x0002
#define CPUID_RDRAND 0x0004 #define CPUID_RDRAND 0x0004