summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixCompat.c
diff options
context:
space:
mode:
authorseandeelywoods <seandeelywoods>2013-03-18 12:41:14 (GMT)
committerseandeelywoods <seandeelywoods>2013-03-18 12:41:14 (GMT)
commit87d0bd2b565cc904bdd135291c1baa5ff5cea4d5 (patch)
tree63b370c68febf9ed24fc630644117cf735313b40 /unix/tclUnixCompat.c
parent3faa92fe264c5671bd8dad903cb13ca5ce302781 (diff)
parent3fda4f0df6f0fdabe84372aee281ffb4ca7108e1 (diff)
downloadtcl-hypnotoad_bug_3598385.zip
tcl-hypnotoad_bug_3598385.tar.gz
tcl-hypnotoad_bug_3598385.tar.bz2
Merging in changes from trunkhypnotoad_bug_3598385
Diffstat (limited to 'unix/tclUnixCompat.c')
-rw-r--r--unix/tclUnixCompat.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/unix/tclUnixCompat.c b/unix/tclUnixCompat.c
index e201018..2a68f7f 100644
--- a/unix/tclUnixCompat.c
+++ b/unix/tclUnixCompat.c
@@ -995,12 +995,19 @@ TclWinCPUID(
/* See: <http://en.wikipedia.org/wiki/CPUID> */
#if defined(HAVE_CPUID)
- __asm__ __volatile__("mov %%ebx, %%edi \n\t" /* save %ebx */
+#if defined(__x86_64__) || defined(_M_AMD64) || defined (_M_X64)
+ __asm__ __volatile__("movq %%rbx, %%rsi \n\t" /* save %rbx */
"cpuid \n\t"
- "mov %%ebx, %%esi \n\t" /* save what cpuid just put in %ebx */
- "mov %%edi, %%ebx \n\t" /* restore the old %ebx */
+ "xchgq %%rsi, %%rbx \n\t" /* restore the old %rbx */
: "=a"(regsPtr[0]), "=S"(regsPtr[1]), "=c"(regsPtr[2]), "=d"(regsPtr[3])
- : "a"(index) : "edi");
+ : "a"(index));
+#else
+ __asm__ __volatile__("mov %%ebx, %%esi \n\t" /* save %ebx */
+ "cpuid \n\t"
+ "xchg %%esi, %%ebx \n\t" /* restore the old %ebx */
+ : "=a"(regsPtr[0]), "=S"(regsPtr[1]), "=c"(regsPtr[2]), "=d"(regsPtr[3])
+ : "a"(index));
+#endif
status = TCL_OK;
#endif
return status;