blob: f75ec7b678fafe3dbd29e5625db257d4fd3dc641 [file] [log] [blame]
Shin-ichiro KAWASAKId87945b2009-08-31 16:25:42 +09001/*
2 * Copyright (C) 2009 Android Open Source Project, All rights reserved.
3 * Derived from "bionic/libm/arm/_fpmath.h"
4 * Copyright (c) 2002, 2003 David Schultz <das@FreeBSD.ORG>
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * * Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in
13 * the documentation and/or other materials provided with the
14 * distribution.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
19 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
20 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
22 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
23 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
24 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
26 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30/*
31 * Assumes that 'long double' on SH-linux is just an alias for 'double'.
32 */
33union IEEEl2bits {
34 long double e;
35 struct {
36#if __BYTE_ORDER == __LITTLE_ENDIAN
37 unsigned int manl :32;
38 unsigned int manh :20;
39 unsigned int exp :11;
40 unsigned int sign :1;
41#elif __BYTE_ORDER == __BIG_ENDIAN
42 unsigned int sign :1;
43 unsigned int exp :11;
44 unsigned int manh :20;
45 unsigned int manl :32;
46#endif
47 } bits;
48};
49
50/*
51 * LDBL_NBIT is a mask indicating the position of the integer
52 * bit in a long double. But SH4 does not support it.
53 */
54#define LDBL_NBIT 0
55#define mask_nbit_l(u) ((void)0)
56
57#define LDBL_MANH_SIZE 20
58#define LDBL_MANL_SIZE 32