Messages in this thread | | | Date | Thu, 24 Jun 2004 11:17:12 +0200 | From | Arjan van de Ven <> | Subject | Re: using gcc built-ins for bitops? |
| |
On Thu, Jun 24, 2004 at 02:00:22AM -0700, Andrew Morton wrote: > Arjan van de Ven <arjanv@redhat.com> wrote: > > > > gcc 3.4 gained support for several typical bitops as builtin directives. > > Using these over inline asm has a few advantages: > > * gcc can optimize constants into these better > > * gcc can reorder and schedule the code better > > * gcc can allocate registers etc better for the code > > > > The question is if we consider it desirable to go down this road or not. In > > order to help that discussion I've attached a patch below that switches the > > i386 ffz() function to the gcc builtin version, conditional on gcc having > > support for this. Before I go down the road of converting more functions > > and/or architectures.... is this worth doing? > > I guess it depends on the resulting code size and quality. Some extra > conversions would be needed for that.
for ffz() the exact same assembly instructions are generated in the cases I looked at (kernel/signal.c); eg no extra code at all.
[unhandled content-type:application/pgp-signature] | |