V2 [PATCH] x86: Use _rdtsc intrinsic for HP_TIMING_NOW
Florian Weimer
fw@deneb.enyo.de
Sat Oct 20 18:16:00 GMT 2018
* H. J. Lu:
> Since _rdtsc intrinsic is supported in GCC 4.9, we can use it for
> HP_TIMING_NOW. This patch
>
> 1. Create x86 hp-timing.h to replace i686 and x86_64 hp-timing.h.
> 2. Move MINIMUM_ISA from init-arch.h to isa.h so that x86 hp-timing.h
> can check minimum x86 ISA to decide if _rdtsc can be used.
>
> NB: Checking if __i686__ isn't sufficient since __i686__ may not be
> defined when building for i686 class processors.
>
> * sysdeps/i386/init-arch.h: Removed.
> * sysdeps/i386/i586/init-arch.h: Likewise.
> * sysdeps/i386/i686/init-arch.h: Likewise.
> * sysdeps/i386/i686/hp-timing.h: Likewise.
> * sysdeps/x86_64/hp-timing.h: Likewise.
> * sysdeps/i386/isa.h: New file.
> * sysdeps/i386/i586/isa.h: Likewise.
> * sysdeps/i386/i686/isa.h: Likewise.
> * sysdeps/x86_64/isa.h: Likewise.
> * sysdeps/x86/hp-timing.h: New file.
> * sysdeps/x86/init-arch.h: Include <isa.h>.
This patch results in a substantial build time increase on Debian with
GCC 6: instead of less than two minutes I now see more than four
minutes for a full build (excluding testing).
I tried to fix this by avoiding the #undef in sysdeps/x86/hp-timing.h,
as Adhemerval suggested, but it did not help. It turns out that
including <x86intrin.h> in the old header (sysdeps/x86_64/hp-timing.h)
is sufficient to trigger the regression in build performance.
I think the regression substantial enough to revert the patch.
Comments?
I'm trying to remove the #include <hp-timing.h> from
<libc-internal.h>, but I don't know how hard this will be.
More information about the Libc-alpha
mailing list