aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Jose Luis Blanco <joseluisblancoc@gmail.com>2011-01-05 02:43:43 +0100
committerGravatar Jose Luis Blanco <joseluisblancoc@gmail.com>2011-01-05 02:43:43 +0100
commitcbfab7204fe62e41912c68f8a39f22b41a3d264d (patch)
tree310e29e08d809c755957a551052fd8c241699022
parent98f027430565fab169bee441e8c5db64b53709c7 (diff)
Update of CPUID macros to fix segfaults in amd64 code.
-rw-r--r--Eigen/src/Core/util/Memory.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/Eigen/src/Core/util/Memory.h b/Eigen/src/Core/util/Memory.h
index d7848b645..b139d1831 100644
--- a/Eigen/src/Core/util/Memory.h
+++ b/Eigen/src/Core/util/Memory.h
@@ -598,10 +598,12 @@ public:
//---------- Cache sizes ----------
#if defined(__GNUC__) && ( defined(__i386__) || defined(__x86_64__) )
-# if defined(__PIC__)
+# if defined(__PIC__) && defined(__i386__)
+ // Case for x86 with PIC
# define EIGEN_CPUID(abcd,func,id) \
__asm__ __volatile__ ("xchgl %%ebx, %%esi;cpuid; xchgl %%ebx,%%esi": "=a" (abcd[0]), "=S" (abcd[1]), "=c" (abcd[2]), "=d" (abcd[3]) : "a" (func), "c" (id));
# else
+ // Case for x86_64 or x86 w/o PIC
# define EIGEN_CPUID(abcd,func,id) \
__asm__ __volatile__ ("cpuid": "=a" (abcd[0]), "=b" (abcd[1]), "=c" (abcd[2]), "=d" (abcd[3]) : "a" (func), "c" (id) );
# endif