Welcome to Intel® Software Network Quick Login | Join | Help |
Search in Intel® Software Network Forums
in Go

Time-stamp counter on IA-64

Last post 07-13-2008, 11:44 AM by tim18. 5 replies.
Sort Posts: Previous Next
 06-27-2008, 5:17 PM 30257823  

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

 
 06-28-2008, 10:11 AM 30257836 in reply to 30257823  

Re: Time-stamp counter on IA-64

        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.
 
 06-30-2008, 1:29 PM 30257932 in reply to 30257836  

Re: Time-stamp counter on IA-64

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

 

 
 06-30-2008, 1:54 PM 30257935 in reply to 30257932  

Re: Time-stamp counter on IA-64

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

 
 07-13-2008, 11:35 AM 30258997 in reply to 30257932  

Re: Time-stamp counter on IA-64

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/iometer-2008-06-22-rc1/src/IOTime.cpp

You didn't say in the original post which compiler or OS you wanted to use, nor have I tried this on Windows.
 
 07-13-2008, 11:44 AM 30258998 in reply to 30257932  

Re: Time-stamp counter on IA-64

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/iometer-2008-06-22-rc1/src/IOTime.cpp
 
View as RSS news feed in XML

Shortcuts


Tags For This Post

...

Community Tags

...