This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2] Faster strchr implementation.


On Thu, Aug 08, 2013 at 10:22:36PM +0400, Liubov Dmitrieva wrote:
A strchr will need to rerun tests.

Hi, I tuned my implementation do decrease loop overhead. It decreases
loop overhead by significant constant factor over previous
implementation.

There are architectures that I do not cover,
haswell - an avx2 implementation that I posted is better and it is
          better posted separately.

atom - An loop caused big overhead for sizes around 64 bytes and we need
       work on more effective header, we keep no-bsf implementation for now.

silvermont - similar issues as atom but we need separate IFUNC casing to
             choose no-bsf variant

athlon,athlon x2 - Same situation an we also need flag to choose other variant.

I updated results of my profiler.
In my random test strchr would always find terminating zero. This does
not happen in practice so now strchr will find character with 50%
probability.

http://kam.mff.cuni.cz/~ondra/benchmark_string/strchr_profile.html
http://kam.mff.cuni.cz/~ondra/benchmark_string/strchr_profile160813.tar.bz2


OK to commit this iteration?

	* sysdeps/x86_64/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Remove: __strchr_sse42.
	* sysdeps/x86_64/multiarch/strchr.S (__strchr_sse42): Remove.
	(strchr): Remove __strchr_sse42 ifunc selection.
	* sysdeps/x86_64/strchr.S (strchr): Use optimized implementation.
	* sysdeps/x86_64/strchrnul.S: Include sysdeps/x86_64/strchr.S.


diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
index 28d3579..8486294 100644
--- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]