gcc 4.8 AVX optimization bug: extra code insertion?

前端 未结 2 1850
被撕碎了的回忆
被撕碎了的回忆 2021-01-23 04:25

It is great that gcc compiler 4.8 comes with AVX optimization with -Ofast option. However, I found an interesting but stupid bug, that it adds additional computations which are

2条回答
  •  粉色の甜心
    2021-01-23 05:18

    I have figured out why. All AVX/SIMD/SSE approximation instructions need at least one Newton-Rhapson iteration to restore accuracy, otherwise, it loses 50% accuracy, i.e., the original FLOAT32 has an accuracy up to 23-bits. Without any Newton-Rhapson, we are left with only 11-bits accuracy. That approximation is way too rough to be directly usable.

提交回复
热议问题