Changeset View
Changeset View
Standalone View
Standalone View
src/secp256k1/CMakeLists.txt
Show First 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | if(SECP256K1_ENABLE_BIGNUM) | ||||
set(USE_SCALAR_INV_NUM 1) | set(USE_SCALAR_INV_NUM 1) | ||||
else() | else() | ||||
set(USE_NUM_NONE 1) | set(USE_NUM_NONE 1) | ||||
set(USE_FIELD_INV_BUILTIN 1) | set(USE_FIELD_INV_BUILTIN 1) | ||||
set(USE_SCALAR_INV_BUILTIN 1) | set(USE_SCALAR_INV_BUILTIN 1) | ||||
endif() | endif() | ||||
# We check if amd64 asm is supported. | # We check if amd64 asm is supported. | ||||
option(SECP256K1_USE_ASM "Use assembly if available" ON) | |||||
if($SECP256K1_USE_ASM) | |||||
check_c_source_compiles(" | check_c_source_compiles(" | ||||
#include <stdint.h> | #include <stdint.h> | ||||
int main() { | int main() { | ||||
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\"); | ||||
return 0; | return 0; | ||||
} | } | ||||
" USE_ASM_X86_64) | " USE_ASM_X86_64) | ||||
else() | |||||
set(USE_ASM_X86_64 0) | |||||
endif() | |||||
# We make sure __int128 is defined | # We make sure __int128 is defined | ||||
include(CheckTypeSize) | include(CheckTypeSize) | ||||
check_type_size(__int128 SIZEOF___INT128) | check_type_size(__int128 SIZEOF___INT128) | ||||
if(SIZEOF___INT128 EQUAL 16) | if(SIZEOF___INT128 EQUAL 16) | ||||
set(HAVE___INT128 1) | set(HAVE___INT128 1) | ||||
else() | else() | ||||
# If we do not support __int128, we should be falling back | # If we do not support __int128, we should be falling back | ||||
▲ Show 20 Lines • Show All 237 Lines • Show Last 20 Lines |