aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/include/math.h
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/include/math.h')
-rw-r--r--runtime/include/math.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/runtime/include/math.h b/runtime/include/math.h
new file mode 100644
index 00000000..d6475df1
--- /dev/null
+++ b/runtime/include/math.h
@@ -0,0 +1,19 @@
+#ifndef _COMPCERT_MATH_H
+#define _COMPCERT_MATH_H
+
+#define isfinite(__y) (fpclassify((__y)) >= FP_ZERO)
+
+#include_next <math.h>
+
+#ifndef COMPCERT_NO_FP_MACROS
+#define fmin(x, y) __builtin_fmin((x),(y))
+#define fmax(x, y) __builtin_fmax((x),(y))
+#define fminf(x, y) __builtin_fminf((x),(y))
+#define fmaxf(x, y) __builtin_fmaxf((x),(y))
+#define fabs(x) __builtin_fabs((x))
+#define fabsf(x) __builtin_fabsf((x))
+#define fma(x, y, z) __builtin_fma((x),(y),(z))
+#define fmaf(x, y, z) __builtin_fmaf((x),(y),(z))
+#endif
+
+#endif