Relative Content

Tag Archive for c++x86-64compiler-optimizationc++23

[[assume]] attribute not having an impact on code

I expect the multiply_by_pow_of_2 function below to have a more optimized code for multiplication since I used the [[ assume( std::has_single_bit( multiplier ) ) ]]; which is supposed to tell the compiler that 2nd parameter multiplier is always a power of 2. So maybe it could generate faster code. However it generates the same code (using imul):