summaryrefslogtreecommitdiffstats
path: root/libm/include/math.h
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2015-08-24 22:57:08 +0000
committerSteve Kondik <steve@cyngn.com>2015-11-07 01:42:32 -0800
commit245c1718cb035268284bea8dabe3faa3f8326ee8 (patch)
treeb3cba5f5b664b0e11cdfb4c980fc05d11724ece9 /libm/include/math.h
parentea4e4e7c8c65e0cc3d087ba4d867851b840b9680 (diff)
downloadbionic-245c1718cb035268284bea8dabe3faa3f8326ee8.zip
bionic-245c1718cb035268284bea8dabe3faa3f8326ee8.tar.gz
bionic-245c1718cb035268284bea8dabe3faa3f8326ee8.tar.bz2
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 c5deb0f883cbdca7e5ab75f92f82c31d21367f49. Change-Id: If7abdb351f5a5549d6a331b33af408e8fcfa9868
Diffstat (limited to 'libm/include/math.h')
-rw-r--r--libm/include/math.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/libm/include/math.h b/libm/include/math.h
index bc48b6a..ce8e3b2 100644
--- a/libm/include/math.h
+++ b/libm/include/math.h
@@ -20,6 +20,12 @@
#include <sys/cdefs.h>
#include <limits.h>
+#if !defined(__BIONIC_NO_MATH_INLINES)
+#define __BIONIC_MATH_INLINE(__def) extern __inline__ __always_inline __attribute__((gnu_inline)) __attribute__((__artificial__)) __def
+#else
+#define __BIONIC_MATH_INLINE(__def)
+#endif
+
__BEGIN_DECLS
#pragma GCC visibility push(default)
@@ -161,6 +167,7 @@ double sqrt(double);
double ceil(double);
double fabs(double) __pure2;
+__BIONIC_MATH_INLINE(double fabs(double x) { return __builtin_fabs(x); })
double floor(double);
double fmod(double, double);
@@ -279,6 +286,7 @@ float sqrtf(float);
float ceilf(float);
float fabsf(float) __pure2;
+__BIONIC_MATH_INLINE(float fabsf(float x) { return __builtin_fabsf(x); })
float floorf(float);
float fmodf(float, float);
float roundf(float);
@@ -366,6 +374,7 @@ long double exp2l(long double);
long double expl(long double);
long double expm1l(long double);
long double fabsl(long double) __pure2;
+__BIONIC_MATH_INLINE(long double fabsl(long double x) { return __builtin_fabsl(x); })
long double fdiml(long double, long double);
long double floorl(long double);
long double fmal(long double, long double, long double);