summaryrefslogtreecommitdiffstats
path: root/libm/arm
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2013-01-30 19:06:37 -0800
committerElliott Hughes <enh@google.com>2013-02-01 14:51:19 -0800
commita0ee07829a9ba7e99ef68e8c12551301cc797f0f (patch)
treefefc432ee572779579a16d2868d4181a33399281 /libm/arm
parenta990cf5b3392c5aef767aee1e67b4d7ef651afc6 (diff)
downloadbionic-a0ee07829a9ba7e99ef68e8c12551301cc797f0f.zip
bionic-a0ee07829a9ba7e99ef68e8c12551301cc797f0f.tar.gz
bionic-a0ee07829a9ba7e99ef68e8c12551301cc797f0f.tar.bz2
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
Diffstat (limited to 'libm/arm')
-rw-r--r--libm/arm/_fpmath.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/libm/arm/_fpmath.h b/libm/arm/_fpmath.h
index 79e4346..4c18945 100644
--- a/libm/arm/_fpmath.h
+++ b/libm/arm/_fpmath.h
@@ -23,18 +23,29 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/lib/libc/arm/_fpmath.h,v 1.4 2005/03/20 00:53:52 cognet Exp $
+ * $FreeBSD$
*/
+#if defined(__VFP_FP__)
+#define _IEEE_WORD_ORDER _BYTE_ORDER
+#else
+#define _IEEE_WORD_ORDER _BIG_ENDIAN
+#endif
+
union IEEEl2bits {
long double e;
struct {
-#ifndef __ARMEB__
+#if _BYTE_ORDER == _LITTLE_ENDIAN
+#if _IEEE_WORD_ORDER == _LITTLE_ENDIAN
unsigned int manl :32;
+#endif
unsigned int manh :20;
unsigned int exp :11;
unsigned int sign :1;
-#else
+#if _IEEE_WORD_ORDER == _BIG_ENDIAN
+ unsigned int manl :32;
+#endif
+#else /* _BYTE_ORDER == _LITTLE_ENDIAN */
unsigned int sign :1;
unsigned int exp :11;
unsigned int manh :20;
@@ -44,9 +55,10 @@ union IEEEl2bits {
};
#define LDBL_NBIT 0
+#define LDBL_IMPLICIT_NBIT
#define mask_nbit_l(u) ((void)0)
-#define LDBL_MANH_SIZE 32
+#define LDBL_MANH_SIZE 20
#define LDBL_MANL_SIZE 32
#define LDBL_TO_ARRAY32(u, a) do { \