summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorJan Beich <[email protected]>2019-09-16 11:26:24 +0000
committerMatt Turner <[email protected]>2019-10-09 12:55:11 -0700
commit8d2dd1f4f37277092bfb214fae36025c6563bb87 (patch)
tree4898b2d082e570dbf7e5e29839e885ff79e3e247 /src/util
parent601a098338a5c276a538d55bde516624aff99a49 (diff)
util: skip AltiVec detection if built with -maltivec
Helps platforms where runtime detection isn't implemented. Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Jan Beich <[email protected]>
Diffstat (limited to 'src/util')
-rw-r--r--src/util/u_cpu_detect.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/util/u_cpu_detect.c b/src/util/u_cpu_detect.c
index 19b21b0aa44..ae553d88701 100644
--- a/src/util/u_cpu_detect.c
+++ b/src/util/u_cpu_detect.c
@@ -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);