相关疑难解决方法(0)

为什么GCC或Clang在使用快速数学时不能优化1指令的倒数

有谁知道为什么GCC/Clang不会在下面的代码示例中优化函数test1,只是在使用fast-math选项时只使用RCPPS指令?是否有另一个编译器标志会生成此代码?

typedef float float4 __attribute__((vector_size(16)));

float4 test1(float4 v)
{
    return 1.0f / v;
}
Run Code Online (Sandbox Code Playgroud)

您可以在此处查看已编译的输出:https://goo.gl/jXsqat

c++ sse simd compiler-optimization fast-math

15
推荐指数
2
解决办法
1209
查看次数

标签 统计

c++ ×1

compiler-optimization ×1

fast-math ×1

simd ×1

sse ×1