summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/int_math.h
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2011-11-16 07:33:06 +0000
committerDaniel Dunbar <daniel@zuster.org>2011-11-16 07:33:06 +0000
commit2139c52d338003ec77afed7dec862e0ad4ceb443 (patch)
tree3e7997e6a817356a7e4462f9327c0ebbdb7e0aff /compiler-rt/lib/int_math.h
parentddf1890a5ed78967997720bc35b05b23b000bcf0 (diff)
downloadbcm5719-llvm-2139c52d338003ec77afed7dec862e0ad4ceb443.tar.gz
bcm5719-llvm-2139c52d338003ec77afed7dec862e0ad4ceb443.zip
lib: Finish int_math.h definitions using compiler builtins and eliminate
implementation use of <math.h>. llvm-svn: 144786
Diffstat (limited to 'compiler-rt/lib/int_math.h')
-rw-r--r--compiler-rt/lib/int_math.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/compiler-rt/lib/int_math.h b/compiler-rt/lib/int_math.h
index 856889d8654..b472f1a962e 100644
--- a/compiler-rt/lib/int_math.h
+++ b/compiler-rt/lib/int_math.h
@@ -21,8 +21,30 @@
#ifndef INT_MATH_H
#define INT_MATH_H
+#define CRT_INFINITY __builtin_huge_valf()
+
#define crt_isfinite(x) __builtin_isfinite((x))
#define crt_isinf(x) __builtin_isinf((x))
#define crt_isnan(x) __builtin_isnan((x))
+#define crt_copysign(x, y) __builtin_copysign((x), (y))
+#define crt_copysignf(x, y) __builtin_copysignf((x), (y))
+#define crt_copysignl(x, y) __builtin_copysignl((x), (y))
+
+#define crt_fabs(x) __builtin_fabs((x))
+#define crt_fabsf(x) __builtin_fabsf((x))
+#define crt_fabsl(x) __builtin_fabsl((x))
+
+#define crt_fmax(x, y) __builtin_fmax((x), (y))
+#define crt_fmaxf(x, y) __builtin_fmaxf((x), (y))
+#define crt_fmaxl(x, y) __builtin_fmaxl((x), (y))
+
+#define crt_logb(x) __builtin_logb((x))
+#define crt_logbf(x) __builtin_logbf((x))
+#define crt_logbl(x) __builtin_logbl((x))
+
+#define crt_scalbn(x, y) __builtin_scalbn((x), (y))
+#define crt_scalbnf(x, y) __builtin_scalbnf((x), (y))
+#define crt_scalbnl(x, y) __builtin_scalbnl((x), (y))
+
#endif /* INT_MATH_H */
OpenPOWER on IntegriCloud