Both `log_floori()` and `log_ceili()` can probably be implemented more efficiently with base-2 logarithms (i.e. with `bit_scan_reverse()`).