This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 2/2] Remove x86 cmpstrnsi
- From: Oleg Endo <oleg dot endo at t-online dot de>
- To: Andi Kleen <andi at firstfloor dot org>
- Cc: gcc-patches at gcc dot gnu dot org, Andi Kleen <ak at linux dot intel dot com>
- Date: Sat, 27 Sep 2014 20:45:18 +0200
- Subject: Re: [PATCH 2/2] Remove x86 cmpstrnsi
- Authentication-results: sourceware.org; auth=none
- References: <1411841447-20914-1-git-send-email-andi at firstfloor dot org> <1411841447-20914-2-git-send-email-andi at firstfloor dot org>
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