This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
[PATCH 2/2] Remove float compare option from sincosf
- From: Szabolcs Nagy <szabolcs dot nagy at arm dot com>
- To: newlib at sourceware dot org
- Cc: nd at arm dot com
- Date: Wed, 11 Jul 2018 11:12:34 +0100
- Subject: [PATCH 2/2] Remove float compare option from sincosf
- References: <51665f12-bfd8-af10-53f3-562495caccde@arm.com>
>From 82d80802dd01b6cbbf361c027e1af02e626bd5bd Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date: Tue, 10 Jul 2018 17:14:32 +0100
Subject: [PATCH 2/2] Remove float compare option from sincosf
PREFER_FLOAT_COMPARISON setting was not correct as it could raise
spurious exceptions. Fixing it is easy: just use ISLESS(x, y) instead
of abstop12(x) < abstop12(y) with appropriate non-signaling definition
for ISLESS. However it seems this setting is not very useful (there is
only minor performance difference on various architectures), so remove
this option for now.
---
newlib/libm/common/sincosf.h | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/newlib/libm/common/sincosf.h b/newlib/libm/common/sincosf.h
index 27f24ffe3..3cac8e88f 100644
--- a/newlib/libm/common/sincosf.h
+++ b/newlib/libm/common/sincosf.h
@@ -43,21 +43,12 @@ extern const sincos_t __sincosf_table[2] HIDDEN;
extern const uint32_t __inv_pio4[] HIDDEN;
-/* abstop12 assumes floating point reinterpret is fast by default.
- If floating point comparisons are faster, define PREFER_FLOAT_COMPARISON. */
-#if PREFER_FLOAT_COMPARISON
-static inline float
-abstop12 (float x)
-{
- return fabsf (x);
-}
-#else
+/* Top 12 bits of the float representation with the sign bit cleared. */
static inline uint32_t
abstop12 (float x)
{
return (asuint (x) >> 20) & 0x7ff;
}
-#endif
/* Compute the sine and cosine of inputs X and X2 (X squared), using the
polynomial P and store the results in SINP and COSP. N is the quadrant,
--
2.14.1