From b3cc58b68132daea253a71ea9550ce0f3186e57a Mon Sep 17 00:00:00 2001 From: Brian Barrett Date: Fri, 16 Sep 2005 17:44:18 +0000 Subject: [PATCH] * use rd instead of mov because for some odd reason GAS doesn't like moving the tick register to another register, but is fine with rd. * properly mask out the upper 32 bits of the register containing the lower 32 bits so that the or with the upper 32bits actually works properly. Hopefully, gcc will optimize this into code that doesn't suck so much (it's much easier to deal with when you get to control the argument registers...) This commit was SVN r7410. --- opal/include/sys/sparcv9/timer.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/opal/include/sys/sparcv9/timer.h b/opal/include/sys/sparcv9/timer.h index 8d416f30b5..8c03cf4d3c 100644 --- a/opal/include/sys/sparcv9/timer.h +++ b/opal/include/sys/sparcv9/timer.h @@ -29,7 +29,7 @@ opal_sys_timer_get_cycles(void) { opal_timer_t ret; - __asm__ __volatile__("mov %%tick, %0" : "=r"(ret)); + __asm__ __volatile__("rd %%tick, %0" : "=r"(ret)); return ret; } @@ -42,12 +42,12 @@ opal_sys_timer_get_cycles(void) opal_timer_t ret; int a, b; - __asm__ __volatile__("mov %%tick, %0 \n" + __asm__ __volatile__("rd %%tick, %0 \n" "srlx %0, 32, %1 " : "=r"(a), "=r"(b) ); - ret = a | (((opal_timer_t) b) << 32); + ret = (0x00000000FFFFFFFF & a) | (((opal_timer_t) b) << 32); return ret; }