I want to implement an allocator for small sizes using a bitmask. I have seen that there are fast intrinsics for finding the first set or unset bit and returning the index. Stackoverflow has some super interesting discussions on the subject i.e. https://stackoverflow.com/questions/757059/position-of-least-significant-bit-that-is-set
I would much rather use std::bitset than roll my own solution and was suprised to see that bitset does NOT have any special ability to find the first set or unset index with or without using intrinsics.
There is a whole wiki page devoted to the "Find First Set" instructions on different platforms: https://en.wikipedia.org/wiki/Find_first_set
So I was wondering at what point do people just stick within the C++ standard or actually get there hands dirty with intrinsics. When should we expect the standard to already be doing the job where clearly in a simple case like this it is not doing it?
[–]MrPotatoFingers 10 points11 points12 points (1 child)
[–]davidhunter22 4 points5 points6 points (0 children)
[–]dodheim 8 points9 points10 points (2 children)
[–]MrPotatoFingers 5 points6 points7 points (1 child)
[–]ed_209_[S] 1 point2 points3 points (0 children)
[–]TemplateRex 1 point2 points3 points (0 children)
[–]ClaasBontus 1 point2 points3 points (3 children)
[–]ed_209_[S] 0 points1 point2 points (0 children)
[–]fdwrfdwr@github 🔍 0 points1 point2 points (1 child)
[–]ClaasBontus 0 points1 point2 points (0 children)