ieee.h (d8315c79d932951f2db396014e28ffa03a31b850) ieee.h (74aed9855d18f91a1a2b22bd649f278bc4634acc)
1/* $NetBSD: ieee754.h,v 1.4 2003/10/27 02:30:26 simonb Exp $ */
2
3/*-
4 * Copyright (c) 1992, 1993
5 * The Regents of the University of California. All rights reserved.
6 *
7 * This software was developed by the Computer Systems Engineering group
8 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and

--- 77 unchanged lines hidden (view full) ---

86 * -149 == -127 - 23 + 1.
87 */
88#define SNG_EXPBITS 8
89#define SNG_FRACBITS 23
90
91#define DBL_EXPBITS 11
92#define DBL_FRACBITS 52
93
1/* $NetBSD: ieee754.h,v 1.4 2003/10/27 02:30:26 simonb Exp $ */
2
3/*-
4 * Copyright (c) 1992, 1993
5 * The Regents of the University of California. All rights reserved.
6 *
7 * This software was developed by the Computer Systems Engineering group
8 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and

--- 77 unchanged lines hidden (view full) ---

86 * -149 == -127 - 23 + 1.
87 */
88#define SNG_EXPBITS 8
89#define SNG_FRACBITS 23
90
91#define DBL_EXPBITS 11
92#define DBL_FRACBITS 52
93
94#if defined(__VFP_FP__)
95#define _IEEE_WORD_ORDER _BYTE_ORDER
96#else
97#define _IEEE_WORD_ORDER _BIG_ENDIAN
98#endif
99
94struct ieee_single {
95#if _BYTE_ORDER == _BIG_ENDIAN
96 u_int sng_sign:1;
97 u_int sng_exp:8;
98 u_int sng_frac:23;
99#else
100 u_int sng_frac:23;
101 u_int sng_exp:8;
102 u_int sng_sign:1;
103#endif
104};
105
106struct ieee_double {
107#if _BYTE_ORDER == _BIG_ENDIAN
108 u_int dbl_sign:1;
109 u_int dbl_exp:11;
110 u_int dbl_frach:20;
111 u_int dbl_fracl;
112#else
100struct ieee_single {
101#if _BYTE_ORDER == _BIG_ENDIAN
102 u_int sng_sign:1;
103 u_int sng_exp:8;
104 u_int sng_frac:23;
105#else
106 u_int sng_frac:23;
107 u_int sng_exp:8;
108 u_int sng_sign:1;
109#endif
110};
111
112struct ieee_double {
113#if _BYTE_ORDER == _BIG_ENDIAN
114 u_int dbl_sign:1;
115 u_int dbl_exp:11;
116 u_int dbl_frach:20;
117 u_int dbl_fracl;
118#else
119#if _IEEE_WORD_ORDER == _LITTLE_ENDIAN
113 u_int dbl_fracl;
120 u_int dbl_fracl;
121#endif
114 u_int dbl_frach:20;
115 u_int dbl_exp:11;
116 u_int dbl_sign:1;
122 u_int dbl_frach:20;
123 u_int dbl_exp:11;
124 u_int dbl_sign:1;
125#if _IEEE_WORD_ORDER == _BIG_ENDIAN
126 u_int dbl_fracl;
127#endif
117#endif
118};
119
120/*
121 * Floats whose exponent is in [1..INFNAN) (of whatever type) are
122 * `normal'. Floats whose exponent is INFNAN are either Inf or NaN.
123 * Floats whose exponent is zero are either zero (iff all fraction
124 * bits are zero) or subnormal values.

--- 30 unchanged lines hidden ---
128#endif
129};
130
131/*
132 * Floats whose exponent is in [1..INFNAN) (of whatever type) are
133 * `normal'. Floats whose exponent is INFNAN are either Inf or NaN.
134 * Floats whose exponent is zero are either zero (iff all fraction
135 * bits are zero) or subnormal values.

--- 30 unchanged lines hidden ---