Revert "Revert "Use compiler builtins for fabs.""
Don't enable the inlines when building libm itself. Otherwise clang gets
upset by seeing both an inline and a non-inline definition.
This reverts commit c5deb0f883
.
Change-Id: If7abdb351f5a5549d6a331b33af408e8fcfa9868
This commit is contained in:
@@ -258,3 +258,29 @@ void BM_math_signbit::Run(int iters, double value) {
|
||||
|
||||
StopBenchmarkTiming();
|
||||
}
|
||||
|
||||
BENCHMARK_WITH_ARG(BM_math_fabs_macro, double)->AT_COMMON_VALS;
|
||||
void BM_math_fabs_macro::Run(int iters, double value) {
|
||||
StartBenchmarkTiming();
|
||||
|
||||
d = 0.0;
|
||||
v = value;
|
||||
for (int i = 0; i < iters; ++i) {
|
||||
d += fabs(v);
|
||||
}
|
||||
|
||||
StopBenchmarkTiming();
|
||||
}
|
||||
|
||||
BENCHMARK_WITH_ARG(BM_math_fabs, double)->AT_COMMON_VALS;
|
||||
void BM_math_fabs::Run(int iters, double value) {
|
||||
StartBenchmarkTiming();
|
||||
|
||||
d = 0.0;
|
||||
v = value;
|
||||
for (int i = 0; i < iters; ++i) {
|
||||
d += (fabs)(v);
|
||||
}
|
||||
|
||||
StopBenchmarkTiming();
|
||||
}
|
||||
|
Reference in New Issue
Block a user