3 ms·
> (-x & 6) wouldn't (x * 6) get the same result?
by zokier 6y ago
> (-x & 6)
wouldn't (x * 6) get the same result?
- azernik 6y ago* is an inherently more complicated action, and takes 3 cycles on x86 and from 3-5 cycles on ARM. & and - are stupid-simple and take 1 cycle, always. The real question is why this isn't done with ~. Possibly some weird embedded platform doesn't have an instruction for it? I doubt this string conversion code is ever on the hot path for packet processing, but Click is in general written like everything is.