Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Aug 1999 17:27:33 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org, peter@FreeBSD.org
Subject:   Re: cvs commit: src/sys/i386/include cpufunc.h
Message-ID:  <199908190727.RAA14796@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>  Modified files:
>    sys/i386/include     cpufunc.h 
>  Log:
>  Try using the builtin ffs() for egcs, it (by random inspection)
>  generates slightly better code and avoids the incl then subl when
>  using ffs(foo) - 1.

The inline asm version of ffs(x) should be implemented as
(x == 0 ? 0 : bsfl(x) + 1).  The compiler can then perform all possible
optimisations except ones that use the condition codes delivered by bsfl
(these never seem to help).  This gives slightly better code than the
builtin.

Bruce


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199908190727.RAA14796>