1178580Simp/*- 2178580Simp * Copyright (c) 2002, 2003 David Schultz <das@FreeBSD.ORG> 3178580Simp * All rights reserved. 4178580Simp * 5178580Simp * Redistribution and use in source and binary forms, with or without 6178580Simp * modification, are permitted provided that the following conditions 7178580Simp * are met: 8178580Simp * 1. Redistributions of source code must retain the above copyright 9178580Simp * notice, this list of conditions and the following disclaimer. 10178580Simp * 2. Redistributions in binary form must reproduce the above copyright 11178580Simp * notice, this list of conditions and the following disclaimer in the 12178580Simp * documentation and/or other materials provided with the distribution. 13178580Simp * 14178580Simp * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15178580Simp * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16178580Simp * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17178580Simp * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18178580Simp * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19178580Simp * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20178580Simp * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21178580Simp * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22178580Simp * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23178580Simp * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24178580Simp * SUCH DAMAGE. 25178580Simp * 26178580Simp * $FreeBSD$ 27178580Simp */ 28178580Simp 29178580Simpunion IEEEl2bits { 30178580Simp long double e; 31178580Simp struct { 32178580Simp#ifndef __MIPSEB__ 33178580Simp unsigned int manl :32; 34178580Simp unsigned int manh :20; 35178580Simp unsigned int exp :11; 36178580Simp unsigned int sign :1; 37178580Simp#else 38178580Simp unsigned int sign :1; 39178580Simp unsigned int exp :11; 40178580Simp unsigned int manh :20; 41178580Simp unsigned int manl :32; 42178580Simp#endif 43178580Simp } bits; 44178580Simp}; 45178580Simp 46178580Simp#define LDBL_NBIT 0 47178580Simp#define mask_nbit_l(u) ((void)0) 48178580Simp#define LDBL_IMPLICIT_NBIT 49178580Simp 50178580Simp#define LDBL_MANH_SIZE 20 51178580Simp#define LDBL_MANL_SIZE 32 52178580Simp 53178580Simp#define LDBL_TO_ARRAY32(u, a) do { \ 54178580Simp (a)[0] = (uint32_t)(u).bits.manl; \ 55178580Simp (a)[1] = (uint32_t)(u).bits.manh; \ 56178580Simp} while(0) 57