* 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.
Этот коммит содержится в:
родитель
808b2c1c53
Коммит
b3cc58b681
@ -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;
|
||||
}
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user