public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org>
To: newlib-cvs@sourceware.org
Subject: [newlib-cygwin] Remove float compare option from sincosf
Date: Wed, 11 Jul 2018 15:17:00 -0000	[thread overview]
Message-ID: <20180711151709.92586.qmail@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=81dc535bb9e0196203e706caa533713306b4fc2c

commit 81dc535bb9e0196203e706caa533713306b4fc2c
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Tue Jul 10 17:14:32 2018 +0100

    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.

Diff:
---
 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 27f24ff..3cac8e8 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,


                 reply	other threads:[~2018-07-11 15:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180711151709.92586.qmail@sourceware.org \
    --to=corinna@sourceware.org \
    --cc=newlib-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).