Bit twiddling builtins
Falk Hueffner
falk.hueffner@student.uni-tuebingen.de
Thu Jan 23 21:43:00 GMT 2003
Hi,
here's a draft of a patch that implements bit scanning and counting
builtins. No docs or test cases yet, but I'd be interested in any
comments. Constant folding also isn't implemented yet.
I still can't manage to generate ffsdi. Should I perhaps add ffsl and
ffsll while I'm at it? That might confuse some backends, though,
because they assume they'll only see ffs in SImode.
ARM already has a __builtin_clz, that would need to be moved out of
the way, too.
When I add a pattern for clzdi to the Alpha backend, gcc will reduce
clzsi to it via zero extension. That doesn't work for clz. Is there a
way to inhibit this? Will adding a clzsi pattern reliably do?
Hm, I just noticed I get mysterious failures with the libgcc version
at -O3, I'll investigate that...
--
Falk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bittwiddle-builtins.patch
Type: text/x-patch
Size: 19830 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20030123/2b68d724/attachment.bin>
More information about the Gcc-patches
mailing list