bit swap in byte

Author Message

Joined: 05/03/2018
Location: Netherlands
Posts: 2402
Posted: 10:43pm 26 Jul 2022      

It is a ingenius algorythm, but only efficient for 64 bit processors. On an 8bit machine the 8 fold

if a and 128 then b=b+1
If a and 64 then b=b+2

Is MUCH faster...

And a 256 entry lookup table is superior, even to the above algorythm. The charm of it is that it is a simple formula, hiding smart thinking... from rhe real math wizards
Edited 2022-07-27 08:48 by Volhout