xref: /titanic_51/usr/src/cmd/ast/libast/i386/FEATURE/float (revision b4dd7d09880f14016feece03929a224eca1cf39a)
1*b4dd7d09SAndy Fiddaman
2*b4dd7d09SAndy Fiddaman/* : : generated by proto : : */
3*b4dd7d09SAndy Fiddaman/* : : generated from contrib/ast/src/lib/libast/features/float by iffe version 2012-07-17 : : */
4*b4dd7d09SAndy Fiddaman
5*b4dd7d09SAndy Fiddaman#ifndef _def_float_ast
6*b4dd7d09SAndy Fiddaman#if !defined(__PROTO__)
7*b4dd7d09SAndy Fiddaman#  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
8*b4dd7d09SAndy Fiddaman#    if defined(__cplusplus)
9*b4dd7d09SAndy Fiddaman#      define __LINKAGE__	"C"
10*b4dd7d09SAndy Fiddaman#    else
11*b4dd7d09SAndy Fiddaman#      define __LINKAGE__
12*b4dd7d09SAndy Fiddaman#    endif
13*b4dd7d09SAndy Fiddaman#    define __STDARG__
14*b4dd7d09SAndy Fiddaman#    define __PROTO__(x)	x
15*b4dd7d09SAndy Fiddaman#    define __OTORP__(x)
16*b4dd7d09SAndy Fiddaman#    define __PARAM__(n,o)	n
17*b4dd7d09SAndy Fiddaman#    if !defined(__STDC__) && !defined(__cplusplus)
18*b4dd7d09SAndy Fiddaman#      if !defined(c_plusplus)
19*b4dd7d09SAndy Fiddaman#      	define const
20*b4dd7d09SAndy Fiddaman#      endif
21*b4dd7d09SAndy Fiddaman#      define signed
22*b4dd7d09SAndy Fiddaman#      define void		int
23*b4dd7d09SAndy Fiddaman#      define volatile
24*b4dd7d09SAndy Fiddaman#      define __V_		char
25*b4dd7d09SAndy Fiddaman#    else
26*b4dd7d09SAndy Fiddaman#      define __V_		void
27*b4dd7d09SAndy Fiddaman#    endif
28*b4dd7d09SAndy Fiddaman#  else
29*b4dd7d09SAndy Fiddaman#    define __PROTO__(x)	()
30*b4dd7d09SAndy Fiddaman#    define __OTORP__(x)	x
31*b4dd7d09SAndy Fiddaman#    define __PARAM__(n,o)	o
32*b4dd7d09SAndy Fiddaman#    define __LINKAGE__
33*b4dd7d09SAndy Fiddaman#    define __V_		char
34*b4dd7d09SAndy Fiddaman#    define const
35*b4dd7d09SAndy Fiddaman#    define signed
36*b4dd7d09SAndy Fiddaman#    define void		int
37*b4dd7d09SAndy Fiddaman#    define volatile
38*b4dd7d09SAndy Fiddaman#  endif
39*b4dd7d09SAndy Fiddaman#  define __MANGLE__	__LINKAGE__
40*b4dd7d09SAndy Fiddaman#  if defined(__cplusplus) || defined(c_plusplus)
41*b4dd7d09SAndy Fiddaman#    define __VARARG__	...
42*b4dd7d09SAndy Fiddaman#  else
43*b4dd7d09SAndy Fiddaman#    define __VARARG__
44*b4dd7d09SAndy Fiddaman#  endif
45*b4dd7d09SAndy Fiddaman#  if defined(__STDARG__)
46*b4dd7d09SAndy Fiddaman#    define __VA_START__(p,a)	va_start(p,a)
47*b4dd7d09SAndy Fiddaman#  else
48*b4dd7d09SAndy Fiddaman#    define __VA_START__(p,a)	va_start(p)
49*b4dd7d09SAndy Fiddaman#  endif
50*b4dd7d09SAndy Fiddaman#  if !defined(__INLINE__)
51*b4dd7d09SAndy Fiddaman#    if defined(__cplusplus)
52*b4dd7d09SAndy Fiddaman#      define __INLINE__	extern __MANGLE__ inline
53*b4dd7d09SAndy Fiddaman#    else
54*b4dd7d09SAndy Fiddaman#      if defined(_WIN32) && !defined(__GNUC__)
55*b4dd7d09SAndy Fiddaman#      	define __INLINE__	__inline
56*b4dd7d09SAndy Fiddaman#      endif
57*b4dd7d09SAndy Fiddaman#    endif
58*b4dd7d09SAndy Fiddaman#  endif
59*b4dd7d09SAndy Fiddaman#endif
60*b4dd7d09SAndy Fiddaman#if !defined(__LINKAGE__)
61*b4dd7d09SAndy Fiddaman#define __LINKAGE__		/* 2004-08-11 transition */
62*b4dd7d09SAndy Fiddaman#endif
63*b4dd7d09SAndy Fiddaman
64*b4dd7d09SAndy Fiddaman#define _def_float_ast	1
65*b4dd7d09SAndy Fiddaman#define _sys_types	1	/* #include <sys/types.h> ok */
66*b4dd7d09SAndy Fiddaman#define _hdr_float	1	/* #include <float.h> ok */
67*b4dd7d09SAndy Fiddaman#define _hdr_limits	1	/* #include <limits.h> ok */
68*b4dd7d09SAndy Fiddaman#define _hdr_math	1	/* #include <math.h> ok */
69*b4dd7d09SAndy Fiddaman#define _hdr_values	1	/* #include <values.h> ok */
70*b4dd7d09SAndy Fiddaman#define _LIB_m	1	/* -lm is a library */
71*b4dd7d09SAndy Fiddaman#define _lib_frexp	1	/* frexp() in default lib(s) */
72*b4dd7d09SAndy Fiddaman#define _lib_frexpl	1	/* frexpl() in default lib(s) */
73*b4dd7d09SAndy Fiddaman#define _lib_ldexp	1	/* ldexp() in default lib(s) */
74*b4dd7d09SAndy Fiddaman#define _lib_ldexpl	1	/* ldexpl() in default lib(s) */
75*b4dd7d09SAndy Fiddaman#define _lib_finite	1	/* finite() in default lib(s) */
76*b4dd7d09SAndy Fiddaman#define _lib_isnanl	1	/* isnanl() in default lib(s) */
77*b4dd7d09SAndy Fiddaman#define _lib_copysign	1	/* copysign() in default lib(s) */
78*b4dd7d09SAndy Fiddaman#define _lib_copysignl	1	/* copysignl() in default lib(s) */
79*b4dd7d09SAndy Fiddaman#define _npt_finite	1	/* finite() needs a prototype */
80*b4dd7d09SAndy Fiddaman#define _npt_finitel	1	/* finitel() needs a prototype */
81*b4dd7d09SAndy Fiddaman#define _npt_isinfl	1	/* isinfl() needs a prototype */
82*b4dd7d09SAndy Fiddaman#define _lib_fpclassify	1	/* fpclassify present and works */
83*b4dd7d09SAndy Fiddaman#define _lib_isinf	1	/* isinf present and works */
84*b4dd7d09SAndy Fiddaman#define _lib_isnan	1	/* isnan present and works */
85*b4dd7d09SAndy Fiddaman#define _lib_signbit	1	/* signbit present and works */
86*b4dd7d09SAndy Fiddaman#include <ast_common.h>
87*b4dd7d09SAndy Fiddaman#include <float.h>
88*b4dd7d09SAndy Fiddaman#include <math.h>
89*b4dd7d09SAndy Fiddaman#ifndef FLT_DIG
90*b4dd7d09SAndy Fiddaman#define FLT_DIG 6
91*b4dd7d09SAndy Fiddaman#endif
92*b4dd7d09SAndy Fiddaman#ifndef FLT_MAX
93*b4dd7d09SAndy Fiddaman#define FLT_MAX 3.4028234663852885981170E+38F
94*b4dd7d09SAndy Fiddaman#endif
95*b4dd7d09SAndy Fiddaman#ifndef FLT_MAX_10_EXP
96*b4dd7d09SAndy Fiddaman#define FLT_MAX_10_EXP (+38)
97*b4dd7d09SAndy Fiddaman#endif
98*b4dd7d09SAndy Fiddaman#ifndef FLT_MAX_EXP
99*b4dd7d09SAndy Fiddaman#define FLT_MAX_EXP (+128)
100*b4dd7d09SAndy Fiddaman#endif
101*b4dd7d09SAndy Fiddaman#ifndef FLT_MIN
102*b4dd7d09SAndy Fiddaman#define FLT_MIN 1.1754943508222875079688E-38F
103*b4dd7d09SAndy Fiddaman#endif
104*b4dd7d09SAndy Fiddaman#ifndef FLT_MIN_10_EXP
105*b4dd7d09SAndy Fiddaman#define FLT_MIN_10_EXP (-37)
106*b4dd7d09SAndy Fiddaman#endif
107*b4dd7d09SAndy Fiddaman#ifndef FLT_MIN_EXP
108*b4dd7d09SAndy Fiddaman#define FLT_MIN_EXP (-125)
109*b4dd7d09SAndy Fiddaman#endif
110*b4dd7d09SAndy Fiddaman#ifndef DBL_DIG
111*b4dd7d09SAndy Fiddaman#define DBL_DIG 15
112*b4dd7d09SAndy Fiddaman#endif
113*b4dd7d09SAndy Fiddaman#ifndef DBL_MAX
114*b4dd7d09SAndy Fiddaman#define DBL_MAX 1.7976931348623157081452E+308
115*b4dd7d09SAndy Fiddaman#endif
116*b4dd7d09SAndy Fiddaman#ifndef DBL_MAX_10_EXP
117*b4dd7d09SAndy Fiddaman#define DBL_MAX_10_EXP (+308)
118*b4dd7d09SAndy Fiddaman#endif
119*b4dd7d09SAndy Fiddaman#ifndef DBL_MAX_EXP
120*b4dd7d09SAndy Fiddaman#define DBL_MAX_EXP (+1024)
121*b4dd7d09SAndy Fiddaman#endif
122*b4dd7d09SAndy Fiddaman#ifndef DBL_MIN
123*b4dd7d09SAndy Fiddaman#define DBL_MIN 2.2250738585072013830903E-308
124*b4dd7d09SAndy Fiddaman#endif
125*b4dd7d09SAndy Fiddaman#ifndef DBL_MIN_10_EXP
126*b4dd7d09SAndy Fiddaman#define DBL_MIN_10_EXP (-307)
127*b4dd7d09SAndy Fiddaman#endif
128*b4dd7d09SAndy Fiddaman#ifndef DBL_MIN_EXP
129*b4dd7d09SAndy Fiddaman#define DBL_MIN_EXP (-1021)
130*b4dd7d09SAndy Fiddaman#endif
131*b4dd7d09SAndy Fiddaman#ifndef LDBL_DIG
132*b4dd7d09SAndy Fiddaman#define LDBL_DIG 18
133*b4dd7d09SAndy Fiddaman#endif
134*b4dd7d09SAndy Fiddaman#ifndef LDBL_MAX
135*b4dd7d09SAndy Fiddaman#define LDBL_MAX 1.1897314953572317650213E+4932L
136*b4dd7d09SAndy Fiddaman#endif
137*b4dd7d09SAndy Fiddaman#ifndef LDBL_MAX_10_EXP
138*b4dd7d09SAndy Fiddaman#define LDBL_MAX_10_EXP (+4932)
139*b4dd7d09SAndy Fiddaman#endif
140*b4dd7d09SAndy Fiddaman#ifndef LDBL_MAX_EXP
141*b4dd7d09SAndy Fiddaman#define LDBL_MAX_EXP (+16384)
142*b4dd7d09SAndy Fiddaman#endif
143*b4dd7d09SAndy Fiddaman#ifndef LDBL_MIN
144*b4dd7d09SAndy Fiddaman#define LDBL_MIN 3.3621031431120935062627E-4932L
145*b4dd7d09SAndy Fiddaman#endif
146*b4dd7d09SAndy Fiddaman#ifndef LDBL_MIN_10_EXP
147*b4dd7d09SAndy Fiddaman#define LDBL_MIN_10_EXP (-4931)
148*b4dd7d09SAndy Fiddaman#endif
149*b4dd7d09SAndy Fiddaman#ifndef LDBL_MIN_EXP
150*b4dd7d09SAndy Fiddaman#define LDBL_MIN_EXP (-16381)
151*b4dd7d09SAndy Fiddaman#endif
152*b4dd7d09SAndy Fiddaman
153*b4dd7d09SAndy Fiddaman
154*b4dd7d09SAndy Fiddaman#define USHRT_DIG		4
155*b4dd7d09SAndy Fiddaman#define UINT_DIG		9
156*b4dd7d09SAndy Fiddaman#define ULONG_DIG		9
157*b4dd7d09SAndy Fiddaman#define ULLONG_DIG		19
158*b4dd7d09SAndy Fiddaman#define UINTMAX_DIG		ULLONG_DIG
159*b4dd7d09SAndy Fiddaman
160*b4dd7d09SAndy Fiddaman#define FLT_ULONG_MAX		4294967295.0F
161*b4dd7d09SAndy Fiddaman#define FLT_ULLONG_MAX		18446744073709551615.0F
162*b4dd7d09SAndy Fiddaman#define FLT_UINTMAX_MAX		FLT_ULLONG_MAX
163*b4dd7d09SAndy Fiddaman#define FLT_LONG_MAX		2147483647.0F
164*b4dd7d09SAndy Fiddaman#define FLT_LLONG_MAX		9223372036854775807.0F
165*b4dd7d09SAndy Fiddaman#define FLT_INTMAX_MAX		FLT_LLONG_MAX
166*b4dd7d09SAndy Fiddaman#define FLT_LONG_MIN		(-2147483648.0F)
167*b4dd7d09SAndy Fiddaman#define FLT_LLONG_MIN		(-9223372036854775808.0F)
168*b4dd7d09SAndy Fiddaman#define FLT_INTMAX_MIN		FLT_LLONG_MIN
169*b4dd7d09SAndy Fiddaman
170*b4dd7d09SAndy Fiddaman#define DBL_ULONG_MAX		4294967295.0
171*b4dd7d09SAndy Fiddaman#define DBL_ULLONG_MAX		18446744073709551615.0
172*b4dd7d09SAndy Fiddaman#define DBL_UINTMAX_MAX		DBL_ULLONG_MAX
173*b4dd7d09SAndy Fiddaman#define DBL_LONG_MAX		2147483647.0
174*b4dd7d09SAndy Fiddaman#define DBL_LLONG_MAX		9223372036854775807.0
175*b4dd7d09SAndy Fiddaman#define DBL_INTMAX_MAX		DBL_LLONG_MAX
176*b4dd7d09SAndy Fiddaman#define DBL_LONG_MIN		(-2147483648.0)
177*b4dd7d09SAndy Fiddaman#define DBL_LLONG_MIN		(-9223372036854775808.0)
178*b4dd7d09SAndy Fiddaman#define DBL_INTMAX_MIN		DBL_LLONG_MIN
179*b4dd7d09SAndy Fiddaman
180*b4dd7d09SAndy Fiddaman#define LDBL_ULONG_MAX		4294967295.0L
181*b4dd7d09SAndy Fiddaman#define LDBL_ULLONG_MAX		18446744073709551615.0L
182*b4dd7d09SAndy Fiddaman#define LDBL_UINTMAX_MAX	LDBL_ULLONG_MAX
183*b4dd7d09SAndy Fiddaman#define LDBL_LONG_MAX		2147483647.0L
184*b4dd7d09SAndy Fiddaman#define LDBL_LLONG_MAX		9223372036854775807.0L
185*b4dd7d09SAndy Fiddaman#define LDBL_INTMAX_MAX		LDBL_LLONG_MAX
186*b4dd7d09SAndy Fiddaman#define LDBL_LONG_MIN		(-2147483648.0L)
187*b4dd7d09SAndy Fiddaman#define LDBL_LLONG_MIN		(-9223372036854775808.0L)
188*b4dd7d09SAndy Fiddaman#define LDBL_INTMAX_MIN		LDBL_LLONG_MIN
189*b4dd7d09SAndy Fiddaman
190*b4dd7d09SAndy Fiddaman#define FLTMAX_UINTMAX_MAX	LDBL_UINTMAX_MAX
191*b4dd7d09SAndy Fiddaman#define FLTMAX_INTMAX_MAX	LDBL_INTMAX_MAX
192*b4dd7d09SAndy Fiddaman#define FLTMAX_INTMAX_MIN	LDBL_INTMAX_MIN
193*b4dd7d09SAndy Fiddaman
194*b4dd7d09SAndy Fiddamantypedef union _ast_dbl_exp_u
195*b4dd7d09SAndy Fiddaman{
196*b4dd7d09SAndy Fiddaman	uint32_t		e[sizeof(double)/4];
197*b4dd7d09SAndy Fiddaman	double			f;
198*b4dd7d09SAndy Fiddaman} _ast_dbl_exp_t;
199*b4dd7d09SAndy Fiddaman
200*b4dd7d09SAndy Fiddaman#define _ast_dbl_exp_index	1
201*b4dd7d09SAndy Fiddaman#define _ast_dbl_exp_shift	20
202*b4dd7d09SAndy Fiddaman
203*b4dd7d09SAndy Fiddamantypedef union _fltmax_exp_u
204*b4dd7d09SAndy Fiddaman{
205*b4dd7d09SAndy Fiddaman	uint32_t		e[sizeof(_ast_fltmax_t)/4];
206*b4dd7d09SAndy Fiddaman	_ast_fltmax_t		f;
207*b4dd7d09SAndy Fiddaman} _ast_fltmax_exp_t;
208*b4dd7d09SAndy Fiddaman
209*b4dd7d09SAndy Fiddaman#define _ast_fltmax_exp_index	2
210*b4dd7d09SAndy Fiddaman#define _ast_fltmax_exp_shift	0
211*b4dd7d09SAndy Fiddaman
212*b4dd7d09SAndy Fiddaman#define _ast_flt_unsigned_max_t	unsigned long long
213*b4dd7d09SAndy Fiddaman#define _ast_flt_nan_init	0xff,0xff,0xff,0x7f
214*b4dd7d09SAndy Fiddaman#define _ast_flt_inf_init	0x00,0x00,0x80,0x7f
215*b4dd7d09SAndy Fiddaman#define _ast_dbl_nan_init	0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f
216*b4dd7d09SAndy Fiddaman#define _ast_dbl_inf_init	0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x7f
217*b4dd7d09SAndy Fiddaman#define _ast_ldbl_nan_init	0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00
218*b4dd7d09SAndy Fiddaman#define _ast_ldbl_inf_init	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0x7f,0x00,0x00
219*b4dd7d09SAndy Fiddaman#endif
220