]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - Vc/cmake/OptimizeForArchitecture.cmake
Vc: update to 0.7.4 release
[u/mrichter/AliRoot.git] / Vc / cmake / OptimizeForArchitecture.cmake
index 246889c4943207b05a52345742afa419d023160e..e7e6d3af02f646043f363bbfa1d6d6f653e7f813 100644 (file)
@@ -71,7 +71,9 @@ macro(AutodetectHostArchitecture)
    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")
@@ -117,13 +119,16 @@ macro(AutodetectHostArchitecture)
          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")
@@ -137,7 +142,7 @@ macro(AutodetectHostArchitecture)
 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}\"")
@@ -191,6 +196,7 @@ macro(OptimizeForArchitecture)
    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")
@@ -204,6 +210,13 @@ macro(OptimizeForArchitecture)
       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")