This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
[PATCH 3/6] Remove unused TOINT_RINT and TOINT_SHIFT macros
- From: Szabolcs Nagy <szabolcs dot nagy at arm dot com>
- To: newlib at sourceware dot org
- Cc: nd at arm dot com
- Date: Thu, 5 Jul 2018 17:02:05 +0100
- Subject: [PATCH 3/6] Remove unused TOINT_RINT and TOINT_SHIFT macros
- References: <a89ec9c7-86b9-cdb2-2e62-398df765a128@arm.com>
>From 2801b0ad036d74ca45a89df8b9210207b81961e7 Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date: Thu, 5 Jul 2018 12:42:13 +0100
Subject: [PATCH 3/6] Remove unused TOINT_RINT and TOINT_SHIFT macros
Only have separate code paths for TOINT_INTRINSICS and !TOINT_INTRINSICS.
---
newlib/libm/common/math_config.h | 6 ------
newlib/libm/common/sf_exp.c | 5 +----
2 files changed, 1 insertion(+), 10 deletions(-)
diff --git a/newlib/libm/common/math_config.h b/newlib/libm/common/math_config.h
index 1f83756ab..b46e44e51 100644
--- a/newlib/libm/common/math_config.h
+++ b/newlib/libm/common/math_config.h
@@ -93,12 +93,6 @@ converttoint (double_t x)
#ifndef TOINT_INTRINSICS
# define TOINT_INTRINSICS 0
#endif
-#ifndef TOINT_RINT
-# define TOINT_RINT 0
-#endif
-#ifndef TOINT_SHIFT
-# define TOINT_SHIFT 1
-#endif
static inline uint32_t
asuint (float f)
diff --git a/newlib/libm/common/sf_exp.c b/newlib/libm/common/sf_exp.c
index 79ec62bf5..5d72c3451 100644
--- a/newlib/libm/common/sf_exp.c
+++ b/newlib/libm/common/sf_exp.c
@@ -88,10 +88,7 @@ expf (float x)
#if TOINT_INTRINSICS
kd = roundtoint (z);
ki = converttoint (z);
-#elif TOINT_RINT
- kd = rint (z);
- ki = (long) kd;
-#elif TOINT_SHIFT
+#else
# define SHIFT __exp2f_data.shift
kd = (double) (z + SHIFT); /* Rounding to double precision is required. */
ki = asuint64 (kd);
--
2.14.1