From cabae62b0ba1d31f524c393e294d3a5e08d543fc Mon Sep 17 00:00:00 2001 From: marcel Date: Tue, 23 Dec 2008 22:20:59 +0000 Subject: Add support for the FPA floating-point format on ARM. The FPA floating-point format is identical to the VFP format, but is always stored in big-endian. Introduce _IEEE_WORD_ORDER to describe the byte-order of the FP representation. Obtained from: Juniper Networks, Inc --- lib/libc/arm/_fpmath.h | 15 +++++++++++++-- lib/libc/arm/arith.h | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) (limited to 'lib/libc/arm') diff --git a/lib/libc/arm/_fpmath.h b/lib/libc/arm/_fpmath.h index 98d7832..b0ce8f4 100644 --- a/lib/libc/arm/_fpmath.h +++ b/lib/libc/arm/_fpmath.h @@ -26,15 +26,26 @@ * $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; diff --git a/lib/libc/arm/arith.h b/lib/libc/arm/arith.h index e6f1da0..be78d86 100644 --- a/lib/libc/arm/arith.h +++ b/lib/libc/arm/arith.h @@ -11,7 +11,7 @@ * architecture. See contrib/gdtoa/gdtoaimp.h for details. */ -#ifndef __ARMEB__ +#if !defined(__ARMEB__) && defined(__VFP_FP__) #define IEEE_8087 #define Arith_Kind_ASL 1 #define Sudden_Underflow -- cgit v1.1