- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi All.
Normally, any instructions are implemenented either in their MD or .h or .c file of config folder within GCC (gcc/config/i386 or /gcc/config/ia64). Can anyone suggest - Where and How is RDSTC instructions being implemented within this file for GCC v-4.4 or it's earlier versions?
Here, I mean to refer it's back-end or middle -end files related with Intel C++ Compiler RDTSC inst. implementation in .h, .md or .c with GCC.
I did referred RDTSC instruction in "Intel-64 & IA-32 Arch. Software Developer's Manual - Vol-2B" for understanding RDSTC inst. implementations.
~BR
MKS
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Why are you asking about gcc here?
As you appear to be stretching your definition of gcc, you might grep your kernel source, in particular the /include/asm-i386/ and /asm-x86_64/ directories. Then, check the quality of code generated by those macros in comparison with icc __rdtsc(), if that's what you're getting at.
As you appear to be stretching your definition of gcc, you might grep your kernel source, in particular the /include/asm-i386/ and /asm-x86_64/ directories. Then, check the quality of code generated by those macros in comparison with icc __rdtsc(), if that's what you're getting at.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - tim18
Why are you asking about gcc here?
As you appear to be stretching your definition of gcc, you might grep your kernel source, in particular the /include/asm-i386/ and /asm-x86_64/ directories. Then, check the quality of code generated by those macros in comparison with icc __rdtsc(), if that's what you're getting at.
As you appear to be stretching your definition of gcc, you might grep your kernel source, in particular the /include/asm-i386/ and /asm-x86_64/ directories. Then, check the quality of code generated by those macros in comparison with icc __rdtsc(), if that's what you're getting at.
I think I meant, how Intel instruction RDTSC has been implemented within GCC. The impl. of this instruction would help to understand RDTSC much better.
I did check within gcc/config/i386 & /gcc/config/ia64 about RDTSC, but didn't found anything.
Since, Intel C++ Compiler doesn't make it's Compiler source or it's COMPILER INTERNALS to public, so implementation of Intel instructions can be understood through GCC where Intel ports it's instructions. Probably, Intel only provides "Applications towards it's instructions" to public, but may be it's IPR policy for them.
Any instruction behaviour is better understood through it's implementation either in it's MD or .h or .c file of /gcc/config/i386[ia64) folder.
No worries, TX
~BR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's not very clear what you mean. RDTSC "instructions" are provided by the chip and you either access them with some assembler, e.g.
[cpp]static inline void rdtsc(unsigned long long& destination) { __asm__ volatile (".byte 0x0f, 0x31" : "=A" (destination)) ; } int main(int argc, char* argv[]) { unsigned long long startTick, endTick ; char buffer[65] ; rdtsc(startTick) ; for ( unsigned int i = 0 ; i < 150000 ; ++i ) { unsigned int dummy = (rand() % 32767) ; snprintf(buffer, sizeof(buffer)-1, "%u", dummy) ; } rdtsc(endTick) ; std::cout << "Took " << (endTick - startTick) << " ticks" << endl ; } [/cpp]Or are you talking about the __rdtsc() intrinsic?
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page