diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-05-02 21:48:34 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-05-02 21:48:34 (GMT) |
| commit | dfdef9b81ca277bd758e8b122c23f83f664d55a3 (patch) | |
| tree | 42c9366d016c3db0ca8640dc6d9bfd3de1dc0b47 /unix/configure.in | |
| parent | ac81ebd41a86f284eeedcf6518b62f0b1d24f52d (diff) | |
| parent | a7601d1ea7a091b57a4caec5e64ec43b3a660724 (diff) | |
| download | tcl-dfdef9b81ca277bd758e8b122c23f83f664d55a3.zip tcl-dfdef9b81ca277bd758e8b122c23f83f664d55a3.tar.gz tcl-dfdef9b81ca277bd758e8b122c23f83f664d55a3.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.in | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/unix/configure.in b/unix/configure.in index b2cf87a..aea5ee5 100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -731,12 +731,16 @@ fi 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 #-------------------------------------------------------------------- |
