util: skip AltiVec detection if built with -maltivec
authorJan Beich <jbeich@FreeBSD.org>
Mon, 16 Sep 2019 11:26:24 +0000 (11:26 +0000)
committerMatt Turner <mattst88@gmail.com>
Wed, 9 Oct 2019 19:55:11 +0000 (12:55 -0700)
Helps platforms where runtime detection isn't implemented.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Jan Beich <jbeich@FreeBSD.org>
src/util/u_cpu_detect.c

index 19b21b0aa44a98dbbe24ad489395cf0c9da06a38..ae553d887010c0f3d5b09ba4022a23c4e54261cd 100644 (file)
@@ -117,7 +117,15 @@ sigill_handler(int sig)
 static void
 check_os_altivec_support(void)
 {
-#if defined(PIPE_OS_APPLE)
+#if defined(__ALTIVEC__)
+   util_cpu_caps.has_altivec = 1;
+#endif
+#if defined(__VSX__)
+   util_cpu_caps.has_vsx = 1;
+#endif
+#if defined(__ALTIVEC__) && defined(__VSX__)
+/* Do nothing */
+#elif defined(PIPE_OS_APPLE)
    int sels[2] = {CTL_HW, HW_VECTORUNIT};
    int has_vu = 0;
    int len = sizeof (has_vu);