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
16 unsigned int empty
:16;
20 } ieee_long_double_shape_type
;
24 #if __FLOAT_WORD_ORDER == LITTLE_ENDIAN
34 unsigned int empty
:16;
36 } ieee_long_double_shape_type
;
40 /* Get three 32 bit ints from a double. */
42 #define GET_LDOUBLE_WORDS(exp,ix0,ix1,d) \
44 ieee_long_double_shape_type ew_u; \
46 (exp) = ew_u.parts.sign_exponent; \
47 (ix0) = ew_u.parts.msw; \
48 (ix1) = ew_u.parts.lsw; \
51 /* Set a double from two 32 bit ints. */
53 #define SET_LDOUBLE_WORDS(d,exp,ix0,ix1) \
55 ieee_long_double_shape_type iw_u; \
56 iw_u.parts.sign_exponent = (exp); \
57 iw_u.parts.msw = (ix0); \
58 iw_u.parts.lsw = (ix1); \
62 /* Get the more significant 32 bits of a long double mantissa. */
64 #define GET_LDOUBLE_MSW(v,d) \
66 ieee_long_double_shape_type sh_u; \
68 (v) = sh_u.parts.msw; \
71 /* Set the more significant 32 bits of a long double mantissa from an int. */
73 #define SET_LDOUBLE_MSW(d,v) \
75 ieee_long_double_shape_type sh_u; \
77 sh_u.parts.msw = (v); \
81 /* Get int from the exponent of a long double. */
83 #define GET_LDOUBLE_EXP(exp,d) \
85 ieee_long_double_shape_type ge_u; \
87 (exp) = ge_u.parts.sign_exponent; \
90 /* Set exponent of a long double from an int. */
92 #define SET_LDOUBLE_EXP(d,exp) \
94 ieee_long_double_shape_type se_u; \
96 se_u.parts.sign_exponent = (exp); \