This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Letter to DDJ
- From: Andi Kleen <ak at suse dot de>
- To: Laurent GUERBY <laurent at guerby dot net>
- Cc: gcc at gcc dot gnu dot org, aph at gcc dot gnu dot org
- Date: 05 May 2004 01:00:40 -0700
- Subject: Re: Letter to DDJ
- References: <200405041648.i44GmOuI010642@redhat.com.suse.lists.egcs><1083694945.24278.4.camel@pc.suse.lists.egcs>
Laurent GUERBY <laurent@guerby.net> writes:
> I believe you need to add a special instruction
> to prevent the hardware to reorder the execution of rdtsc
The P4 wont, but AMD CPUs will (especially K8).
> leading to wrong measurement, I don't remember what it was
> and the GCC asm for it though, may be someone else can help...
Before the RDTSC:
int tmp;
asm volatile("cpuid" : "=a" (tmp) : "0" (1) : "ebx","ecx","edx","memory")
-Andi