Commit 806c4c19 authored by buntinas's avatar buntinas
Browse files

fixed rdtscp assembly

parent 4263e656
......@@ -4740,7 +4740,7 @@ pac_cv_posix_clock_realtime=no)
pac_cv_linux86_cycle,[
AC_TRY_COMPILE(,[
long long var, *var_ptr=&var;
__asm__ __volatile__("rdtscp" : "=A" (*var_ptr));
__asm__ __volatile__("rdtscp; shl $32, %%rdx; or %%rdx, %%rax" : "=a" (*var_ptr) : : "ecx", "rdx");
],pac_cv_linux86_cycle=rdtscp,
AC_TRY_COMPILE(,[
long long var, *var_ptr=&var;
......
......@@ -135,7 +135,7 @@ dnl gcc checking
pac_cv_linux86_cycle,[
AC_TRY_COMPILE(,[
long long var, *var_ptr=&var;
__asm__ __volatile__("rdtscp" : "=A" (*var_ptr));
__asm__ __volatile__("rdtscp; shl $32, %%rdx; or %%rdx, %%rax" : "=a" (*var_ptr) : : "ecx", "rdx");
],pac_cv_linux86_cycle=rdtscp,
AC_TRY_COMPILE(,[
long long var, *var_ptr=&var;
......
......@@ -18,7 +18,8 @@
the rdtscp instruction which is synchronizing, we use this when we
can. */
#ifdef GCC_X86_CYCLE_RDTSCP
#define MPID_CPU_TICK(var_ptr) __asm__ __volatile__("rdtscp" : "=A" (*var_ptr))
#define MPID_CPU_TICK(var_ptr) \
__asm__ __volatile__("rdtscp; shl $32, %%rdx; or %%rdx, %%rax" : "=a" (*var_ptr) : : "ecx", "rdx")
#elif defined(GCC_X86_CYCLE_CPUID_RDTSC)
/* Here we have to save the ebx register for when the compiler is
generating position independent code (e.g., when it's generating
......
......@@ -176,7 +176,7 @@ dnl gcc checking
pac_cv_linux86_cycle,[
AC_TRY_COMPILE(,[
long long var, *var_ptr=&var;
__asm__ __volatile__("rdtscp" : "=A" (*var_ptr));
__asm__ __volatile__("rdtscp; shl $32, %%rdx; or %%rdx, %%rax" : "=a" (*var_ptr) : : "ecx", "rdx");
],pac_cv_linux86_cycle=rdtscp,
AC_TRY_COMPILE(,[
long long var, *var_ptr=&var;
......
......@@ -30,7 +30,8 @@
the rdtscp instruction which is synchronizing, we use this when we
can. */
#ifdef GCC_X86_CYCLE_RDTSCP
#define MPID_CPU_TICK(var_ptr) __asm__ __volatile__("rdtscp" : "=A" (*var_ptr))
#define MPID_CPU_TICK(var_ptr) \
__asm__ __volatile__("rdtscp; shl $32, %%rdx; or %%rdx, %%rax" : "=a" (*var_ptr) : : "ecx", "rdx")
#elif defined(GCC_X86_CYCLE_CPUID_RDTSC)
/* Here we have to save the ebx register for when the compiler is
generating position independent code (e.g., when it's generating
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment