Commit graph

39 commits

Author SHA1 Message Date
Elliott Hughes
1b66f6e9d7 Move a private x86-64 header file out of the limelight.
Currently this is on everyone's include path and is getting exported
via the NDK.

Change-Id: Ia417839fb65c7e0afddcd9fae3438665dae8e752
2014-11-26 19:31:19 -08:00
Elliott Hughes
b8ee16f1dc Fix our <complex.h> support.
We build libm with -fvisibility=hidden, so we weren't exporting any
of the <complex.h> functions.

We also weren't building many of the functions anyway.

We were also missing the complex inverse trigonometric functions.

And because we didn't even have perfunctory "call each function once"
tests, we didn't notice that we weren't exporting any symbols, so this
patch adds at least that level of testing.

Change-Id: Ibcf2843f507126c51d134cc5fc8d67747e033a0d
2014-11-06 11:16:55 -08:00
Elliott Hughes
755318548d Fix lgamma_r/lgammaf_r/lgammal_r for -0.
Upstream has implemented lgammal/lgammal_r for ld128, and fixed the
sign problem we reported with all the lgamma*_r functions and -0.

Bug: 17471883
Change-Id: Ibb175d9cab67efae75f1010796fd44c9ba6ce4fc
2014-09-18 11:23:58 -07:00
Elliott Hughes
e0c56efddf Use __GNUC_PREREQ rather than __GNUC_PREREQ__ to match glibc.
Bug: 16874785
Change-Id: I8512f8be3fd149d8720c5c3b4657bedd5ce2b1d1
2014-08-29 15:54:11 -07:00
Elliott Hughes
f4c948a9e9 Move the meat of <features.h> into <sys/cdefs.h>.
This way it's a lot harder for us to screw up (since we should always
be including <sys/cdefs.h> anyway).

Bug: 14659579
Change-Id: I23070fff3296b0d1c683bb5e3a6e214146327d53
2014-08-19 11:18:20 -07:00
Elliott Hughes
5f5cc45cf0 Fix <features.h> (_BSD_SOURCE and _GNU_SOURCE).
<features.h> is supposed to take user-settable stuff like _GNU_SOURCE
and _BSD_SOURCE and turn them into __USE_GNU and __USE_BSD for use in
the C library headers. Instead, bionic used to unconditionally define
_BSD_SOURCE and _GNU_SOURCE, and then test _GNU_SOURCE in the header
files (which makes no sense whatsoever).

Bug: 14659579
Change-Id: Ice4cf21a364ea2e559071dc8329e995277d5b987
2014-08-18 16:04:03 -07:00
Elliott Hughes
4779a11a3d Merge "Move mips fenv implementation details into fenv.c." 2014-06-09 22:27:30 +00:00
Elliott Hughes
89d61243f2 Move mips fenv implementation details into fenv.c.
Change-Id: I2415e4808e40c2981d016c01969ba14ea22bf82e
2014-06-09 15:25:15 -07:00
Elliott Hughes
43bf81e544 Move x86 fenv implementation details into fenv.c.
Change-Id: I6cb8c730483c325dc3cb75c2b2fbdd2d8455a54c
2014-06-09 15:20:59 -07:00
Elliott Hughes
9812a0233c Clean up the ARM fenv.h, moving implementation details into fenv.c.
Change-Id: I919d35db27ec16a6f54a7a5c3c070f33f03d9bb9
2014-06-09 13:57:57 -07:00
Serban Constantinescu
a147a1da5c AArch64: libm: Fix ARM64 fenv_t and refactor ARM64 libm implementation.
This patch fixes the ARM64 ABI for libm. fenv_t is now split in 32bit status
and 32bit control. This mirrors the AArch64 FPU control and status
registers (FPCR, FPSR).

The patch also refactors the libm implementation for ARM64 into a finer
grained control over the FPU registers.

Bionic-benchmarks has been expanded with 3 more benchmarks for floating
point operations. The new libm implementation for ARM64 performs better
over all the math benchmarks available.

Change-Id: I2a7f81d6b4e55c91f8a63a4c69614fc8b1bcf2db
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
2014-06-09 13:52:28 -07:00
Elliott Hughes
de9ac71053 Use -fvisibility=hidden to build libm.
Bug: 11156955
Change-Id: I77b7772a44313a1eb3970f5d2c8e2af63690efa4
2014-05-19 16:58:52 -07:00
Elliott Hughes
b4f2f28054 Declare sincos/sincosf/sincosl in <math.h>.
Change-Id: If7b98f98c7ab4d3d77d310be082bff64512d51a8
2014-05-08 21:19:12 -07:00
Elliott Hughes
9a5a3e8e74 Fix <math.h> to quieten most of our warnings.
I've reported the wcsftime bug upstream, but we really just want to use -D
to ensure the buggy code isn't built. (I've also brought our strftime a bit
closer to upstream now we have the right define.)

I don't think upstream is likely to fix all their sign-compare and
uninitialized warnings, so let's just silence them.

As for libm, again upstream isn't likely to fix all their warnings, and
silencing those made the ones that were our fault stand out. I've fixed
our <math.h> to fix the warnings caused by our lack of definitions for
the non-imprecise long-double functions. I checked the C99 standard, and
all these functions are there.

Change-Id: Iee8e1182c1db375058fb2c451eceb212bab47a37
2014-05-05 21:19:47 -07:00
Pavel Chupin
7ba84d3108 Fix x86_64 build
Fix types after recent update:
https://android-review.googlesource.com/#/c/83435/

Change-Id: I17ed28af84b7adeb8572e18834e66f3264ec061d
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
2014-02-28 00:52:09 +04:00
Calin Juravle
26349d8c2e Fix mips build
Change-Id: Ica843d387e115d0b27afd961af73237ec9109ed9
2014-02-26 21:33:36 +00:00
Calin Juravle
2d367905a2 Moved to a more openbsd-like fenv.h
Factored out common declarations to include/fenv.h and pushed
the implementation to .c files.

Bug: 11050744
Change-Id: I446b13cc4bc599d328343a8d392b07de280f6304
2014-02-26 12:30:44 +00:00
Elliott Hughes
9f87a0b285 Remove <sys/_types.h>.
Bug: 12213562
Change-Id: I0d10664f9da60739bdbad0408be0dd61eea3c1fe
2014-02-07 14:55:58 -08:00
Colin Cross
d1973ca513 bionic: rename aarch64 target to arm64
Rename aarch64 build targets to arm64.  The gcc toolchain is still
aarch64.

Change-Id: Ia92d8a50824e5329cf00fd6f4f92eae112b7f3a3
2014-01-23 18:35:39 -08:00
Serban Constantinescu
1c4f101a9b AArch64: Initial AArch64 port of libm
This patch adds intial support for AArch64 to bionic's libm.

Change-Id: I9ae0f895bbdd7fe67815e6ca1ead627581163a27
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
2013-12-16 17:05:37 -08:00
Elliott Hughes
361847f9ac Fix the x86_64 fenv.h.
We should clean all the fenv.h files up, but not now. I've raised
bug 11050744 as a reminder.

Change-Id: I640c15b0f0477ec1a7891c031860404875bbe4b5
2013-10-02 17:02:58 -07:00
Elliott Hughes
770a349560 Fix libm build for x86_64.
Change-Id: If89da2d5c3d9a88f78ffd8b260ad0f2fd391c608
2013-10-01 17:57:19 -07:00
Elliott Hughes
a0ee07829a Upgrade libm.
This brings us up to date with FreeBSD HEAD, fixes various bugs, unifies
the set of functions we support on ARM, MIPS, and x86, fixes "long double",
adds ISO C99 support, and adds basic unit tests.

It turns out that our "long double" functions have always been broken
for non-normal numbers. This patch fixes that by not using the upstream
implementations and just forwarding to the regular "double" implementation
instead (since "long double" on Android is just "double" anyway, which is
what BSD doesn't support).

All the tests pass on ARM, MIPS, and x86, plus glibc on x86-64.

Bug: 3169850
Bug: 8012787
Bug: https://code.google.com/p/android/issues/detail?id=6697
Change-Id: If0c343030959c24bfc50d4d21c9530052c581837
2013-02-01 14:51:19 -08:00
Raghu Gandham
d199017101 [MIPS] Rewrite fenv.h for Android
Change-Id: I4d1e2f0b37b587426ccc9f26c525ec0d36637c7d
2013-01-04 16:32:54 -08:00
Elliott Hughes
90e10d41c4 Rewrite <fenv.h> for ARM.
The old code was one big no-op.

Bug: http://code.google.com/p/android/issues/detail?id=38196
Change-Id: I201a6ffa477385b2629f45e8c948bdfbd47b5bf1
2012-11-05 08:50:19 -08:00
Elliott Hughes
0f7809d5c3 Start cleaning up libm.
We have two copies of fenv.h for every architecture, one of which
isn't used. We also have unused makefiles and files for architectures
we don't support.

This patch removes all the obviously useless files.

Bug: http://code.google.com/p/android/issues/detail?id=38196
Change-Id: I1919b6621ba513aa24aa947a34815bc51191487c
2012-10-31 13:32:34 -07:00
Andrew Hsieh
2f7d7c6538 Enclosed functions in fenv.h with __BEGIN_DECLS/__END_DECLS
Those are C funcitons

Related CL: https://android-review.googlesource.com/#/c/41833/

Change-Id: I4386bcf948ad31c3690c9b7a145103088133d041
2012-08-21 15:41:34 +08:00
Shih-wei Liao
4e86ebb4b6 Had include/arm/fenv.h, but missed include/mips/fenv.h.
Needed for the device-build for LLVM's constant folding pass.

Change-Id: I412a98d52458231650801a8b59fe3159a789b8b9
Author: fu@mips.com
2012-07-30 20:12:46 -07:00
David 'Digit' Turner
ce0d646cc0 resolved conflicts for merge of 6cda7b62 to gingerbread-plus-aosp
Change-Id: I85bd5291c2a9cd29bff538b6d5a4dcd73f85a1fd
2011-09-30 05:56:51 +02:00
Bruce Beare
6cda7b6249 Bionic: x86: Fix libm macro definitions
http://code.google.com/p/android/issues/detail?id=19276

GCC would remove inline asm due to lack of knowledge
of FPU register changes.

Change-Id: I9f9e8623fa6580843b7cd8178439ace8c2db2d51
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Author: Jingwei Zhang <jingwei.zhang@intel.com>
2011-09-29 17:35:33 +02:00
Bruce Beare
4029e0e7cb Use proper variable typing
Orig-Change-Id: If5c33d90b33f538448ac12e7bee94b4b9173d39c
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
2011-07-07 22:46:15 +02:00
David 'Digit' Turner
8e2ff164cc libm: Add nanf() and tgammaf() implementations.
Requested by b/3370708 to export these through RenderScript.

Change-Id: I1ae69f87a1ad4765b2dee8e4a6f2f3a6eb7c5ad4
2011-01-25 17:07:26 +01:00
Chih-Wei Huang
b9aedb2c57 android-x86: use proper variable typing
Change-Id: Iff99932acd2f6cb482fc5da9ff586d7ab2a8b209
2010-12-23 09:32:12 +08:00
David Turner
48bebaeca8 am 4efbf95d: Merge "Use proper variable typing"
* commit '4efbf95d8c88a3a203d687d9048b51e256ef3641':
  Use proper variable typing
2010-12-07 06:38:26 -08:00
Bruce Beare
58f2b7ed66 Use proper variable typing
Change-Id: If5c33d90b33f538448ac12e7bee94b4b9173d39c
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
2010-10-11 12:34:10 -07:00
David 'Digit' Turner
410b2ae7fb Add sincosl() function to bionic. So that sincos optimization can - DO NOT MERGE
be enabled.

Change-Id: I672cb319689aa4fb3f1f7cd868dda76842bebae9
2010-06-09 14:35:29 -07:00
The Android Open Source Project
1dc9e472e1 auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
The Android Open Source Project
1767f908af auto import from //depot/cupcake/@135843 2009-03-03 18:28:13 -08:00
The Android Open Source Project
a27d2baa0c Initial Contribution 2008-10-21 07:00:00 -07:00