From owner-svn-src-all@FreeBSD.ORG Tue Dec 23 22:20:59 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C49931065675; Tue, 23 Dec 2008 22:20:59 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B216E8FC13; Tue, 23 Dec 2008 22:20:59 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBNMKxSE015138; Tue, 23 Dec 2008 22:20:59 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBNMKx62015133; Tue, 23 Dec 2008 22:20:59 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200812232220.mBNMKx62015133@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 23 Dec 2008 22:20:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186461 - in head: lib/libc/arm lib/libc/include lib/msun/src sys/arm/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Dec 2008 22:21:00 -0000 Author: marcel Date: Tue Dec 23 22:20:59 2008 New Revision: 186461 URL: http://svn.freebsd.org/changeset/base/186461 Log: 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 Modified: head/lib/libc/arm/_fpmath.h head/lib/libc/arm/arith.h head/lib/libc/include/fpmath.h head/lib/msun/src/math_private.h head/sys/arm/include/ieee.h Modified: head/lib/libc/arm/_fpmath.h ============================================================================== --- head/lib/libc/arm/_fpmath.h Tue Dec 23 21:07:57 2008 (r186460) +++ head/lib/libc/arm/_fpmath.h Tue Dec 23 22:20:59 2008 (r186461) @@ -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; Modified: head/lib/libc/arm/arith.h ============================================================================== --- head/lib/libc/arm/arith.h Tue Dec 23 21:07:57 2008 (r186460) +++ head/lib/libc/arm/arith.h Tue Dec 23 22:20:59 2008 (r186461) @@ -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 Modified: head/lib/libc/include/fpmath.h ============================================================================== --- head/lib/libc/include/fpmath.h Tue Dec 23 21:07:57 2008 (r186460) +++ head/lib/libc/include/fpmath.h Tue Dec 23 22:20:59 2008 (r186461) @@ -30,6 +30,10 @@ #include #include "_fpmath.h" +#ifndef _IEEE_WORD_ORDER +#define _IEEE_WORD_ORDER _BYTE_ORDER +#endif + union IEEEf2bits { float f; struct { @@ -52,10 +56,15 @@ union IEEEd2bits { double d; struct { #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; +#if _IEEE_WORD_ORDER == _BIG_ENDIAN + unsigned int manl :32; +#endif #else /* _BIG_ENDIAN */ unsigned int sign :1; unsigned int exp :11; Modified: head/lib/msun/src/math_private.h ============================================================================== --- head/lib/msun/src/math_private.h Tue Dec 23 21:07:57 2008 (r186460) +++ head/lib/msun/src/math_private.h Tue Dec 23 22:20:59 2008 (r186461) @@ -38,7 +38,17 @@ * ints. */ -#if BYTE_ORDER == BIG_ENDIAN +#ifdef __arm__ +#if defined(__VFP_FP__) +#define IEEE_WORD_ORDER BYTE_ORDER +#else +#define IEEE_WORD_ORDER BIG_ENDIAN +#endif +#else /* __arm__ */ +#define IEEE_WORD_ORDER BYTE_ORDER +#endif + +#if IEEE_WORD_ORDER == BIG_ENDIAN typedef union { @@ -52,7 +62,7 @@ typedef union #endif -#if BYTE_ORDER == LITTLE_ENDIAN +#if IEEE_WORD_ORDER == LITTLE_ENDIAN typedef union { Modified: head/sys/arm/include/ieee.h ============================================================================== --- head/sys/arm/include/ieee.h Tue Dec 23 21:07:57 2008 (r186460) +++ head/sys/arm/include/ieee.h Tue Dec 23 22:20:59 2008 (r186461) @@ -91,6 +91,12 @@ #define DBL_EXPBITS 11 #define DBL_FRACBITS 52 +#if defined(__VFP_FP__) +#define _IEEE_WORD_ORDER _BYTE_ORDER +#else +#define _IEEE_WORD_ORDER _BIG_ENDIAN +#endif + struct ieee_single { #if _BYTE_ORDER == _BIG_ENDIAN u_int sng_sign:1; @@ -110,10 +116,15 @@ struct ieee_double { u_int dbl_frach:20; u_int dbl_fracl; #else +#if _IEEE_WORD_ORDER == _LITTLE_ENDIAN u_int dbl_fracl; +#endif u_int dbl_frach:20; u_int dbl_exp:11; u_int dbl_sign:1; +#if _IEEE_WORD_ORDER == _BIG_ENDIAN + u_int dbl_fracl; +#endif #endif };