1 /* ieee754 floating point arithmetic
2 * single and double precision
6 * doesn't generate IEEE754_INEXACT
10 * MIPS floating point support
11 * Copyright (C) 1994-2000 Algorithmics Ltd.
13 * This program is free software; you can distribute it and/or modify it
14 * under the terms of the GNU General Public License (Version 2) as
15 * published by the Free Software Foundation.
17 * This program is distributed in the hope it will be useful, but WITHOUT
18 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 * You should have received a copy of the GNU General Public License along
23 * with this program; if not, write to the Free Software Foundation, Inc.,
24 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
27 #include <linux/compiler.h>
30 #include "ieee754sp.h"
31 #include "ieee754dp.h"
38 * Older GCC requires the inner braces for initialization of union ieee754dp's
39 * anonymous struct member. Without an error will result.
41 #define DPCNST(s, b, m) \
45 .bexp = (b) + DP_EBIAS, \
50 const union ieee754dp __ieee754dp_spcvals[] = {
51 DPCNST(0, DP_EMIN - 1, 0x0000000000000ULL), /* + zero */
52 DPCNST(1, DP_EMIN - 1, 0x0000000000000ULL), /* - zero */
53 DPCNST(0, 0, 0x0000000000000ULL), /* + 1.0 */
54 DPCNST(1, 0, 0x0000000000000ULL), /* - 1.0 */
55 DPCNST(0, 3, 0x4000000000000ULL), /* + 10.0 */
56 DPCNST(1, 3, 0x4000000000000ULL), /* - 10.0 */
57 DPCNST(0, DP_EMAX + 1, 0x0000000000000ULL), /* + infinity */
58 DPCNST(1, DP_EMAX + 1, 0x0000000000000ULL), /* - infinity */
59 DPCNST(0, DP_EMAX + 1, 0x7FFFFFFFFFFFFULL), /* + indef quiet Nan */
60 DPCNST(0, DP_EMAX, 0xFFFFFFFFFFFFFULL), /* + max */
61 DPCNST(1, DP_EMAX, 0xFFFFFFFFFFFFFULL), /* - max */
62 DPCNST(0, DP_EMIN, 0x0000000000000ULL), /* + min normal */
63 DPCNST(1, DP_EMIN, 0x0000000000000ULL), /* - min normal */
64 DPCNST(0, DP_EMIN - 1, 0x0000000000001ULL), /* + min denormal */
65 DPCNST(1, DP_EMIN - 1, 0x0000000000001ULL), /* - min denormal */
66 DPCNST(0, 31, 0x0000000000000ULL), /* + 1.0e31 */
67 DPCNST(0, 63, 0x0000000000000ULL), /* + 1.0e63 */
71 * Older GCC requires the inner braces for initialization of union ieee754sp's
72 * anonymous struct member. Without an error will result.
74 #define SPCNST(s, b, m) \
78 .bexp = (b) + SP_EBIAS, \
83 const union ieee754sp __ieee754sp_spcvals[] = {
84 SPCNST(0, SP_EMIN - 1, 0x000000), /* + zero */
85 SPCNST(1, SP_EMIN - 1, 0x000000), /* - zero */
86 SPCNST(0, 0, 0x000000), /* + 1.0 */
87 SPCNST(1, 0, 0x000000), /* - 1.0 */
88 SPCNST(0, 3, 0x200000), /* + 10.0 */
89 SPCNST(1, 3, 0x200000), /* - 10.0 */
90 SPCNST(0, SP_EMAX + 1, 0x000000), /* + infinity */
91 SPCNST(1, SP_EMAX + 1, 0x000000), /* - infinity */
92 SPCNST(0, SP_EMAX + 1, 0x3FFFFF), /* + indef quiet Nan */
93 SPCNST(0, SP_EMAX, 0x7FFFFF), /* + max normal */
94 SPCNST(1, SP_EMAX, 0x7FFFFF), /* - max normal */
95 SPCNST(0, SP_EMIN, 0x000000), /* + min normal */
96 SPCNST(1, SP_EMIN, 0x000000), /* - min normal */
97 SPCNST(0, SP_EMIN - 1, 0x000001), /* + min denormal */
98 SPCNST(1, SP_EMIN - 1, 0x000001), /* - min denormal */
99 SPCNST(0, 31, 0x000000), /* + 1.0e31 */
100 SPCNST(0, 63, 0x000000), /* + 1.0e63 */