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] rs6000: clz/ctz/ffs improvement (PR78683)


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


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