[riot-notifications] [RIOT] Use GCC/Clang builtins for bit arithmetics (cc53bae)

René Kijewski notifications at github.com
Sun Nov 3 15:20:23 CET 2013


Maybe it would be better to keep the `__buildin` calls in this function instead of converting them to #defines?
The generated code could be rather long if the compiler uses bit magic in order to speed up the evaluation.

Maybe someone could check the .text size using the `#define`s, and using
```c
signed number_of_lowest_bit(unsigned v)
{
    return __builtin_ffs(v) - 1;
}

unsigned number_of_bits_set(unsigned v)
{
    return __builtin_popcount(v);
}
```

---
Reply to this email directly or view it on GitHub:
https://github.com/authmillenon/RIOT/commit/cc53baec8b921956ee49533d65770a04cf461d8f#commitcomment-4497611
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20131103/f96362ec/attachment.html>


More information about the notifications mailing list