This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: libm -fno-builtin


Hi,

I've tried removing -fno-builtin for libm and the results look good. As well
as fabs and floor, gcc also inlines creal, cimag, carg, copysign and finite.
Some of the complex maths functions are greatly simplified, as creal & cimag
can effectively be optimised away, whereas at the moment the function calls
result in lots of stack manipulation. I can't see anything obviously
problematic with this.

Overall, for my embedded target, libm code size reduced by about 4%.

Cheers,
Jon



Here's a few places where it can be removed - there's also other uses in
machine/*/configure - but I guess that is best left to the maintainers of
those ports to remove.

diff --git a/newlib/libm/configure b/newlib/libm/configure
index 961f0cb6d..f37fae2a7 100755
--- a/newlib/libm/configure
+++ b/newlib/libm/configure
@@ -3725,7 +3725,7 @@ fi

 . ${newlib_basedir}/configure.host

-newlib_cflags="${newlib_cflags} -fno-builtin"
+newlib_cflags="${newlib_cflags}"

 NEWLIB_CFLAGS=${newlib_cflags}

diff --git a/newlib/libm/machine/configure b/newlib/libm/machine/configure
index c15ef32ee..2b9c5c1b9 100755
--- a/newlib/libm/machine/configure
+++ b/newlib/libm/machine/configure
@@ -3671,7 +3671,7 @@ fi

 . ${newlib_basedir}/configure.host

-newlib_cflags="${newlib_cflags} -fno-builtin"
+newlib_cflags="${newlib_cflags}"

 NEWLIB_CFLAGS=${newlib_cflags}

diff --git a/newlib/libm/machine/i386/configure
b/newlib/libm/machine/i386/configure
index f6bf9892a..9f07b7bd2 100755
--- a/newlib/libm/machine/i386/configure
+++ b/newlib/libm/machine/i386/configure
@@ -3661,7 +3661,7 @@ fi

 . ${newlib_basedir}/configure.host

-newlib_cflags="${newlib_cflags} -fno-builtin"
+newlib_cflags="${newlib_cflags}"

 NEWLIB_CFLAGS=${newlib_cflags}




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]