Alexander, on Thu, 1 Jun 2023 16:35:04 +0300 (MSK) you (Alexander Monakov ) wrote: > On Thu, 25 May 2023, Jₑₙₛ Gustedt wrote: > > > Rich, > > > > on Wed, 24 May 2023 17:28:35 -0400 you (Rich Felker > > ) wrote: > > > > > There's a more efficient implementation of this function which > > > does not depend on __builtin_ctzll (which we don't): p^(p-1)&p > > > > yes, nice > > > > If you have other such nice formulas for some of the interfaces in > > , please let me know. They are hard to find in search > > engines. > > It seems this was unanswered. Hacker's Delight by Henry Warren offers > a lot of material on such topics. For this particular question it also > gives the efficient implementation: 'p & -p'. right, even better > I looked over the recently posted stdbit.h patch and I don't have > anything to suggest in terms of formulas. The things that would worry > me are of a different nature anyway. Could you share those that concern this particular new header ? (Perhaps in the thread with the patches?) Thanks Jₑₙₛ -- :: ICube :::::::::::::::::::::::::::::: deputy director :: :: Université de Strasbourg :::::::::::::::::::::: ICPS :: :: INRIA Nancy Grand Est :::::::::::::::::::::::: Camus :: :: :::::::::::::::::::::::::::::::::::: ☎ +33 368854536 :: :: https://icube-icps.unistra.fr/index.php/Jens_Gustedt ::