3 ms·
Can anyone please explain why this naive pow() implementation is so freaking huge? I lack the chops to figure this out properly https://godbolt.org/g/YFvNWa htt
by cfv 10y ago
Can anyone please explain why this naive pow() implementation is so freaking huge? I lack the chops to figure this out properly https://godbolt.org/g/YFvNWa https://godbolt.org/g/YFvNWa
- jcranmer 10y agoThe loop was unrolled with a large factor. The loop was also vectorized, so that each multiply is a 4-element vector multiplication, with the final result being a horizontal reduction. The rest of the mess is trying to account for all of the cases where the input power is not a multiple of 128.