mirror of
git://sourceware.org/git/glibc.git
synced 2025-02-11 12:50:58 +08:00
Reuse the code for __mpn_extract_long_double to implement __mpn_extract_float128. * include/gmp.h: Include bits/floatn.h (__mpn_extract_float128): Declare when __HAVE_DISTINCT_FLOAT128 is 1. * stdlib/gmp-impl.h: Also check if alloca is not defined before including stack-alloc.h. It could have been defined by other header which not necessarily defines HAVE_ALLOCA. * sysdeps/ieee754/float128/Makefile: New file. * sysdeps/ieee754/float128/float1282mpn.c: New file. * sysdeps/ieee754/float128/float128_private.h: Include gmp.h before redefining __mpn_extract_long_double to __mpn_extract_float128, then redefine __mpn_extract_long_double to __mpn_extract_float128. * sysdeps/ieee754/ldbl-128/ldbl2mpn.c: Replace long double with _Float128 to allow float128_private.h overrides.
36 lines
979 B
C
36 lines
979 B
C
/* Include gmp-mparam.h first, such that definitions of _SHORT_LIMB
|
|
and _LONG_LONG_LIMB in it can take effect into gmp.h. */
|
|
#include <gmp-mparam.h>
|
|
|
|
#ifndef __GMP_H__
|
|
|
|
#include <stdlib/gmp.h>
|
|
|
|
#include <bits/floatn.h>
|
|
|
|
/* Now define the internal interfaces. */
|
|
extern mp_size_t __mpn_extract_double (mp_ptr res_ptr, mp_size_t size,
|
|
int *expt, int *is_neg,
|
|
double value);
|
|
|
|
extern mp_size_t __mpn_extract_long_double (mp_ptr res_ptr, mp_size_t size,
|
|
int *expt, int *is_neg,
|
|
long double value);
|
|
|
|
#if __HAVE_DISTINCT_FLOAT128
|
|
extern mp_size_t __mpn_extract_float128 (mp_ptr res_ptr, mp_size_t size,
|
|
int *expt, int *is_neg,
|
|
_Float128 value);
|
|
#endif
|
|
|
|
extern float __mpn_construct_float (mp_srcptr frac_ptr, int expt, int sign);
|
|
|
|
extern double __mpn_construct_double (mp_srcptr frac_ptr, int expt,
|
|
int negative);
|
|
|
|
extern long double __mpn_construct_long_double (mp_srcptr frac_ptr, int expt,
|
|
int sign);
|
|
|
|
|
|
#endif
|