Automatic detection of CPU capabilities

This commit is contained in:
tevador 2019-10-08 23:09:35 +02:00
parent eda3603bf3
commit e0484dfb99
8 changed files with 232 additions and 28 deletions

View file

@ -34,6 +34,7 @@ src/argon2_ref.c
src/argon2_ssse3.c
src/argon2_avx2.c
src/bytecode_machine.cpp
src/cpu.cpp
src/dataset.cpp
src/soft_aes.cpp
src/virtual_memory.cpp
@ -132,6 +133,13 @@ if (ARM_ID STREQUAL "aarch64" OR ARM_ID STREQUAL "arm64" OR ARM_ID STREQUAL "arm
# cheat because cmake and ccache hate each other
set_property(SOURCE src/jit_compiler_a64_static.S PROPERTY LANGUAGE C)
# not sure if this check is needed
include(CheckIncludeFile)
check_include_file(asm/hwcap.h HAVE_HWCAP)
if(HAVE_HWCAP)
add_definitions(-DHAVE_HWCAP)
endif()
if(ARCH STREQUAL "native")
add_flag("-march=native")
else()