summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixCompat.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-02-03 17:17:47 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-02-03 17:17:47 (GMT)
commit3c3f3d4561fe16f54fc6ded233112c6040ab5e77 (patch)
tree85ae40b56e9038a7a38c1898d87851171e1174ea /unix/tclUnixCompat.c
parent1d5118fd6cf705d79ec670284492d9eff6637965 (diff)
parentb0bf6914f1e11ba4b7a127dcda5cd48f96976a33 (diff)
downloadtcl-3c3f3d4561fe16f54fc6ded233112c6040ab5e77.zip
tcl-3c3f3d4561fe16f54fc6ded233112c6040ab5e77.tar.gz
tcl-3c3f3d4561fe16f54fc6ded233112c6040ab5e77.tar.bz2
merge novem
Diffstat (limited to 'unix/tclUnixCompat.c')
-rw-r--r--unix/tclUnixCompat.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/unix/tclUnixCompat.c b/unix/tclUnixCompat.c
index f8f0080..e5929ba 100644
--- a/unix/tclUnixCompat.c
+++ b/unix/tclUnixCompat.c
@@ -993,11 +993,19 @@ TclWinCPUID(
/* See: <http://en.wikipedia.org/wiki/CPUID> */
#if defined(HAVE_CPUID)
+#if defined(__x86_64__) || defined(_M_AMD64) || defined (_M_X64)
+ __asm__ __volatile__("movq %%rbx, %%rsi \n\t" /* save %rbx */
+ "cpuid \n\t"
+ "xchgq %%rsi, %%rbx \n\t" /* restore the old %rbx */
+ : "=a"(regsPtr[0]), "=S"(regsPtr[1]), "=c"(regsPtr[2]), "=d"(regsPtr[3])
+ : "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;