1 #ifndef _MATH_PRIVATE_H_
2 #error "Never use <math_ldbl.h> directly; include <math_private.h> instead."
5 /* A union which permits us to convert between a long double and
8 #if __FLOAT_WORD_ORDER == BIG_ENDIAN
15 unsigned int empty0
:32;
17 unsigned int empty1
:16;
21 } ieee_long_double_shape_type
;
25 #if __FLOAT_WORD_ORDER == LITTLE_ENDIAN
35 unsigned int empty1
:16;
36 unsigned int empty0
:32;
38 } ieee_long_double_shape_type
;
42 /* Get three 32 bit ints from a double. */
44 #define GET_LDOUBLE_WORDS(exp,ix0,ix1,d) \
46 ieee_long_double_shape_type ew_u; \
48 (exp) = ew_u.parts.sign_exponent; \
49 (ix0) = ew_u.parts.msw; \
50 (ix1) = ew_u.parts.lsw; \
53 /* Set a double from two 32 bit ints. */
55 #define SET_LDOUBLE_WORDS(d,exp,ix0,ix1) \
57 ieee_long_double_shape_type iw_u; \
58 iw_u.parts.sign_exponent = (exp); \
59 iw_u.parts.msw = (ix0); \
60 iw_u.parts.lsw = (ix1); \
64 /* Get the more significant 32 bits of a long double mantissa. */
66 #define GET_LDOUBLE_MSW(v,d) \
68 ieee_long_double_shape_type sh_u; \
70 (v) = sh_u.parts.msw; \
73 /* Set the more significant 32 bits of a long double mantissa from an int. */
75 #define SET_LDOUBLE_MSW(d,v) \
77 ieee_long_double_shape_type sh_u; \
79 sh_u.parts.msw = (v); \
83 /* Get int from the exponent of a long double. */
85 #define GET_LDOUBLE_EXP(exp,d) \
87 ieee_long_double_shape_type ge_u; \
89 (exp) = ge_u.parts.sign_exponent; \
92 /* Set exponent of a long double from an int. */
94 #define SET_LDOUBLE_EXP(d,exp) \
96 ieee_long_double_shape_type se_u; \
98 se_u.parts.sign_exponent = (exp); \