summaryrefslogtreecommitdiffstats
path: root/src/mesa/x86
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2014-05-02 12:10:17 -0700
committerMatt Turner <mattst88@gmail.com>2014-05-22 10:17:16 -0700
commit8b9302f2b4b0536abb91cb73682ec13640fe9eaf (patch)
tree6e872c26b8ac812217e4488db7d89a59f93108c3 /src/mesa/x86
parent1a31657a9b14c77fa6eb4517629006d2e9ac2ad4 (diff)
downloadexternal_mesa3d-8b9302f2b4b0536abb91cb73682ec13640fe9eaf.zip
external_mesa3d-8b9302f2b4b0536abb91cb73682ec13640fe9eaf.tar.gz
external_mesa3d-8b9302f2b4b0536abb91cb73682ec13640fe9eaf.tar.bz2
mesa/x86: Support SSE 4.1 detection on x86-64.
Uses the cpuid.h header provided by gcc and clang. Other platforms are encouraged to switch.
Diffstat (limited to 'src/mesa/x86')
-rw-r--r--src/mesa/x86/common_x86.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mesa/x86/common_x86.c b/src/mesa/x86/common_x86.c
index 3c1adc9..a91f07e 100644
--- a/src/mesa/x86/common_x86.c
+++ b/src/mesa/x86/common_x86.c
@@ -47,6 +47,9 @@
#include <sys/sysctl.h>
#include <machine/cpu.h>
#endif
+#if defined(__x86_64__) && !defined(_MSC_VER)
+#include <cpuid.h>
+#endif
#include "main/imports.h"
#include "common_x86_asm.h"
@@ -330,6 +333,14 @@ _mesa_get_x86_features(void)
}
#endif
+#elif defined(__x86_64__) && !defined(_MSC_VER)
+ unsigned int uninitialized_var(eax), uninitialized_var(ebx),
+ uninitialized_var(ecx), uninitialized_var(edx);
+
+ /* Always available on x86-64. */
+ _mesa_x86_cpu_features |= X86_FEATURE_XMM | X86_FEATURE_XMM2;
+
+ __get_cpuid(1, &eax, &ebx, &ecx, &edx);
#endif /* USE_X86_ASM */
(void) detection_debug;