if(_vendor_id STREQUAL "GenuineIntel")
if(_cpu_family EQUAL 6)
# Any recent Intel CPU except NetBurst
- if(_cpu_model EQUAL 58)
+ if(_cpu_model EQUAL 62)
+ set(TARGET_ARCHITECTURE "ivy-bridge")
+ elseif(_cpu_model EQUAL 58)
set(TARGET_ARCHITECTURE "ivy-bridge")
elseif(_cpu_model EQUAL 47) # Xeon E7 4860
set(TARGET_ARCHITECTURE "westmere")
endif(_cpu_model GREATER 2)
endif(_cpu_family EQUAL 6)
elseif(_vendor_id STREQUAL "AuthenticAMD")
- if(_cpu_family EQUAL 21) # 15h
+ if(_cpu_family EQUAL 22) # 16h
+ set(TARGET_ARCHITECTURE "AMD 16h")
+ elseif(_cpu_family EQUAL 21) # 15h
if(_cpu_model LESS 2)
set(TARGET_ARCHITECTURE "bulldozer")
else()
set(TARGET_ARCHITECTURE "piledriver")
endif()
elseif(_cpu_family EQUAL 20) # 14h
+ set(TARGET_ARCHITECTURE "AMD 14h")
elseif(_cpu_family EQUAL 18) # 12h
elseif(_cpu_family EQUAL 16) # 10h
set(TARGET_ARCHITECTURE "barcelona")
endmacro()
macro(OptimizeForArchitecture)
- set(TARGET_ARCHITECTURE "none" CACHE STRING "CPU architecture to optimize for. Using an incorrect setting here can result in crashes of the resulting binary because of invalid instructions used.\nSetting the value to \"auto\" will try to optimize for the architecture where cmake is called.\nOther supported values are: \"none\", \"generic\", \"core\", \"merom\" (65nm Core2), \"penryn\" (45nm Core2), \"nehalem\", \"westmere\", \"sandy-bridge\", \"ivy-bridge\", \"atom\", \"k8\", \"k8-sse3\", \"barcelona\", \"istanbul\", \"magny-cours\", \"bulldozer\", \"interlagos\", \"piledriver\".")
+ set(TARGET_ARCHITECTURE "none" CACHE STRING "CPU architecture to optimize for. Using an incorrect setting here can result in crashes of the resulting binary because of invalid instructions used.\nSetting the value to \"auto\" will try to optimize for the architecture where cmake is called.\nOther supported values are: \"none\", \"generic\", \"core\", \"merom\" (65nm Core2), \"penryn\" (45nm Core2), \"nehalem\", \"westmere\", \"sandy-bridge\", \"ivy-bridge\", \"atom\", \"k8\", \"k8-sse3\", \"barcelona\", \"istanbul\", \"magny-cours\", \"bulldozer\", \"interlagos\", \"piledriver\", \"AMD 14h\", \"AMD 16h\".")
set(_force)
if(NOT _last_target_arch STREQUAL "${TARGET_ARCHITECTURE}")
message(STATUS "target changed from \"${_last_target_arch}\" to \"${TARGET_ARCHITECTURE}\"")
elseif(TARGET_ARCHITECTURE STREQUAL "sandy-bridge")
list(APPEND _march_flag_list "sandybridge")
list(APPEND _march_flag_list "corei7-avx")
+ list(APPEND _march_flag_list "corei7")
list(APPEND _march_flag_list "core2")
list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3" "sse4.1" "sse4.2" "avx")
elseif(TARGET_ARCHITECTURE STREQUAL "atom")
list(APPEND _march_flag_list "k8-sse3")
list(APPEND _march_flag_list "k8")
list(APPEND _available_vector_units_list "sse" "sse2" "sse3")
+ elseif(TARGET_ARCHITECTURE STREQUAL "AMD 16h")
+ list(APPEND _march_flag_list "btver2")
+ list(APPEND _march_flag_list "btver1")
+ list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3" "sse4a" "sse4.1" "sse4.2" "avx" "f16c")
+ elseif(TARGET_ARCHITECTURE STREQUAL "AMD 14h")
+ list(APPEND _march_flag_list "btver1")
+ list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3" "sse4a")
elseif(TARGET_ARCHITECTURE STREQUAL "piledriver")
list(APPEND _march_flag_list "bdver2")
list(APPEND _march_flag_list "bdver1")