1238106Sdes/*- 2238106Sdes * Copyright (c) 2003 David Schultz <das@FreeBSD.ORG> 3238106Sdes * All rights reserved. 4238106Sdes * 5238106Sdes * Redistribution and use in source and binary forms, with or without 6238106Sdes * modification, are permitted provided that the following conditions 7238106Sdes * are met: 8238106Sdes * 1. Redistributions of source code must retain the above copyright 9238106Sdes * notice, this list of conditions and the following disclaimer. 10238106Sdes * 2. Redistributions in binary form must reproduce the above copyright 11238106Sdes * notice, this list of conditions and the following disclaimer in the 12238106Sdes * documentation and/or other materials provided with the distribution. 13238106Sdes * 14238106Sdes * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15238106Sdes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16238106Sdes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17238106Sdes * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18238106Sdes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19238106Sdes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20238106Sdes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21238106Sdes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22238106Sdes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23238106Sdes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24269257Sdes * SUCH DAMAGE. 25269257Sdes * 26269257Sdes * $FreeBSD: releng/11.0/lib/libc/powerpc/_fpmath.h 296113 2016-02-26 20:38:23Z nwhitehorn $ 27269257Sdes */ 28269257Sdes 29269257Sdesunion IEEEl2bits { 30269257Sdes long double e; 31269257Sdes struct { 32269257Sdes#if _BYTE_ORDER == _LITTLE_ENDIAN 33269257Sdes unsigned int manl :32; 34238106Sdes unsigned int manh :20; 35238106Sdes unsigned int exp :11; 36238106Sdes unsigned int sign :1; 37238106Sdes#else /* _BYTE_ORDER == _LITTLE_ENDIAN */ 38238106Sdes unsigned int sign :1; 39238106Sdes unsigned int exp :11; 40238106Sdes unsigned int manh :20; 41238106Sdes unsigned int manl :32; 42238106Sdes#endif 43238106Sdes } bits; 44238106Sdes}; 45238106Sdes 46238106Sdes#define mask_nbit_l(u) ((void)0) 47238106Sdes#define LDBL_IMPLICIT_NBIT 48238106Sdes#define LDBL_NBIT 0 49238106Sdes 50238106Sdes#define LDBL_MANH_SIZE 20 51238106Sdes#define LDBL_MANL_SIZE 32 52238106Sdes 53238106Sdes#define LDBL_TO_ARRAY32(u, a) do { \ 54238106Sdes (a)[0] = (uint32_t)(u).bits.manl; \ 55238106Sdes (a)[1] = (uint32_t)(u).bits.manh; \ 56238106Sdes} while(0) 57238106Sdes