tune distro mode
authorAndreas Beckmann <anbe@debian.org>
Mon, 4 Feb 2019 23:39:59 +0000 (23:39 +0000)
committerAndreas Beckmann <anbe@debian.org>
Mon, 4 Feb 2019 23:39:59 +0000 (23:39 +0000)
Gbp-Pq: Name distro.patch

CMakeLists.txt
lib/kernel/host/CMakeLists.txt

index 5ce911d9e9616a9d1316a5a63a5cd53f2480b87f..04a83a12127af70333e535edd4c2820804792e8f 100644 (file)
@@ -1023,6 +1023,9 @@ endif()
 set(KERNELLIB_HOST_DISTRO_VARIANTS 0)
 if(KERNELLIB_HOST_CPU_VARIANTS STREQUAL "distro")
   if(X86_64 OR I386)
+    if("${LLC_HOST_CPU}" STREQUAL "GENERIC")
+      set(HOST_CPU_FORCED 0 CACHE INTERNAL "CPU is forced by user")
+    endif()
     if(HOST_CPU_FORCED)
       message(FATAL_ERROR "Cannot build with CPU autodetection distro variants build, and enforce LLC_HOST_CPU at the same time. Please pick one")
     endif()
@@ -1030,6 +1033,9 @@ if(KERNELLIB_HOST_CPU_VARIANTS STREQUAL "distro")
     if(NOT LLVM_OLDER_THAN_3_9)
       list(APPEND KERNELLIB_HOST_CPU_VARIANTS avx512)
     endif()
+    if("${LLC_HOST_CPU}" STREQUAL "GENERIC")
+      list(INSERT KERNELLIB_HOST_CPU_VARIANTS 0 ${LLC_HOST_CPU})
+    endif()
   else()
     message(FATAL_ERROR "Don't know what CPU variants to use for kernel library on this platform.")
   endif()
index ffb9e63b31addc2ec693b227e4b215c011ce091c..0bcb46788a7dd3bd2fbf4783d6715da3291dd094 100644 (file)
@@ -69,8 +69,8 @@ separate_arguments(DEVICE_CL_FLAGS)
 function(x86_distro_variant_to_flags VARIANT OUT_LLC_FLAGS OUT_CLANG_FLAGS)
 
   if("${VARIANT}" STREQUAL "sse2")
-    set(CLANG_F "${CLANG_MARCH_FLAG}athlon64")
-    set(LLC_F "-mcpu=athlon64")
+    set(CLANG_F "${CLANG_MARCH_FLAG}x86-64")
+    set(LLC_F "-mcpu=x86-64")
 
   elseif("${VARIANT}" STREQUAL "ssse3")
     set(CLANG_F "${CLANG_MARCH_FLAG}core2")