[01-10/18] math updates

Submitted by Szabolcs Nagy on Dec. 8, 2018, 12:54 p.m.

Details

Message ID 20181208125422.GZ21289@port70.net
State New
Series "math updates"
Headers show

Commit Message

Szabolcs Nagy Dec. 8, 2018, 12:54 p.m.
math clean up patches in preparation for new implementations.

Patch hide | download patch | download mbox

From 32e1cd071774472e454f334aee333188e4f8f9b9 Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Sun, 2 Dec 2018 18:53:37 +0000
Subject: [PATCH 10/18] math: add configuration macros

Musl currently aims to support non-nearest rounding mode and does not
support SNaNs. These macros allow marking relevant code paths in case
these decisions are changed later (they also help documenting the
corner cases involved).
---
 src/internal/libm.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/internal/libm.h b/src/internal/libm.h
index 28537603..5212bab1 100644
--- a/src/internal/libm.h
+++ b/src/internal/libm.h
@@ -59,6 +59,11 @@  union ldshape {
 #error Unsupported long double representation
 #endif
 
+/* Support non-nearest rounding mode.  */
+#define WANT_ROUNDING 1
+/* Support signaling NaNs.  */
+#define WANT_SNAN 0
+
 /* Helps static branch prediction so hot path can be better optimized.  */
 #ifdef __GNUC__
 #define predict_true(x) __builtin_expect(!!(x), 1)
-- 
2.19.1