xserver: Branch 'server-1.2-branch'
Alan Coopersmith
alanc at kemper.freedesktop.org
Thu Oct 19 04:18:45 EEST 2006
configure.ac | 3 ++-
fb/fbpict.c | 25 +++++++++++++++++++++++--
include/dix-config.h.in | 3 +++
3 files changed, 28 insertions(+), 3 deletions(-)
New commits:
diff-tree f6920869d9930f0ac53916cad3a69f4b97aa655d (from a935222f93562afd72c399a3dba401ba03aa9b4b)
Author: Alan Coopersmith <alan.coopersmith at sun.com>
Date: Wed Oct 18 18:11:06 2006 -0700
Use getisax() instead of asm code to determine available x86 ISA extensions on Solaris
(cherry picked from 357b37b3826fa6e9878c0bd895164259c2ed3c0d commit)
diff --git a/configure.ac b/configure.ac
index 4ee1b85..2fff524 100644
--- a/configure.ac
+++ b/configure.ac
@@ -82,7 +82,8 @@ AC_TYPE_PID_T
dnl Checks for library functions.
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([geteuid getuid link memmove memset mkstemp strchr strrchr \
- strtol getopt getopt_long vsnprintf walkcontext backtrace])
+ strtol getopt getopt_long vsnprintf walkcontext backtrace \
+ getisax])
AC_FUNC_ALLOCA
dnl Old HAS_* names used in os/*.c.
AC_CHECK_FUNC([getdtablesize],
diff --git a/fb/fbpict.c b/fb/fbpict.c
index c208643..ccd722a 100644
--- a/fb/fbpict.c
+++ b/fb/fbpict.c
@@ -1396,6 +1396,10 @@ fbPictureInit (ScreenPtr pScreen, PictFo
*/
#if !defined(__amd64__) && !defined(__x86_64__)
+#ifdef HAVE_GETISAX
+#include <sys/auxv.h>
+#endif
+
enum CPUFeatures {
NoFeatures = 0,
MMX = 0x1,
@@ -1406,7 +1410,23 @@ enum CPUFeatures {
};
static unsigned int detectCPUFeatures(void) {
+ unsigned int features = 0;
unsigned int result;
+
+#ifdef HAVE_GETISAX
+ if (getisax(&result, 1)) {
+ if (result & AV_386_CMOV)
+ features |= CMOV;
+ if (result & AV_386_MMX)
+ features |= MMX;
+ if (result & AV_386_AMD_MMX)
+ features |= MMX_Extensions;
+ if (result & AV_386_SSE)
+ features |= SSE;
+ if (result & AV_386_SSE2)
+ features |= SSE2;
+ }
+#else
char vendor[13];
vendor[0] = 0;
vendor[12] = 0;
@@ -1415,7 +1435,8 @@ static unsigned int detectCPUFeatures(vo
* %esp here. We can't declare either one as clobbered
* since they are special registers (%ebx is the "PIC
* register" holding an offset to global data, %esp the
- * stack pointer), so we need to make sure they have their+ * original values when we access the output operands.
+ * stack pointer), so we need to make sure they have their
+ * original values when we access the output operands.
*/
__asm__ ("pushf\n"
"pop %%eax\n"
@@ -1451,7 +1472,6 @@ static unsigned int detectCPUFeatures(vo
: "%eax", "%ecx", "%edx"
);
- unsigned int features = 0;
if (result) {
/* result now contains the standard feature bits */
if (result & (1 << 15))
@@ -1485,6 +1505,7 @@ static unsigned int detectCPUFeatures(vo
features |= MMX_Extensions;
}
}
+#endif /* HAVE_GETISAX */
return features;
}
diff --git a/include/dix-config.h.in b/include/dix-config.h.in
index 571a867..65c42e6 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
@@ -112,6 +112,9 @@
/* Define to 1 if you have the `geteuid' function. */
#undef HAVE_GETEUID
+/* Define to 1 if you have the `getisax' function. */
+#undef HAVE_GETISAX
+
/* Define to 1 if you have the `getopt' function. */
#undef HAVE_GETOPT
More information about the xorg-commit
mailing list