aboutsummaryrefslogtreecommitdiff
path: root/src/secp256k1/cmake/Check64bitAssembly.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'src/secp256k1/cmake/Check64bitAssembly.cmake')
-rw-r--r--src/secp256k1/cmake/Check64bitAssembly.cmake14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/secp256k1/cmake/Check64bitAssembly.cmake b/src/secp256k1/cmake/Check64bitAssembly.cmake
new file mode 100644
index 0000000000..3f65887765
--- /dev/null
+++ b/src/secp256k1/cmake/Check64bitAssembly.cmake
@@ -0,0 +1,14 @@
+include(CheckCSourceCompiles)
+
+function(check_64bit_assembly)
+ check_c_source_compiles("
+ #include <stdint.h>
+
+ int main()
+ {
+ uint64_t a = 11, tmp;
+ __asm__ __volatile__(\"movq $0x100000000,%1; mulq %%rsi\" : \"+a\"(a) : \"S\"(tmp) : \"cc\", \"%rdx\");
+ }
+ " HAS_64BIT_ASM)
+ set(HAS_64BIT_ASM ${HAS_64BIT_ASM} PARENT_SCOPE)
+endfunction()