X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/9385eb3d10ebe5eb398c52040ec3dbfba9b0cdcf..8660941ad630afd60a9b2fc76ce5e8fce4de00d7:/fbsdcompat/_fpmath.h diff --git a/fbsdcompat/_fpmath.h b/fbsdcompat/_fpmath.h index cae427f..fff55b4 100644 --- a/fbsdcompat/_fpmath.h +++ b/fbsdcompat/_fpmath.h @@ -3,8 +3,6 @@ * * @APPLE_LICENSE_HEADER_START@ * - * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. - * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in @@ -47,9 +45,38 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: /repoman/r/ncvs/src/lib/libc/i386/_fpmath.h,v 1.2 2003/04/05 22:10:13 das Exp $ + * $FreeBSD: src/lib/libc/i386/_fpmath.h,v 1.3 2004/01/18 07:57:01 das Exp $ */ +#if defined(__ppc__) || defined(__ppc64__) + +union IEEEl2bits { + long double e; + double d[2]; + struct { + unsigned long long sign :1; + unsigned long long exp :11; + unsigned long long manh :52; + unsigned long long sign2 :1; + unsigned long long exp2 :11; + unsigned long long manl :52; + } bits; +}; + +#define mask_nbit_l(u) ((void)0) +#define LDBL_IMPLICIT_NBIT + +#define LDBL_MANH_SIZE 52 +#define LDBL_MANL_SIZE 53 // includes hidden bit + +#define LDBL_HEAD_TAIL_PAIR + +__private_extern__ void _ldbl2array32dd(union IEEEl2bits, uint32_t *); + +#define LDBL_TO_ARRAY32(u, a) _ldbl2array32dd(u, a) + +#elif defined(__i386__) + union IEEEl2bits { long double e; struct { @@ -63,7 +90,14 @@ union IEEEl2bits { #define mask_nbit_l(u) ((u).bits.manh &= 0x7fffffff) +#define LDBL_MANH_SIZE 32 +#define LDBL_MANL_SIZE 32 + #define LDBL_TO_ARRAY32(u, a) do { \ (a)[0] = (uint32_t)(u).bits.manl; \ (a)[1] = (uint32_t)(u).bits.manh; \ } while(0) + +#else +#error unsupported architecture +#endif