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] Disable powf/log2?f/exp2?f optimization for single-precision Arm FPU
Date: Thu, 25 Jan 2018 15:09:00 -0000	[thread overview]
Message-ID: <20180125150911.114969.qmail@sourceware.org> (raw)

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

commit 7d09d0e26191c1ca66c25dcfe0e62328ce87276f
Author: Thomas Preudhomme <thomas.preudhomme@foss.arm.com>
Date:   Tue Jan 23 10:43:54 2018 +0000

    Disable powf/log2?f/exp2?f optimization for single-precision Arm FPU
    
    New optimized powf, logf, log2f, expf and exp2f yield worse performance
    on Arm targets with only single precision instructions because the
    double precision arithmetic is then implemented via softfloat routines.
    This patch uses the old implementation when double precision
    instructions are not available on Arm targets.
    
    Testing: Built newlib with GCC's rmprofile Arm multilibs and compared
    before/after -> only the above functions are changed and calls to them
    (name change from logf to __ieee754_logf and similar). Testing the
    changed function on a panel of values yields the same result before the
    original patches to improve them and after this one. Double checking the
    performance by looping the same panel of values being tested on Arm
    Cortex-M4 does show the performance regression is fixed.

Diff:
---
 newlib/libc/include/machine/ieeefp.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/newlib/libc/include/machine/ieeefp.h b/newlib/libc/include/machine/ieeefp.h
index b1b4466..9fbef84 100644
--- a/newlib/libc/include/machine/ieeefp.h
+++ b/newlib/libc/include/machine/ieeefp.h
@@ -78,7 +78,9 @@
 # else
 #  define __IEEE_BIG_ENDIAN
 # endif
-# define __OBSOLETE_MATH_DEFAULT 0
+# if __ARM_FP & 0x8
+#  define __OBSOLETE_MATH_DEFAULT 0
+# endif
 #else
 # define __IEEE_BIG_ENDIAN
 # ifdef __ARMEL__


                 reply	other threads:[~2018-01-25 15:09 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=20180125150911.114969.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).