aboutsummaryrefslogtreecommitdiff
path: root/math/math_config.h
diff options
context:
space:
mode:
Diffstat (limited to 'math/math_config.h')
-rw-r--r--math/math_config.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/math/math_config.h b/math/math_config.h
index 9b9e102..3383e70 100644
--- a/math/math_config.h
+++ b/math/math_config.h
@@ -54,6 +54,15 @@
# endif
#endif
+/* Compiler can inline fma as a single instruction. */
+#ifndef HAVE_FAST_FMA
+# if __aarch64__
+# define HAVE_FAST_FMA 1
+# else
+# define HAVE_FAST_FMA 0
+# endif
+#endif
+
#if HAVE_FAST_ROUND
# define TOINT_INTRINSICS 1
@@ -286,4 +295,18 @@ extern const struct exp_data {
uint64_t tab[2*(1 << EXP_TABLE_BITS)];
} __exp_data HIDDEN;
+#define LOG_TABLE_BITS 7
+#define LOG_POLY_ORDER 6
+#define LOG_POLY1_ORDER 12
+extern const struct log_data {
+ double ln2hi;
+ double ln2lo;
+ double poly[LOG_POLY_ORDER - 1]; /* First coefficient is 1. */
+ double poly1[LOG_POLY1_ORDER - 1];
+ struct {double invc, logc;} tab[1 << LOG_TABLE_BITS];
+#if !HAVE_FAST_FMA
+ struct {double chi, clo;} tab2[1 << LOG_TABLE_BITS];
+#endif
+} __log_data HIDDEN;
+
#endif