1136412Sjkoshy/*- 2136412Sjkoshy * Copyright (c) 2002, 2003 David Schultz <das@FreeBSD.ORG> 3136412Sjkoshy * All rights reserved. 4136412Sjkoshy * 5136412Sjkoshy * Redistribution and use in source and binary forms, with or without 6136412Sjkoshy * modification, are permitted provided that the following conditions 7136412Sjkoshy * are met: 8136412Sjkoshy * 1. Redistributions of source code must retain the above copyright 9136412Sjkoshy * notice, this list of conditions and the following disclaimer. 10136412Sjkoshy * 2. Redistributions in binary form must reproduce the above copyright 11136412Sjkoshy * notice, this list of conditions and the following disclaimer in the 12136412Sjkoshy * documentation and/or other materials provided with the distribution. 13136412Sjkoshy * 14136412Sjkoshy * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15136412Sjkoshy * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16136412Sjkoshy * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17136412Sjkoshy * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18136412Sjkoshy * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19136412Sjkoshy * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20136412Sjkoshy * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21136412Sjkoshy * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22136412Sjkoshy * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23136412Sjkoshy * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24136412Sjkoshy * SUCH DAMAGE. 25136412Sjkoshy * 26136412Sjkoshy * $FreeBSD$ 27136412Sjkoshy */ 28136412Sjkoshy 29136412Sjkoshyunion IEEEl2bits { 30136412Sjkoshy long double e; 31136412Sjkoshy struct { 32235693Sgjb#ifndef __MIPSEB__ 33136412Sjkoshy unsigned int manl :32; 34136412Sjkoshy unsigned int manh :20; 35136412Sjkoshy unsigned int exp :11; 36136412Sjkoshy unsigned int sign :1; 37136412Sjkoshy#else 38136412Sjkoshy unsigned int sign :1; 39136412Sjkoshy unsigned int exp :11; 40136412Sjkoshy unsigned int manh :20; 41166288Sru unsigned int manl :32; 42166288Sru#endif 43166288Sru } bits; 44166022Srrs}; 45136412Sjkoshy 46136412Sjkoshy#define LDBL_NBIT 0 47136412Sjkoshy#define mask_nbit_l(u) ((void)0) 48136412Sjkoshy#define LDBL_IMPLICIT_NBIT 49136412Sjkoshy 50166022Srrs#define LDBL_MANH_SIZE 20 51166288Sru#define LDBL_MANL_SIZE 32 52136412Sjkoshy 53136412Sjkoshy#define LDBL_TO_ARRAY32(u, a) do { \ 54136412Sjkoshy (a)[0] = (uint32_t)(u).bits.manl; \ 55136412Sjkoshy (a)[1] = (uint32_t)(u).bits.manh; \ 56136412Sjkoshy} while(0) 57136412Sjkoshy