diff options
author | Michael Schmidt <michael.schmidt@mevis.fraunhofer.de> | 2013-03-19 14:00:42 +0100 |
---|---|---|
committer | Michael Schmidt <michael.schmidt@mevis.fraunhofer.de> | 2013-03-19 14:00:42 +0100 |
commit | 0d5a4180484b967f0fd2b233039def06ad176b5b (patch) | |
tree | cd46d8ee68329a95b7d3d09dda8d93e6e9a2bdef /Eigen | |
parent | d6d638c751f2155b103678151a7028b4dbd435f5 (diff) |
Fix bug #566: rbx register has to be saved when calling cpuid on x84_64 with -fPIC and medium or large code models.
Diffstat (limited to 'Eigen')
-rw-r--r-- | Eigen/src/Core/util/Memory.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Eigen/src/Core/util/Memory.h b/Eigen/src/Core/util/Memory.h index 2a1a20fac..b26afda64 100644 --- a/Eigen/src/Core/util/Memory.h +++ b/Eigen/src/Core/util/Memory.h @@ -752,10 +752,14 @@ public: // 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)); +# elif defined(__PIC__) && defined(__x86_64__) + // Case for x64 with PIC +# define EIGEN_CPUID(abcd,func,id) \ + __asm__ __volatile__ ("xchg{q}\t{%%}rbx, %q1; cpuid; xchg{q}\t{%%}rbx, %q1": "=a" (abcd[0]), "=&r" (abcd[1]), "=c" (abcd[2]), "=d" (abcd[3]) : "0" (func), "2" (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) ); + __asm__ __volatile__ ("cpuid": "=a" (abcd[0]), "=b" (abcd[1]), "=c" (abcd[2]), "=d" (abcd[3]) : "0" (func), "2" (id) ); # endif # elif defined(_MSC_VER) # if (_MSC_VER > 1500) && ( defined(_M_IX86) || defined(_M_X64) ) |