From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 115038 invoked by alias); 25 Jan 2018 15:09:11 -0000 Mailing-List: contact newlib-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-cvs-owner@sourceware.org Received: (qmail 114972 invoked by uid 9078); 25 Jan 2018 15:09:11 -0000 Date: Thu, 25 Jan 2018 15:09:00 -0000 Message-ID: <20180125150911.114969.qmail@sourceware.org> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Corinna Vinschen To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] Disable powf/log2?f/exp2?f optimization for single-precision Arm FPU X-Act-Checkin: newlib-cygwin X-Git-Author: Thomas Preudhomme X-Git-Refname: refs/heads/master X-Git-Oldrev: 29af5b27cf6a5222670ca910102e0f25406691ad X-Git-Newrev: 7d09d0e26191c1ca66c25dcfe0e62328ce87276f X-SW-Source: 2018-q1/txt/msg00028.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=7d09d0e26191c1ca66c25dcfe0e62328ce87276f commit 7d09d0e26191c1ca66c25dcfe0e62328ce87276f Author: Thomas Preudhomme 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__