PATCH: ffs/ctz expansions using clz

Sandra Loosemore sandra@codesourcery.com
Thu Aug 2 01:37:00 GMT 2007


This patch originally started out life as being specific to the MIPS backend, 
but Richard pointed out that it could be done in a target-independent way in 
optabs.c.  The idea is that if the target has clz support but not ffs and/or 
ctz, you can use the former to implement the latter more efficiently than with a 
library call.

This patch depends on CLZ_DEFINED_VALUE_AT_ZERO applying to the clz optab as 
well as the clz rtl expression.  I couldn't tell from reading the documentation 
whether this is a change from its previous meaning or not, but I don't think 
it's inconsistent with current practice in all the other back ends.  I could add 
a doc patch if folks think it is a change, or just needs clarification generally.

OK to commit otherwise?

-Sandra

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 24-ffs-ctz.log
Type: text/x-log
Size: 218 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070802/4503232a/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 24-ffs-ctz.patch
Type: text/x-patch
Size: 3626 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070802/4503232a/attachment-0001.bin>


More information about the Gcc-patches mailing list