gcc using clobbered register as input with inline assembly

Timur Tabi ttabi@interactivesi.com
Mon Mar 26 10:38:00 GMT 2001


** Reply to message from "Zack Weinberg" <zackw@stanford.edu> on Mon, 26 Mar
2001 10:20:21 -0800


> inline void
> BeginCpuTick(u64 *const pTime)
> {
>    register u64 xtime;
>    asm volatile ("rdtsc" : "=A" (xtime));
>    *pTime = xtime;
> }

Could I replace the above with:

inline void
BeginCpuTick(u64 *const pTime)
{
   register u64 xtime;
   asm volatile ("rdtsc" : "=A" (*ptime));
}


-- 
Timur Tabi - ttabi@interactivesi.com
Interactive Silicon - http://www.interactivesi.com

When replying to a mailing-list message, please direct the reply to the mailing list only.  Don't send another copy to me.



More information about the Gcc-bugs mailing list