This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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 2/2] Remove x86 cmpstrnsi


On Sat, 2014-09-27 at 11:10 -0700, Andi Kleen wrote:
> From: Andi Kleen <ak@linux.intel.com>
> 
> In my tests the optimized glibc out of line strcmp is always faster than
> using inline rep ; cmpsb, even for small strings. The Intel optimization manual
> also recommends to not use it. So remove the cmpstrnsi instruction.
> 
> Tested on Sandy Bridge, Westmere Intel CPUs.
> 
> gcc/:
> 
> 2014-09-27  Andi Kleen	<ak@linux.intel.com>
> 
> 	* config/i386/i386.md (cmpstrnsi, cmpintqi): Remove expanders.

This has been mentioned a while ago, e.g.
https://gcc.gnu.org/ml/gcc/2002-10/msg01616.html
https://gcc.gnu.org/ml/gcc/2003-04/msg00166.html

Instead of just completely removing it, how about disabling it for newer
CPU types if not optimizing for size?

Cheers,
Oleg


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