summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMartynas Venckus <martynas@cvs.openbsd.org>2011-07-26 11:43:02 +0000
committerMartynas Venckus <martynas@cvs.openbsd.org>2011-07-26 11:43:02 +0000
commitb39a629b2f1ab38dc662e1f681bc4bcddd19440c (patch)
treeee7394cad196ab64219a7aeb59641e79c03e0dae /lib
parent752443ba351ed61c12086c1b8980352e6735940f (diff)
At some point we've switched to the VFP floating-point--unlike FPA
it actually stores floats in natural-endian--therefore the existing checks became wrong. Take into account __VFP_FP__, effectively bringing back the old behavior. This way it will work now, and in the future when some of our platforms are switched to FPA, where it's much faster.
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/gen/ldexp.c6
-rw-r--r--lib/libc/rpc/xdr_float.c6
-rw-r--r--lib/libm/src/math_private.h6
3 files changed, 9 insertions, 9 deletions
diff --git a/lib/libc/gen/ldexp.c b/lib/libc/gen/ldexp.c
index f03eeaf8d6d..3192977332c 100644
--- a/lib/libc/gen/ldexp.c
+++ b/lib/libc/gen/ldexp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldexp.c,v 1.4 2011/07/26 09:24:52 martynas Exp $ */
+/* $OpenBSD: ldexp.c,v 1.5 2011/07/26 11:43:01 martynas Exp $ */
/* @(#)s_scalbn.c 5.1 93/09/24 */
/* @(#)fdlibm.h 5.1 93/09/24 */
/*
@@ -22,7 +22,7 @@
/* Bit fiddling routines copied from msun/src/math_private.h,v 1.15 */
-#if (BYTE_ORDER == BIG_ENDIAN) || defined(__arm__)
+#if (BYTE_ORDER == BIG_ENDIAN) || (defined(__arm__) && !defined(__VFP_FP__))
typedef union
{
@@ -36,7 +36,7 @@ typedef union
#endif
-#if (BYTE_ORDER == LITTLE_ENDIAN) && !defined(__arm__)
+#if (BYTE_ORDER == LITTLE_ENDIAN) && !(defined(__arm__) && !defined(__VFP_FP__))
typedef union
{
diff --git a/lib/libc/rpc/xdr_float.c b/lib/libc/rpc/xdr_float.c
index 155f042177a..f0fd5e0eeb9 100644
--- a/lib/libc/rpc/xdr_float.c
+++ b/lib/libc/rpc/xdr_float.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xdr_float.c,v 1.19 2011/07/26 09:36:25 martynas Exp $ */
+/* $OpenBSD: xdr_float.c,v 1.20 2011/07/26 11:43:01 martynas Exp $ */
/*
* Copyright (c) 2010, Oracle America, Inc.
@@ -210,7 +210,7 @@ xdr_double(XDR *xdrs, double *dp)
case XDR_ENCODE:
#ifdef IEEEFP
i32p = (int32_t *)dp;
-#if (BYTE_ORDER == BIG_ENDIAN) || defined(__arm__)
+#if (BYTE_ORDER == BIG_ENDIAN) || (defined(__arm__) && !defined(__VFP_FP__))
tmpl = *i32p++;
rv = XDR_PUTLONG(xdrs, &tmpl);
if (!rv)
@@ -254,7 +254,7 @@ xdr_double(XDR *xdrs, double *dp)
case XDR_DECODE:
#ifdef IEEEFP
i32p = (int32_t *)dp;
-#if (BYTE_ORDER == BIG_ENDIAN) || defined(__arm__)
+#if (BYTE_ORDER == BIG_ENDIAN) || (defined(__arm__) && !defined(__VFP_FP__))
rv = XDR_GETLONG(xdrs, &tmpl);
*i32p++ = tmpl;
if (!rv)
diff --git a/lib/libm/src/math_private.h b/lib/libm/src/math_private.h
index 2abe14a7c62..522d56c6f7b 100644
--- a/lib/libm/src/math_private.h
+++ b/lib/libm/src/math_private.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: math_private.h,v 1.14 2011/07/26 09:24:52 martynas Exp $ */
+/* $OpenBSD: math_private.h,v 1.15 2011/07/26 11:43:01 martynas Exp $ */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
@@ -226,7 +226,7 @@ do { \
* big endian.
*/
-#if (BYTE_ORDER == BIG_ENDIAN) || defined(__arm__)
+#if (BYTE_ORDER == BIG_ENDIAN) || (defined(__arm__) && !defined(__VFP_FP__))
typedef union
{
@@ -240,7 +240,7 @@ typedef union
#endif
-#if (BYTE_ORDER == LITTLE_ENDIAN) && !defined(__arm__)
+#if (BYTE_ORDER == LITTLE_ENDIAN) && !(defined(__arm__) && !defined(__VFP_FP__))
typedef union
{