3 ms·
It surprises me more of these haven't become standardised features. __builtin_expect is very common (but as a compiler hint I somewhat understand its absence),
by TazeTSchnitzel 7y ago
It surprises me more of these haven't become standardised features. __builtin_expect is very common (but as a compiler hint I somewhat understand its absence), __builtin_clz is arguably a missing feature.
- jart 7y agoI suspect (but haven't verified) that modern compilers are actually implementing __builtin_expect() as a no-op. Much better alternatives exist today, e.g. GCC 8+ __cold__ and profile guided optimizations, which don't have a negative impact on code readability.