Time-stamp counter on IA-64

Time-stamp counter on IA-64

Hi,

There is rdtsc to read processor time-stamp counter on x64. Could someone tell me how to read time-stamp counter on IA-64 platform.

Thanks,

Victor

6 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
        unsigned long result;
/* gcc-IA64 version */
__asm__ __volatile__("mov %0=ar.itc" : "=r"(result) :: "memory");
while (__builtin_expect ((int) result == -1, 0))
__asm__ __volatile__("mov %0=ar.itc" : "=r"(result) ::
"memory");
return result;

Not tested on any current IA-64 platform.
If you use Microsoft or Intel C++, simply use the __rdtsc() built-in.

There is no guarantee of consistent results among nodes of a NUMA platform.

I used Microsoft Visual Studio .NET 2003 compiler and linker to build a UEFI driver. The link failed because of

unresolved external symbol .__rdtsc referenced in function ....

I have searched on web on rdtsc support with IA64 platform before I submitted my original request. What I have found was that there is a AR44 register on IA64 to replace rdtsc call to read the time-stamp count. Is that the case? If so, could you give me a sample code to access that register.

Thanks a lot,

Victor

Hi,

I forgot to mention, I have a #pragma statement

#pragma intrinsic(__rdtsc)

and my calling function is

ts_expire = __rdtsc() + (u64_t)(cnt) * cycle_per_us;

and this leads to the unresolved external symbol .__rdtsc.

Thanks,

Victor

You would find MSVC equivalents of the gcc code I posted, if you did a web search. Did they fail you? e.g.
http://www.sfr-fresh.com/unix/privat/iometer-2008-06-22-rc1.tgz:a/iomete...

You didn't say in the original post which compiler or OS you wanted to use, nor have I tried this on Windows.

I don't have a Windows installation on IA64; Microsoft announced they would no longer support technical applications on IA64 when AMD64 development began. Did you try suggestions on the web, such as
http://www.sfr-fresh.com/unix/privat/iometer-2008-06-22-rc1.tgz:a/iomete...

Login to leave a comment.