diff options
| author | nijtmans@users.sourceforge.net <jan.nijtmans> | 2012-05-02 21:55:54 (GMT) |
|---|---|---|
| committer | nijtmans@users.sourceforge.net <jan.nijtmans> | 2012-05-02 21:55:54 (GMT) |
| commit | 0a452cc8cc191da3d9c7660f2c67a659ac3c3acf (patch) | |
| tree | 43d2bfa84716bb6f21c91187e06224d7cd785f18 /unix/configure.in | |
| parent | b2adfb27e707fea39dff8ddb83113c731244ae09 (diff) | |
| parent | dcf22bf22697bd75efe65dffae8f9fe350cb1fe8 (diff) | |
| download | tcl-0a452cc8cc191da3d9c7660f2c67a659ac3c3acf.zip tcl-0a452cc8cc191da3d9c7660f2c67a659ac3c3acf.tar.gz tcl-0a452cc8cc191da3d9c7660f2c67a659ac3c3acf.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 29dc027..ad82ee0 100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -755,12 +755,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 #-------------------------------------------------------------------- |
