summaryrefslogtreecommitdiffstats
path: root/unix/configure.in
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-05-02 21:39:10 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-05-02 21:39:10 (GMT)
commitb01b765d7b57559048e606b7a01156a807b26b9c (patch)
tree8835c59d6164b82f15ea847bacc04e7a074b666c /unix/configure.in
parentfc2fcb8cf98f705a260551269c44f3c2ea80bc6c (diff)
parent99557b6c57a524f31c81cde6d39cc2a5e51983f3 (diff)
downloadtcl-b01b765d7b57559048e606b7a01156a807b26b9c.zip
tcl-b01b765d7b57559048e606b7a01156a807b26b9c.tar.gz
tcl-b01b765d7b57559048e606b7a01156a807b26b9c.tar.bz2
Better detection and implementation for cpuid instruction on Intel-derived processors, both 32-bit and 64-bit
Diffstat (limited to 'unix/configure.in')
-rw-r--r--unix/configure.in12
1 files changed, 8 insertions, 4 deletions
diff --git a/unix/configure.in b/unix/configure.in
index c04c735..869fbaa 100644
--- a/unix/configure.in
+++ b/unix/configure.in
@@ -571,12 +571,16 @@ AC_MSG_RESULT([$tcl_ok])
AC_CACHE_CHECK([whether the cpuid instruction is usable], tcl_cv_cpuid, [
AC_TRY_LINK(, [
- int index,ax,bx,cx,dx;
- __asm__ __volatile__ ("cpuid":\
- "=a" (ax), "=b" (bx), "=c" (cx), "=d" (dx) : "a" (index));
+ int index,regsPtr[4];
+ __asm__ __volatile__("mov %%ebx, %%edi \n\t"
+ "cpuid \n\t"
+ "mov %%ebx, %%esi \n\t"
+ "mov %%edi, %%ebx \n\t"
+ : "=a"(regsPtr[0]), "=S"(regsPtr[1]), "=c"(regsPtr[2]), "=d"(regsPtr[3])
+ : "a"(index));
], tcl_cv_cpuid=yes, tcl_cv_cpuid=no)])
if test $tcl_cv_cpuid = yes; then
- AC_DEFINE(HAVE_CPUID)
+ AC_DEFINE(HAVE_CPUID, 1, [Is the cpuid instruction usable?])
fi
#--------------------------------------------------------------------