add -mtune=native with opt arch

This commit is contained in:
daanx 2024-12-22 12:21:31 -08:00
parent 93fa8d895a
commit 8d16303aa6

View file

@ -401,9 +401,9 @@ if(CMAKE_C_COMPILER_ID MATCHES "AppleClang|Clang|GNU|Intel")
endif() endif()
if(MI_OPT_ARCH) if(MI_OPT_ARCH)
if(MI_ARCH STREQUAL "x64") if(MI_ARCH STREQUAL "x64")
set(MI_OPT_ARCH_FLAGS "-march=haswell;-mavx2") # fast bit scan (since 2013) set(MI_OPT_ARCH_FLAGS "-march=haswell;-mavx2;-mtune=native") # fast bit scan (since 2013)
elseif(MI_ARCH STREQUAL "arm64") elseif(MI_ARCH STREQUAL "arm64")
set(MI_OPT_ARCH_FLAGS "-march=armv8.1-a") # fast atomics (since 2016) set(MI_OPT_ARCH_FLAGS "-march=armv8.1-a;-mtune=native") # fast atomics (since 2016)
endif() endif()
endif() endif()
endif() endif()