3 ms·
Nowadays things like these should only be interesting to compiler writers.
by adrianN 16y ago
Nowadays things like these should only be interesting to compiler writers.
- natemartin 16y agoMight still be useful for some embedded applications.
- Xk 16y agoBelieve it or not, there are still programs that require blazingly fast bit operations. I used like ten different bit hacks for a game engine I wrote which uses bitboards[1]. [1] http://en.wikipedia.org/wiki/Bitboard http://en.wikipedia.org/wiki/Bitboard
- gaius 16y agoIt's no surprise this is hosted on graphics.stanford.edu.
- akdubya 16y agoBitwise operations pop up fairly often in advanced data structures (Hash Array Mapped Tries, Bloom Filters, etc). The big advantage in my view is being able to perform complex, data-intensive tasks in otherwise limited environments (e.g., mobile devices).
- cultureulterior 16y agoThere are algorithms that use bits just like there are algorithms that use trees. You wouldn't expect your compiler to write your algorithms for you, would you. Just recently, I've used the bitboards representation for cellular automata (which lets you compute 64 cells at the same time by doing about 100 non-branching integer instructions). I have difficulty seeing a compiler that can recognize that algorithmic optimization.
- andreasvc 16y agoI took him to mean that compiler writers should provide these bit operations in the most efficient manner on the current platform, e.g. __builtin_ctzl instead of directly using assembly or using arithmetical solutions.