嗨,我有一些優化問題。
我試圖編譯GCC的測試之一,內建函數:glibC和bioniC之間的差異
#include <stdio.h>
#ifdef HAVE_C99_RUNTIME
double test1 (double x)
{
return __builtin_pow (x, 1/3);
}
double test2 (double x)
{
return __builtin_pow (x, 4./3.);
}
double test3a (double x)
{
return __builtin_pow (x, 5./3.);
}
double test3b (double x)
{
return __builtin_pow (x, -5./3.);
}
double test4 (double x)
{
return __builtin_pow (x, 7./3.);
}
#endif
我試圖與未來2種方法來進行編譯:
1路:
gcc -mglibc -O -ffast-math -std=c99 -fno-ident -S -o builtins-58.s
而在輸出彙編文件中的所有call pow
改爲call cbrt
- 其預計的
2路:
gcc -mbionic -O -ffast-math -std=c99 -fno-ident -S -o builtins-58.s
隨着使用-mbionic
代替-mglibc
我得到的輸出與call pow
是否有人知道如何optmimization
爲builtin
功能Bionic
你的問題是什麼? –
@AmigableClarkKant爲什麼優化glibc和仿生的內建函數是不同的? – Arseniy
函數是否返回相同的值? –