[Bug target/78683] [ppc] __builtin_ctzl code gen can be improved for -mcpu=power8 and earlier
segher at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Dec 9 19:31:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78683
--- Comment #1 from Segher Boessenkool <segher at gcc dot gnu.org> ---
Author: segher
Date: Fri Dec 9 19:31:06 2016
New Revision: 243499
URL: https://gcc.gnu.org/viewcvs?rev=243499&root=gcc&view=rev
Log:
rs6000: clz/ctz/ffs improvement (PR78683)
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).
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.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/rs6000/rs6000.h
trunk/gcc/config/rs6000/rs6000.md
More information about the Gcc-bugs
mailing list