[mpich] MPICH primary repository branch, master, updated. v3.2-446-g8d23c24
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "MPICH primary repository". The branch, master has been updated via 8d23c24b27d5e6e4bee8a31fe511befed7ba6501 (commit) from d17a96a5c1cde4d2051000ebf4e059274cbb4c04 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://git.mpich.org/mpich.git/commitdiff/8d23c24b27d5e6e4bee8a31fe511befed7... commit 8d23c24b27d5e6e4bee8a31fe511befed7ba6501 Author: Charles J Archer <[email protected]> Date: Wed Jan 27 09:32:34 2016 -0800 mpl/timer: Refactor x86 cycle timer Clean up some issues the x86 cycle timer * remove push instructions causing clobber of parameter variables * actually use rdtscp as the #define MPL_LINUX86_CYCLE_RDTSCP implies * 32-bit can use =A constraint, while 64-bit must use split =a =d Fixes csr/mpich-opa#421 Signed-off-by: Halim Amer <[email protected]> diff --git a/src/mpl/include/mpl_timer_linux86_cycle.h b/src/mpl/include/mpl_timer_linux86_cycle.h index 30420d9..f43f5f2 100644 --- a/src/mpl/include/mpl_timer_linux86_cycle.h +++ b/src/mpl/include/mpl_timer_linux86_cycle.h @@ -16,23 +16,21 @@ static inline int MPL_wtime(MPL_time_t *timeval) the rdtscp instruction which is synchronizing, we use this when we can. */ #ifdef MPL_LINUX86_CYCLE_RDTSCP - __asm__ __volatile__("push %%rbx ; cpuid ; rdtsc ; pop %%rbx ; shl $32, %%rdx; or %%rdx, %%rax" : "=a" (timeval) : : "ecx", "rdx"); + unsigned long long lower,upper,extra; + __asm__ __volatile__ ("rdtscp\n" : "=a" (lower), "=d" (upper), "=c" (extra)); + *timeval = (upper << 32) + lower; #elif defined(MPL_LINUX86_CYCLE_CPUID_RDTSC64) -/* Here we have to save the rbx register for when the compiler is - generating position independent code (e.g., when it's generating - shared libraries) */ - __asm__ __volatile__("push %%rbx ; cpuid ; rdtsc ; pop %%rbx" : "=A" (timeval) : : "ecx"); + unsigned long long lower, upper; + __asm__ __volatile__("cpuid ; rdtsc" : "=a" (lower), "=d" (upper) : : "ebx", "ecx"); + *timeval = (upper << 32) + lower; -#elif defined(MPL_LINUX86_CYCLE_CPUID_RDTSC32) -/* Here we have to save the ebx register for when the compiler is - generating position independent code (e.g., when it's generating - shared libraries) */ - __asm__ __volatile__("push %%ebx ; cpuid ; rdtsc ; pop %%ebx" : "=A" (timeval) : : "ecx"); +#elif defined(MPL_LINUX86_CYCLE_CPUID_RDTSC32) + __asm__ __volatile__("cpuid ; rdtsc" : "=A" (*timeval) : : "ebx", "ecx"); #elif defined(MPL_LINUX86_CYCLE_RDTSC) /* The configure test using cpuid must have failed, try just rdtsc by itself */ - __asm__ __volatile__("rdtsc" : "=A" (timeval)); + __asm__ __volatile__("rdtsc" : "=A" (*timeval)); #else #error Dont know which Linux timer to use ----------------------------------------------------------------------- Summary of changes: src/mpl/include/mpl_timer_linux86_cycle.h | 20 +++++++++----------- 1 files changed, 9 insertions(+), 11 deletions(-) hooks/post-receive -- MPICH primary repository
participants (1)
-
noreply@mpich.org