This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to implement "unsigned long long __rdtsc ()" for x86?




Sent from my iPhone

On Jan 16, 2009, at 9:23 AM, "H.J. Lu" <hjl.tools@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.


Thanks,
Andrew Pinski



I am thinking about adding some fake readonly registers. Will
it work?

Thanks.


-- H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]