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) ...@@ -4740,7 +4740,7 @@ pac_cv_posix_clock_realtime=no)
pac_cv_linux86_cycle,[ pac_cv_linux86_cycle,[
AC_TRY_COMPILE(,[ AC_TRY_COMPILE(,[
long long var, *var_ptr=&var; 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, ],pac_cv_linux86_cycle=rdtscp,
AC_TRY_COMPILE(,[ AC_TRY_COMPILE(,[
long long var, *var_ptr=&var; long long var, *var_ptr=&var;
......
...@@ -135,7 +135,7 @@ dnl gcc checking ...@@ -135,7 +135,7 @@ dnl gcc checking
pac_cv_linux86_cycle,[ pac_cv_linux86_cycle,[
AC_TRY_COMPILE(,[ AC_TRY_COMPILE(,[
long long var, *var_ptr=&var; 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, ],pac_cv_linux86_cycle=rdtscp,
AC_TRY_COMPILE(,[ AC_TRY_COMPILE(,[
long long var, *var_ptr=&var; long long var, *var_ptr=&var;
......
...@@ -18,7 +18,8 @@ ...@@ -18,7 +18,8 @@
the rdtscp instruction which is synchronizing, we use this when we the rdtscp instruction which is synchronizing, we use this when we
can. */ can. */
#ifdef GCC_X86_CYCLE_RDTSCP #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) #elif defined(GCC_X86_CYCLE_CPUID_RDTSC)
/* Here we have to save the ebx register for when the compiler is /* Here we have to save the ebx register for when the compiler is
generating position independent code (e.g., when it's generating generating position independent code (e.g., when it's generating
......
...@@ -176,7 +176,7 @@ dnl gcc checking ...@@ -176,7 +176,7 @@ dnl gcc checking
pac_cv_linux86_cycle,[ pac_cv_linux86_cycle,[
AC_TRY_COMPILE(,[ AC_TRY_COMPILE(,[
long long var, *var_ptr=&var; 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, ],pac_cv_linux86_cycle=rdtscp,
AC_TRY_COMPILE(,[ AC_TRY_COMPILE(,[
long long var, *var_ptr=&var; long long var, *var_ptr=&var;
......
...@@ -30,7 +30,8 @@ ...@@ -30,7 +30,8 @@
the rdtscp instruction which is synchronizing, we use this when we the rdtscp instruction which is synchronizing, we use this when we
can. */ can. */
#ifdef GCC_X86_CYCLE_RDTSCP #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) #elif defined(GCC_X86_CYCLE_CPUID_RDTSC)
/* Here we have to save the ebx register for when the compiler is /* Here we have to save the ebx register for when the compiler is
generating position independent code (e.g., when it's generating 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