[lkml]   [2004]   [Jun]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: using gcc built-ins for bitops?
On Thu, Jun 24, 2004 at 02:00:22AM -0700, Andrew Morton wrote:
> Arjan van de Ven <> 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]
 \ /
  Last update: 2005-03-22 14:04    [W:0.104 / U:0.876 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site