This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] rs6000: clz/ctz/ffs improvement (PR78683)
- From: David Edelsohn <dje dot gcc at gmail dot com>
- To: Segher Boessenkool <segher at kernel dot crashing dot org>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 9 Dec 2016 06:53:12 -0800
- Subject: Re: [PATCH] rs6000: clz/ctz/ffs improvement (PR78683)
- Authentication-results: sourceware.org; auth=none
- References: <244a377478f58e23a6508758901f84cf5b3ab4d2.1481277748.git.segher@kernel.crashing.org>
On Fri, Dec 9, 2016 at 2:37 AM, Segher Boessenkool
<segher@kernel.crashing.org> wrote:
> On CPUs that implement popcnt[wd] but not cnttz[wd] we can do better for
> the ctz sequences than we do today.
>
> CL[TZ]_DEFINED_VALUE_AT_ZERO can return 2, since we always return the
> same fixed value (only dependent on TARGET_* options).
>
> I originally tried to have the generic code handle this; that would be
> too much surgery for stage 3 though.
>
> Bootstrapped and tested on powerpc64-linux {-m32,-m64}; also tested
> manually with {-m32,-m64} -mcpu=power{4,7,9}. Is this okay for trunk?
>
>
> Segher
>
>
> 2016-12-09 Segher Boessenkool <segher@kernel.crashing.org>
>
> PR target/78683
> * config/rs6000/rs6000.h (CLZ_DEFINED_VALUE_AT_ZERO):
> Use GET_MODE_BITSIZE. Return 2.
> (CTZ_DEFINED_VALUE_AT_ZERO): Use GET_MODE_BITSIZE. Return 2. Handle
> TARGET_POPCNTD the same as TARGET_CTZ.
> * config/rs6000/rs6000.md (ctz<mode>2): Reimplement.
> (ffs<mode>2): Reimplement.
Okay.
Thanks, David