CVSROOT:        /cvs
Module name:    src
Changes by:     [email protected] 2026/06/23 06:13:08

Modified files:
        usr.sbin/bgpd  : Makefile chash.c 

Log message:
Implement ch_meta_locate() using some bit tricks to avoid branches and loops.

ch_haszero() first sets the high bit for every byte in lookup that is 0
and then uses a multiplaction plus shift to compact this bits into the
output.

Also use a multiplication with 0x0101010101010101 instead of the memset().
Modern compilers produce the same code but older ones produce a bit simpler
code this way.

Based on a diff from Rango (kombucha at mm.st)
OK tb@

Reply via email to