| 206 | } |
| 207 | |
| 208 | static constexpr int _highest_bit_step(u32 v, int r) FL_NOEXCEPT { |
| 209 | return (v & 0xFFFF0000u) ? _highest_bit_step(v >> 16, r + 16) |
| 210 | : (v & 0x0000FF00u) ? _highest_bit_step(v >> 8, r + 8) |
| 211 | : (v & 0x000000F0u) ? _highest_bit_step(v >> 4, r + 4) |
| 212 | : (v & 0x0000000Cu) ? _highest_bit_step(v >> 2, r + 2) |
| 213 | : (v & 0x00000002u) ? r + 1 |
| 214 | : r; |
| 215 | } |
| 216 | |
| 217 | // Fixed-point log base 2 for positive values. |
| 218 | // Uses 2-term polynomial for log2(1+t), t in [0,1) (simplified for unsigned). |
no outgoing calls
no test coverage detected