On Fri, Jan 16, 2009 at 09:35:33AM -0800, Andrew Thomas Pinski wrote: > On Jan 16, 2009, at 9:23 AM, "H.J. Lu" <hjl.to...@gmail.com> wrote: > >> Hi, >> >> I am trying to implement >> >> unsigned long long __rdtsc (void); >> >> for RDTSC as an intrinsic. It is easy to do it with asm statement. >> But I am having a hard time to implement it as a gcc builtin. >> The main problem is there is no input. It is impossible to write >> a proper RTL for it. Any suggestions? > > unspec_volatile? I don't see any issues with a no input unspec_volatile > the rs6000 backend uses that already.
According to the info docs, the Alpha has __builtin_alpha_rpcc which doesn't take any inputs either, and should just call rpcc much as an rdtsc intrinsic would, so it may provide a more direct model. -Jack