With the rise of the C23 standard and facilities such as std_count_ones, we can and should at the very least in the backend optimize all of those operations to effectively singular instructions, popular instructions that are extremely common include:
popcnt, tzcnt, lzcnt, bsr, bsfand more.
In theory what we can do is target available CPU instructions to deliver these types of functions in a more optimized manner (thus allowing the compiler to operate it).
Personally I don't think this is a priority at this point in time, but I do think this is a "nice to have" especially if we ever want to use these features ourselves.
yeah we can optimize such things later... it is just for now it didn't make sense to write a bunch of assembly code that I'm going to translate to C when we do x64 anyway,,,
With the rise of the C23 standard and facilities such as std_count_ones, we can and should at the very least in the backend optimize all of those operations to effectively singular instructions, popular instructions that are extremely common include:
popcnt
,tzcnt
,lzcnt
,bsr
,bsf
and more.In theory what we can do is target available CPU instructions to deliver these types of functions in a more optimized manner (thus allowing the compiler to operate it).
Personally I don't think this is a priority at this point in time, but I do think this is a "nice to have" especially if we ever want to use these features ourselves.