build: Rename 64bit
to x86_64
This commit is contained in:
parent
03246457a8
commit
c6bb29b303
@ -115,9 +115,9 @@ if(SECP256K1_ASM STREQUAL "arm32")
|
|||||||
message(FATAL_ERROR "ARM32 assembly optimization requested but not available.")
|
message(FATAL_ERROR "ARM32 assembly optimization requested but not available.")
|
||||||
endif()
|
endif()
|
||||||
elseif(SECP256K1_ASM)
|
elseif(SECP256K1_ASM)
|
||||||
include(Check64bitAssembly)
|
include(CheckX86_64Assembly)
|
||||||
check_64bit_assembly()
|
check_x86_64_assembly()
|
||||||
if(HAS_64BIT_ASM)
|
if(HAVE_X86_64_ASM)
|
||||||
set(SECP256K1_ASM "x86_64")
|
set(SECP256K1_ASM "x86_64")
|
||||||
add_compile_definitions(USE_ASM_X86_64=1)
|
add_compile_definitions(USE_ASM_X86_64=1)
|
||||||
elseif(SECP256K1_ASM STREQUAL "AUTO")
|
elseif(SECP256K1_ASM STREQUAL "AUTO")
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
dnl escape "$0x" below using the m4 quadrigaph @S|@, and escape it again with a \ for the shell.
|
dnl escape "$0x" below using the m4 quadrigaph @S|@, and escape it again with a \ for the shell.
|
||||||
AC_DEFUN([SECP_64BIT_ASM_CHECK],[
|
AC_DEFUN([SECP_X86_64_ASM_CHECK],[
|
||||||
AC_MSG_CHECKING(for x86_64 assembly availability)
|
AC_MSG_CHECKING(for x86_64 assembly availability)
|
||||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
||||||
#include <stdint.h>]],[[
|
#include <stdint.h>]],[[
|
||||||
uint64_t a = 11, tmp;
|
uint64_t a = 11, tmp;
|
||||||
__asm__ __volatile__("movq \@S|@0x100000000,%1; mulq %%rsi" : "+a"(a) : "S"(tmp) : "cc", "%rdx");
|
__asm__ __volatile__("movq \@S|@0x100000000,%1; mulq %%rsi" : "+a"(a) : "S"(tmp) : "cc", "%rdx");
|
||||||
]])],[has_64bit_asm=yes],[has_64bit_asm=no])
|
]])], [has_x86_64_asm=yes], [has_x86_64_asm=no])
|
||||||
AC_MSG_RESULT([$has_64bit_asm])
|
AC_MSG_RESULT([$has_x86_64_asm])
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([SECP_ARM32_ASM_CHECK], [
|
AC_DEFUN([SECP_ARM32_ASM_CHECK], [
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
include(CheckCSourceCompiles)
|
include(CheckCSourceCompiles)
|
||||||
|
|
||||||
function(check_64bit_assembly)
|
function(check_x86_64_assembly)
|
||||||
check_c_source_compiles("
|
check_c_source_compiles("
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
@ -9,6 +9,6 @@ function(check_64bit_assembly)
|
|||||||
uint64_t a = 11, tmp;
|
uint64_t a = 11, tmp;
|
||||||
__asm__ __volatile__(\"movq $0x100000000,%1; mulq %%rsi\" : \"+a\"(a) : \"S\"(tmp) : \"cc\", \"%rdx\");
|
__asm__ __volatile__(\"movq $0x100000000,%1; mulq %%rsi\" : \"+a\"(a) : \"S\"(tmp) : \"cc\", \"%rdx\");
|
||||||
}
|
}
|
||||||
" HAS_64BIT_ASM)
|
" HAVE_X86_64_ASM)
|
||||||
set(HAS_64BIT_ASM ${HAS_64BIT_ASM} PARENT_SCOPE)
|
set(HAVE_X86_64_ASM ${HAVE_X86_64_ASM} PARENT_SCOPE)
|
||||||
endfunction()
|
endfunction()
|
@ -263,8 +263,8 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if test x"$req_asm" = x"auto"; then
|
if test x"$req_asm" = x"auto"; then
|
||||||
SECP_64BIT_ASM_CHECK
|
SECP_X86_64_ASM_CHECK
|
||||||
if test x"$has_64bit_asm" = x"yes"; then
|
if test x"$has_x86_64_asm" = x"yes"; then
|
||||||
set_asm=x86_64
|
set_asm=x86_64
|
||||||
fi
|
fi
|
||||||
if test x"$set_asm" = x; then
|
if test x"$set_asm" = x; then
|
||||||
@ -274,8 +274,8 @@ else
|
|||||||
set_asm=$req_asm
|
set_asm=$req_asm
|
||||||
case $set_asm in
|
case $set_asm in
|
||||||
x86_64)
|
x86_64)
|
||||||
SECP_64BIT_ASM_CHECK
|
SECP_X86_64_ASM_CHECK
|
||||||
if test x"$has_64bit_asm" != x"yes"; then
|
if test x"$has_x86_64_asm" != x"yes"; then
|
||||||
AC_MSG_ERROR([x86_64 assembly optimization requested but not available])
|
AC_MSG_ERROR([x86_64 assembly optimization requested but not available])
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user