HFtype __floatuntihf (UTItype i) { FP_DECL_EX; FP_DECL_H (A); HFtype a; FP_INIT_ROUNDMODE; FP_FROM_INT_H (A, i, TI_BITS, UTItype); FP_PACK_RAW_H (a, A); FP_HANDLE_EXCEPTIONS; return a; }
TItype __fixhfti (HFtype a) { FP_DECL_EX; FP_DECL_H (A); UTItype r; FP_INIT_EXCEPTIONS; FP_UNPACK_RAW_H (A, a); FP_TO_INT_H (r, A, TI_BITS, 1); FP_HANDLE_EXCEPTIONS; return r; }
TFtype __extendhftf2 (HFtype a) { FP_DECL_EX; FP_DECL_H (A); FP_DECL_Q (R); TFtype r; FP_INIT_EXCEPTIONS; FP_UNPACK_RAW_H (A, a); #if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q FP_EXTEND (Q, H, 4, 1, R, A); #else FP_EXTEND (Q, H, 2, 1, R, A); #endif FP_PACK_RAW_Q (r, R); FP_HANDLE_EXCEPTIONS; return r; }
HFtype __trunctfhf2 (TFtype a) { FP_DECL_EX; FP_DECL_Q (A); FP_DECL_H (R); HFtype r; FP_INIT_ROUNDMODE; FP_UNPACK_SEMIRAW_Q (A, a); #if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q FP_TRUNC (H, Q, 1, 4, R, A); #else FP_TRUNC (H, Q, 1, 2, R, A); #endif FP_PACK_SEMIRAW_H (r, R); FP_HANDLE_EXCEPTIONS; return r; }