Blob Blame Raw
diff -up ParaView-v5.0.0-RC3-source/CMake/pv-forward.c.in.non_x86 ParaView-v5.0.0-RC3-source/CMake/pv-forward.c.in
--- ParaView-v5.0.0-RC3-source/CMake/pv-forward.c.in.non_x86	2015-12-22 18:14:02.000000000 -0700
+++ ParaView-v5.0.0-RC3-source/CMake/pv-forward.c.in	2016-01-05 19:33:50.185166825 -0700
@@ -72,136 +72,6 @@ static const int CPU_FEATURE_BIT_BMI1
 static const int CPU_FEATURE_BIT_AVX2   = 1 << 5;
 static const int CPU_FEATURE_BIT_BMI2   = 1 << 8;
 
-#if defined(__i386__) && defined(__PIC__)
-void __cpuid(int out[4], int op)
-{
-  asm volatile ("xchg{l}\t{%%}ebx, %1\n\t"
-                "cpuid\n\t"
-                "xchg{l}\t{%%}ebx, %1\n\t"
-                : "=a"(out[0]), "=r"(out[1]), "=c"(out[2]), "=d"(out[3])
-                : "0"(op));
-}
-void __cpuid_count(int out[4], int op1, int op2)
-{
-  asm volatile ("xchg{l}\t{%%}ebx, %1\n\t"
-                "cpuid\n\t"
-                "xchg{l}\t{%%}ebx, %1\n\t"
-                : "=a" (out[0]), "=r" (out[1]), "=c" (out[2]), "=d" (out[3])
-                : "0" (op1), "2" (op2));
-}
-#else
-void __cpuid(int out[4], int op)
-{
-  asm volatile("cpuid" : "=a"(out[0]), "=b"(out[1]), "=c"(out[2]), "=d"(out[3])
-               : "a"(op));
-}
-void __cpuid_count(int out[4], int op1, int op2)
-{
-  asm volatile("cpuid" : "=a"(out[0]), "=b"(out[1]), "=c"(out[2]), "=d"(out[3])
-               : "a"(op1), "c"(op2));
-}
-#endif
-
-int check_xcr0_ymm()
-{
-  int xcr0 = 0;
-#if defined(__WIN32__)
-
-#if defined(__INTEL_COMPILER)
-  xcr0 = (int)_xgetbv(0);
-#elif (defined(_MSC_VER) && (_MSC_FULL_VER >= 160040219)) // min VS2010 SP1 compiler is required
-  xcr0 = (int)_xgetbv(0);
-#else
-//#pragma message("WARNING: AVX not supported by your compiler.");
-  xcr0 = 0;
-#endif
-
-#else
-
-#if defined(__INTEL_COMPILER)
-  __asm__("xgetbv" : "=a" (xcr0) : "c" (0) : "%edx");
-#elif ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) && (!defined(__MACOSX__) || defined(__TARGET_AVX__) || defined(__TARGET_AVX2__))
-  __asm__("xgetbv" : "=a" (xcr0) : "c" (0) : "%edx");
-#elif ((__clang_major__ > 3) || (__clang_major__ == 3 && __clang_minor__ >= 1))
-  __asm__("xgetbv" : "=a" (xcr0) : "c" (0) : "%edx");
-#else
-//#pragma message("WARNING: AVX not supported by your compiler.")
-  xcr0 = 0;
-#endif
-
-#endif
-
-  return  ((xcr0 & 6) == 6); /* checking if xmm and ymm state are enabled in XCR0 */
-}
-
-int get_cpu_features()
-{
-  int info[4] = { 0 };
-  __cpuid(info, 0x00000000);
-  unsigned nIds = info[0];
-  __cpuid(info, 0x80000000);
-  unsigned nExIds = info[0];
-
-  int info1[4] = { 0 };
-  int info7[4] = { 0 };
-  int infoe1[4] = { 0 };
-  if (nIds >= 1) __cpuid(info1, 0x00000001);
-#if WIN32
-#if _MSC_VER && (_MSC_FULL_VER < 160040219)
-    if (nIds >= 7) __cpuidex(info7, 0x00000007, 0);
-#endif
-#else
-  if (nIds >= 7) __cpuid_count(info7, 0x00000007, 0);
-#endif
-  if (nExIds >= 0x80000001) __cpuid(infoe1, 0x80000001);
-
-  int has_ymm = 0;
-  if (info1[2] & CPU_FEATURE_BIT_OXSAVE)
-    has_ymm = check_xcr0_ymm();
-
-  int cpu_features = 0;
-  if (info1[3] & CPU_FEATURE_BIT_SSE)               cpu_features |= CPU_FEATURE_SSE;
-  if (info1[3] & CPU_FEATURE_BIT_SSE2)              cpu_features |= CPU_FEATURE_SSE2;
-  if (info1[2] & CPU_FEATURE_BIT_SSE3)              cpu_features |= CPU_FEATURE_SSE3;
-  if (info1[2] & CPU_FEATURE_BIT_SSSE3)             cpu_features |= CPU_FEATURE_SSSE3;
-  if (info1[2] & CPU_FEATURE_BIT_SSE4_1)            cpu_features |= CPU_FEATURE_SSE41;
-  if (info1[2] & CPU_FEATURE_BIT_SSE4_2)            cpu_features |= CPU_FEATURE_SSE42;
-  if (info1[2] & CPU_FEATURE_BIT_POPCNT)            cpu_features |= CPU_FEATURE_POPCNT;
-  if (has_ymm && (info1[2] & CPU_FEATURE_BIT_AVX))  cpu_features |= CPU_FEATURE_AVX;
-  if (info1[2] & CPU_FEATURE_BIT_F16C)              cpu_features |= CPU_FEATURE_F16C;
-  if (info1[2] & CPU_FEATURE_BIT_RDRAND)            cpu_features |= CPU_FEATURE_RDRAND;
-  if (has_ymm && (info7[1] & CPU_FEATURE_BIT_AVX2)) cpu_features |= CPU_FEATURE_AVX2;
-  if (has_ymm && (info1[2] & CPU_FEATURE_BIT_FMA3)) cpu_features |= CPU_FEATURE_FMA3;
-  if (infoe1[2] & CPU_FEATURE_BIT_LZCNT)            cpu_features |= CPU_FEATURE_LZCNT;
-  if (info7[1] & CPU_FEATURE_BIT_BMI1)              cpu_features |= CPU_FEATURE_BMI1;
-  if (info7[1] & CPU_FEATURE_BIT_BMI2)              cpu_features |= CPU_FEATURE_BMI2;
-
-#if defined(__MIC__)
-  cpu_features |= CPU_FEATURE_KNC;
-#endif
-  return cpu_features;
-}
-
-int avx_support_level()
-{
-  int cpu_features = get_cpu_features();
-  if (cpu_features & CPU_FEATURE_AVX2)
-    return 2;
-  if (cpu_features & CPU_FEATURE_AVX)
-    return 1;
-  return 0;
-}
-
-const char *determine_mesa_version()
-{
-  switch (avx_support_level())
-    {
-    case 2: return "mesa-swr-avx2";
-    case 1: return "mesa-swr-avx";
-    }
-  return "mesa-llvm";
-}
-
 int get_driver_cache_user_path(char *driver_cache_path)
 {
   const char *home = getenv("HOME");
@@ -318,12 +188,6 @@ int main(int argc, char** argv)
       *newline = '\0';
     }
 
-  // If config contains "mesa", determine which mesa to use.
-  if (strlen(driver_choice) && !strcmp(driver_choice, "mesa"))
-    {
-    strncpy(driver_choice, determine_mesa_version(), MAX_DRIVER_CHOICE);
-    }
-
   // Check for single-run driver specification; forward all other args
   for (; i < argc; ++i)
     {
@@ -331,10 +195,6 @@ int main(int argc, char** argv)
       {
       driver_choice[0] = '\0';
       }
-    else if (strcmp(argv[i], "--mesa") == 0)
-      {
-      strncpy(driver_choice, determine_mesa_version(), MAX_DRIVER_CHOICE);
-      }
     else if (strcmp(argv[i], "--mesa-llvm") == 0      ||
              strcmp(argv[i], "--mesa-swr-avx") == 0   ||
              strcmp(argv[i], "--mesa-swr-avx2") == 0)