long-float: remove conditionalization

Many parts of the source code were bent backward to support builds
without long floats which are always present given we depend expect
c99 compiler.

The corresponding C macros (ECL_LONG_FLOAT) and the *feature*
entry (:long-float) are marked as deprecated in the documentation.
This commit is contained in:
Daniel Kochmański 2019-05-24 21:04:59 +00:00
parent 8c30d1a371
commit ea87100a06
84 changed files with 332 additions and 528 deletions

View file

@ -18,14 +18,15 @@ If you do not have access to the online version, follow the following recipies.
3. Enter
nmake ...
followed by zero or more of those options
4. Use "nmake install" to create a directory called "package" with ECL in it.
5. Move that directory wherever you need.
4. Use "nmake install" to create a directory called "package" with ECL in it.
5. Move that directory wherever you need.
* Cross-compile for the android platform (from the UNIX machine)
1. Build the host ECL
#+BEGIN_SRC shell-script
# C99 complex numbers are not fully supported on Android
./configure ABI=32 CFLAGS="-m32 -g -O2" LDFLAGS="-m32 -g -O2"\
--prefix=`pwd`/ecl-android-host --disable-longdouble
--prefix=`pwd`/ecl-android-host --disable-c99complex
make -j9
make install
rm -r build
@ -49,6 +50,7 @@ If you do not have access to the online version, follow the following recipies.
export CC=arm-linux-androideabi-clang
./configure --host=arm-linux-androideabi \
--prefix=`pwd`/ecl-android \
--disable-c99complex \
--with-cross-config=`pwd`/src/util/android-arm.cross_config
make -j9
make install

27
src/aclocal.m4 vendored
View file

@ -1,22 +1,29 @@
dnl -*- autoconf -*-
dnl --------------------------------------------------------------
dnl check existence of long double
AC_DEFUN([ECL_LONG_DOUBLE],[
if test "$enable_longdouble" != "no" ; then
AC_CHECK_TYPES([long double],
[enable_longdouble=yes, AC_DEFINE([ECL_LONG_FLOAT], [], [ECL_LONG_FLOAT])]
[enable_longdouble=no])
fi])
dnl --------------------------------------------------------------
dnl check for existence of complex float
AC_DEFUN([ECL_COMPLEX_C99],[
if test "$enable_c99complex" != "no" ; then
AC_CHECK_TYPES([float complex, double complex, long complex],
[enable_c99complex=yes, AC_DEFINE([ECL_COMPLEX_FLOAT], [], [ECL_COMPLEX_FLOAT])],
[enable_c99complex=yes],
[enable_c99complex=no],
[#include <complex.h>])
fi
dnl some retarded platforms (*cough* Android *cough*) have complex
dnl types defined, but not all corresponding numeric functions
if test "$enable_c99complex" != "no" ; then
AC_CHECK_FUNCS([crealf creal creall cimagf cimag cimagl] \
[cabsf cabs cabsl conjf conj conjl csqrtf csqrt csqrtl] \
[ccosf ccos ccosl csinf csin csinl ctanf ctan ctanl] \
[ccoshf ccosh ccoshl csinhf csinh csinhl ctanhf ctanh ctanhl] \
[cexpf cexp cexpl cpowf cpow cpowl clogf clog clogl] \
[casinf casin casinl cacosf cacos cacosl catanf catan catanl] \
[casinhf casinh casinhl cacoshf cacosh cacoshl catanhf catanh catanhl] \
[],
[enable_c99complex=no])
fi
if test "$enable_c99complex" != "no" ; then
AC_DEFINE([ECL_COMPLEX_FLOAT], [], [ECL_COMPLEX_FLOAT])
fi])
dnl --------------------------------------------------------------

View file

@ -557,9 +557,7 @@ ecl_alloc_object(cl_type t)
#ifdef ECL_SSE2
case t_sse_pack:
#endif
#ifdef ECL_LONG_FLOAT
case t_longfloat:
#endif
#ifdef ECL_COMPLEX_FLOAT
case t_csfloat:
case t_cdfloat:
@ -852,9 +850,7 @@ init_alloc(void)
init_tm(t_ratio, "RATIO", sizeof(struct ecl_ratio), 2);
init_tm(t_singlefloat, "SINGLE-FLOAT", sizeof(struct ecl_singlefloat), 0);
init_tm(t_doublefloat, "DOUBLE-FLOAT", sizeof(struct ecl_doublefloat), 0);
#ifdef ECL_LONG_FLOAT
init_tm(t_longfloat, "LONG-FLOAT", sizeof(struct ecl_long_float), 0);
#endif
init_tm(t_complex, "COMPLEX", sizeof(struct ecl_complex), 2);
#ifdef ECL_COMPLEX_FLOAT
init_tm(t_csfloat, "COMPLEX-SINGLE-FLOAT", sizeof(struct ecl_csfloat), 0);
@ -913,9 +909,7 @@ init_alloc(void)
to_bitmap(&o, &(o.ratio.den));
type_info[t_singlefloat].descriptor = 0;
type_info[t_doublefloat].descriptor = 0;
#ifdef ECL_LONG_FLOAT
type_info[t_longfloat].descriptor = 0;
#endif
type_info[t_complex].descriptor =
to_bitmap(&o, &(o.complex.real)) |
to_bitmap(&o, &(o.complex.imag));

View file

@ -22,9 +22,7 @@ static const cl_object ecl_aet_name[] = {
ECL_T, /* ecl_aet_object */
@'single-float', /* ecl_aet_sf */
@'double-float', /* ecl_aet_df */
#ifdef ECL_LONG_FLOAT
@'long-float', /* ecl_aet_lf */
#endif
#ifdef ECL_COMPLEX_FLOAT
@'si::complex-single-float', /* ecl_aet_csf */
@'si::complex-double-float', /* ecl_aet_cdf */
@ -181,10 +179,8 @@ ecl_aref_unsafe(cl_object x, cl_index index)
return(ecl_make_single_float(x->array.self.sf[index]));
case ecl_aet_df:
return(ecl_make_double_float(x->array.self.df[index]));
#ifdef ECL_LONG_FLOAT
case ecl_aet_lf:
return(ecl_make_long_float(x->array.self.lf[index]));
#endif
#ifdef ECL_COMPLEX_FLOAT
case ecl_aet_csf:
return(ecl_make_csfloat(x->array.self.csf[index]));
@ -349,11 +345,9 @@ ecl_aset_unsafe(cl_object x, cl_index index, cl_object value)
case ecl_aet_df:
x->array.self.df[index] = ecl_to_double(value);
break;
#ifdef ECL_LONG_FLOAT
case ecl_aet_lf:
x->array.self.lf[index] = ecl_to_long_double(value);
break;
#endif
#ifdef ECL_COMPLEX_FLOAT
case ecl_aet_csf:
x->array.self.csf[index] = ecl_to_csfloat(value);
@ -669,13 +663,8 @@ ecl_symbol_to_elttype(cl_object x)
return(ecl_aet_sf);
else if (x == @'double-float')
return(ecl_aet_df);
else if (x == @'long-float') {
#ifdef ECL_LONG_FLOAT
else if (x == @'long-float')
return(ecl_aet_lf);
#else
return(ecl_aet_df);
#endif
}
#ifdef ECL_COMPLEX_FLOAT
else if (x == @'si::complex-single-float')
return(ecl_aet_csf);
@ -755,10 +744,8 @@ address_inc(void *address, cl_fixnum inc, cl_elttype elt_type)
#endif
case ecl_aet_df:
return aux.df + inc;
#ifdef ECL_LONG_FLOAT
case ecl_aet_lf:
return aux.lf + inc;
#endif
#ifdef ECL_COMPLEX_FLOAT
case ecl_aet_csf:
return aux.csf + inc;
@ -1028,11 +1015,9 @@ cl_array_displacement(cl_object a)
case ecl_aet_df:
offset = a->array.self.df - to_array->array.self.df;
break;
#ifdef ECL_LONG_FLOAT
case ecl_aet_lf:
offset = a->array.self.lf - to_array->array.self.lf;
break;
#endif
#ifdef ECL_COMPLEX_FLOAT
case ecl_aet_csf:
offset = a->array.self.csf - to_array->array.self.csf;
@ -1314,7 +1299,6 @@ ecl_reverse_subarray(cl_object x, cl_index i0, cl_index i1)
x->array.self.df[j] = y;
}
break;
#ifdef ECL_LONG_FLOAT
case ecl_aet_lf:
for (i = i0, j = i1-1; i < j; i++, --j) {
long double y = x->array.self.lf[i];
@ -1322,7 +1306,6 @@ ecl_reverse_subarray(cl_object x, cl_index i0, cl_index i1)
x->array.self.lf[j] = y;
}
break;
#endif
#ifdef ECL_COMPLEX_FLOAT
case ecl_aet_csf:
for (i = i0, j = i1-1; i < j; i++, --j) {
@ -1488,14 +1471,12 @@ si_fill_array_with_elt(cl_object x, cl_object elt, cl_object start, cl_object en
for (first = last - first; first; --first, ++p) { *p = e; }
break;
}
#ifdef ECL_LONG_FLOAT
case ecl_aet_lf: {
long double e = ecl_to_long_double(elt);
long double *p = x->vector.self.lf + first;
for (first = last - first; first; --first, ++p) { *p = e; }
break;
}
#endif
#ifdef ECL_COMPLEX_FLOAT
case ecl_aet_csf: {
_Complex float e = ecl_to_csfloat(elt);

View file

@ -401,7 +401,6 @@ _ecl_big_fits_in_index(cl_object x)
# error "ECL cannot build with GMP when both long and mp_limb_t are smaller than cl_fixnum"
#endif /* ECL_FIXNUM_BITS > GMP_LIMB_BITS, ECL_LONG_BITS */
#ifdef ECL_LONG_FLOAT
long double
_ecl_big_to_long_double(cl_object o)
{
@ -413,7 +412,6 @@ _ecl_big_to_long_double(cl_object o)
}
return (mpz_sgn(o->big.big_num) < 0)? -output : output;
}
#endif
static void
mpz_ior_op(cl_object out, cl_object i, cl_object j)

View file

@ -337,9 +337,7 @@ enum ecl_built_in_classes {
ECL_BUILTIN_FLOAT,
ECL_BUILTIN_SINGLE_FLOAT,
ECL_BUILTIN_DOUBLE_FLOAT,
#ifdef ECL_LONG_FLOAT
ECL_BUILTIN_LONG_FLOAT,
#endif
ECL_BUILTIN_COMPLEX,
#ifdef ECL_COMPLEX_FLOAT
ECL_BUILTIN_COMPLEX_FLOAT,
@ -393,10 +391,8 @@ cl_class_of(cl_object x)
index = ECL_BUILTIN_SINGLE_FLOAT; break;
case t_doublefloat:
index = ECL_BUILTIN_DOUBLE_FLOAT; break;
#ifdef ECL_LONG_FLOAT
case t_longfloat:
index = ECL_BUILTIN_LONG_FLOAT; break;
#endif
case t_complex:
index = ECL_BUILTIN_COMPLEX; break;
#ifdef ECL_COMPLEX_FLOAT

View file

@ -78,10 +78,8 @@ ecl_to_fixnum(cl_object x)
return (cl_fixnum)ecl_single_float(x);
case t_doublefloat:
return (cl_fixnum)ecl_double_float(x);
#ifdef ECL_LONG_FLOAT
case t_longfloat:
return (cl_fixnum)ecl_long_float(x);
#endif
default:
FEerror("~S cannot be coerced to a C int.", 1, x);
}
@ -100,10 +98,8 @@ ecl_to_unsigned_integer(cl_object x)
return (cl_index)ecl_single_float(x);
case t_doublefloat:
return (cl_index)ecl_double_float(x);
#ifdef ECL_LONG_FLOAT
case t_longfloat:
return (cl_index)ecl_long_float(x);
#endif
default:
FEerror("~S cannot be coerced to a C unsigned int.", 1, x);
}

View file

@ -2200,9 +2200,7 @@ need_to_make_load_form_p(cl_object o)
case t_ratio:
case t_singlefloat:
case t_doublefloat:
#ifdef ECL_LONG_FLOAT
case t_longfloat:
#endif
case t_complex:
case t_symbol:
case t_pathname:

View file

@ -48,7 +48,6 @@ ecl_def_ct_double_float(dbl_min_neg_norm,-DBL_MIN,static,const);
#define ECL_MOST_POSITIVE_DOUBLE_FLOAT (cl_object)(&dbl_max_data)
#define ECL_MOST_NEGATIVE_DOUBLE_FLOAT (cl_object)(&dbl_max_neg_data)
#ifdef ECL_LONG_FLOAT
ecl_def_ct_long_float(ldbl_max,LDBL_MAX,static,const);
ecl_def_ct_long_float(ldbl_max_neg,-LDBL_MAX,static,const);
ecl_def_ct_long_float(ldbl_min,LDBL_TRUE_MIN,static,const);
@ -61,18 +60,6 @@ ecl_def_ct_long_float(ldbl_min_neg_norm,-LDBL_MIN,static,const);
#define ECL_LEAST_NEGATIVE_NORMALIZED_LONG_FLOAT (cl_object)(&ldbl_min_neg_norm_data)
#define ECL_MOST_POSITIVE_LONG_FLOAT (cl_object)(&ldbl_max_data)
#define ECL_MOST_NEGATIVE_LONG_FLOAT (cl_object)(&ldbl_max_neg_data)
#else
#define ECL_LEAST_POSITIVE_LONG_FLOAT (cl_object)(&dbl_min_data)
#define ECL_LEAST_NEGATIVE_LONG_FLOAT (cl_object)(&dbl_min_neg_data)
#define ECL_LEAST_POSITIVE_NORMALIZED_LONG_FLOAT (cl_object)(&dbl_min_norm_data)
#define ECL_LEAST_NEGATIVE_NORMALIZED_LONG_FLOAT (cl_object)(&dbl_min_neg_norm_data)
#define ECL_MOST_POSITIVE_LONG_FLOAT (cl_object)(&dbl_max_data)
#define ECL_MOST_NEGATIVE_LONG_FLOAT (cl_object)(&dbl_max_neg_data)
#endif
#ifdef ECL_LONG_FLOAT
ecl_def_ct_long_float(float_pi,ECL_PI_L,static,const);
#else
ecl_def_ct_double_float(float_pi,ECL_PI_D,static,const);
#endif
#define ECL_PI (cl_object)(&float_pi_data)

View file

@ -71,9 +71,7 @@ ecl_def_string_array(feature_names,static,const) = {
#ifdef ECL_UNICODE
ecl_def_string_array_elt("UNICODE"),
#endif
#ifdef ECL_LONG_FLOAT
ecl_def_string_array_elt("LONG-FLOAT"),
#endif
#ifdef ECL_COMPLEX_FLOAT
ecl_def_string_array_elt("COMPLEX-FLOAT"),
#endif

View file

@ -19,9 +19,7 @@ static const cl_object ecl_aet_to_ffi_table[ecl_aet_bc+1] = {
@':void', /* ecl_aet_object */
@':float', /* ecl_aet_sf */
@':double', /* ecl_aet_df */
#ifdef ECL_LONG_FLOAT
@':long-double', /* ecl_aet_lf */
#endif
#ifdef ECL_COMPLEX_FLOAT
@':csfloat', /* ecl_aet_csf */
@':cdfloat', /* ecl_aet_cdf */
@ -125,9 +123,7 @@ ecl_foreign_type_table[] = {
FFI_DESC(@':object', cl_object),
FFI_DESC(@':float', float),
FFI_DESC(@':double', double),
#ifdef ECL_LONG_FLOAT
FFI_DESC(@':long-double', long double),
#endif
#ifdef ECL_COMPLEX_FLOAT
FFI_DESC(@':csfloat', _Complex float),
FFI_DESC(@':cdfloat', _Complex double),
@ -191,9 +187,7 @@ static ffi_type *ecl_type_to_libffi_types[] = {
&ffi_type_pointer, /*@':object',*/
&ffi_type_float, /*@':float',*/
&ffi_type_double, /*@':double',*/
#ifdef ECL_LONG_FLOAT
&ffi_type_longdouble, /*@':long-double',*/
#endif
#ifdef ECL_COMPLEX_FLOAT
/* These ffi types are defined in libffi but they dont't seem to
work. For the issue report check the following link:
@ -537,10 +531,8 @@ ecl_foreign_data_ref_elt(void *p, enum ecl_ffi_tag tag)
return ecl_make_single_float(*(float *)p);
case ECL_FFI_DOUBLE:
return ecl_make_double_float(*(double *)p);
#ifdef ECL_LONG_FLOAT
case ECL_FFI_LONG_DOUBLE:
return ecl_make_long_float(*(long double *)p);
#endif
#ifdef ECL_COMPLEX_FLOAT
case ECL_FFI_CSFLOAT:
return ecl_make_csfloat(*(_Complex float *)p);
@ -643,11 +635,9 @@ ecl_foreign_data_set_elt(void *p, enum ecl_ffi_tag tag, cl_object value)
case ECL_FFI_DOUBLE:
*(double *)p = ecl_to_double(value);
break;
#ifdef ECL_LONG_FLOAT
case ECL_FFI_LONG_DOUBLE:
*(long double *)p = ecl_to_long_double(value);
break;
#endif
#ifdef ECL_COMPLEX_FLOAT
case ECL_FFI_CSFLOAT:
*(_Complex float *)p = ecl_to_csfloat(value);

View file

@ -751,31 +751,20 @@ fmt_character(format_stack fmt, bool colon, bool atsign)
* Notice that we leave some extra margin, to ensure that reading the number
* again will produce the same floating point number.
*/
#ifdef ECL_LONG_FLOAT
# define LDBL_SIG ((int)(LDBL_MANT_DIG * LOG10_2 + 1))
# define DBL_MAX_DIGITS (LDBL_SIG + 3)
# define DBL_EXPONENT_SIZE (1 + 1 + 4)
#else
# define DBL_MAX_DIGITS (DBL_SIG + 3)
# define DBL_EXPONENT_SIZE (1 + 1 + 3) /* Exponent marker 'e' + sign + digits .*/
#endif
#define LDBL_SIG ((int)(LDBL_MANT_DIG * LOG10_2 + 1))
#define DBL_MAX_DIGITS (LDBL_SIG + 3)
#define DBL_EXPONENT_SIZE (1 + 1 + 4)
/* The sinificant digits + the possible sign + the decimal dot. */
#define DBL_MANTISSA_SIZE (DBL_MAX_DIGITS + 1 + 1)
/* Total estimated size that a floating point number can take. */
#define DBL_SIZE (DBL_MANTISSA_SIZE + DBL_EXPONENT_SIZE)
#ifdef ECL_LONG_FLOAT
#define EXP_STRING "Le"
#define G_EXP_STRING "Lg"
#define DBL_TYPE long double
#define strtod strtold
extern long double strtold(const char *nptr, char **endptr);
#else
#define EXP_STRING "e"
#define G_EXP_STRING "g"
#define DBL_TYPE double
#endif
static int
edit_double(int n, DBL_TYPE d, int *sp, char *s, int *ep)
@ -795,10 +784,8 @@ edit_double(int n, DBL_TYPE d, int *sp, char *s, int *ep)
do {
sprintf(buff, "%- *.*" EXP_STRING, n + 1 + 1 + DBL_EXPONENT_SIZE, n-1, d);
aux = strtod(buff, NULL);
#ifdef ECL_LONG_FLOAT
if (n < LDBL_SIG)
aux = (double) aux;
#endif
if (n < DBL_SIG)
aux = (float)aux;
n++;
@ -1159,11 +1146,7 @@ fmt_exponential_float(format_stack fmt, bool colon, bool atsign)
y = ecl_symbol_value(@'*read-default-float-format*');
if (exponentchar < 0) {
if (y == @'long-float') {
#ifdef ECL_LONG_FLOAT
t = t_longfloat;
#else
t = t_doublefloat;
#endif
} else if (y == @'double-float') {
t = t_doublefloat;
} else if (y == @'single-float') {
@ -1175,10 +1158,8 @@ fmt_exponential_float(format_stack fmt, bool colon, bool atsign)
exponentchar = 'E';
else if (ecl_t_of(x) == t_singlefloat)
exponentchar = 'F';
#ifdef ECL_LONG_FLOAT
else if (ecl_t_of(x) == t_longfloat)
exponentchar = 'L';
#endif
else
exponentchar = 'D';
}

View file

@ -47,7 +47,6 @@ _hash_eql(cl_hashkey h, cl_object x)
return hash_string(h, (unsigned char*)&ecl_single_float(x), sizeof(ecl_single_float(x)));
case t_doublefloat:
return hash_string(h, (unsigned char*)&ecl_double_float(x), sizeof(ecl_double_float(x)));
#ifdef ECL_LONG_FLOAT
case t_longfloat: {
/* We coerce to double because long double has extra bits that
* give rise to different hash key and are not meaningful. */
@ -56,7 +55,6 @@ _hash_eql(cl_hashkey h, cl_object x)
aux.sign = (ecl_long_float(x) < 0)? -1: 1;
return hash_string(h, (unsigned char*)&aux, sizeof(aux));
}
#endif
case t_complex:
h = _hash_eql(h, x->gencomplex.real);
return _hash_eql(h, x->gencomplex.imag);
@ -151,7 +149,6 @@ _hash_equal(int depth, cl_hashkey h, cl_object x)
if (f == 0.0) f = 0.0;
return hash_string(h, (unsigned char*)&f, sizeof(f));
}
# ifdef ECL_LONG_FLOAT
case t_longfloat: {
/* We coerce to double because long double has extra bits
* that give rise to different hash key and are not
@ -162,7 +159,6 @@ _hash_equal(int depth, cl_hashkey h, cl_object x)
if (aux.mantissa == 0.0) aux.mantissa = 0.0;
return hash_string(h, (unsigned char*)&aux, sizeof(aux));
}
# endif
case t_complex: {
h = _hash_equal(depth, h, x->gencomplex.real);
return _hash_equal(depth, h, x->gencomplex.imag);

View file

@ -330,10 +330,8 @@ ecl_def_ct_single_float(flt_zero,0,static,const);
ecl_def_ct_single_float(flt_zero_neg,-0.0,static,const);
ecl_def_ct_double_float(dbl_zero,0,static,const);
ecl_def_ct_double_float(dbl_zero_neg,-0.0,static,const);
#ifdef ECL_LONG_FLOAT
ecl_def_ct_long_float(ldbl_zero,0,static,const);
ecl_def_ct_long_float(ldbl_zero_neg,-0.0l,static,const);
#endif
ecl_def_ct_ratio(plus_half,ecl_make_fixnum(1),ecl_make_fixnum(2),static,const);
ecl_def_ct_ratio(minus_half,ecl_make_fixnum(-1),ecl_make_fixnum(2),static,const);
ecl_def_ct_single_float(flt_one,1,static,const);
@ -382,10 +380,8 @@ struct cl_core_struct cl_core = {
(cl_object)&dbl_zero_data, /* doublefloat_zero */
(cl_object)&flt_zero_neg_data, /* singlefloat_minus_zero */
(cl_object)&dbl_zero_neg_data, /* doublefloat_minus_zero */
#ifdef ECL_LONG_FLOAT
(cl_object)&ldbl_zero_data, /* longfloat_zero */
(cl_object)&ldbl_zero_neg_data, /* longfloat_minus_zero */
#endif
(cl_object)&str_G_data, /* gensym_prefix */
(cl_object)&str_T_data, /* gentemp_prefix */

View file

@ -53,9 +53,7 @@
switch (tx = ecl_t_of(x)) {
case t_singlefloat:
case t_doublefloat:
#ifdef ECL_LONG_FLOAT
case t_longfloat:
#endif
if (y == OBJNULL || ty == tx)
break;
case t_fixnum:
@ -66,10 +64,8 @@
x = ecl_make_single_float(ecl_to_double(x)); break;
case t_doublefloat:
x = ecl_make_double_float(ecl_to_double(x)); break;
#ifdef ECL_LONG_FLOAT
case t_longfloat:
x = ecl_make_long_float(ecl_to_long_double(x)); break;
#endif
default:
FEwrong_type_nth_arg(@[float],2,y,@[float]);
}
@ -163,7 +159,6 @@ cl_decode_float(cl_object x)
x = ecl_make_double_float(d);
break;
}
#ifdef ECL_LONG_FLOAT
case t_longfloat: {
long double d = ecl_long_float(x);
if (d >= 0.0)
@ -176,7 +171,6 @@ cl_decode_float(cl_object x)
x = ecl_make_long_float(d);
break;
}
#endif
default:
FEwrong_type_only_arg(@[decode-float],x,@[float]);
}
@ -201,11 +195,9 @@ cl_scale_float(cl_object x, cl_object y)
case t_doublefloat:
x = ecl_make_double_float(ldexp(ecl_double_float(x), k));
break;
#ifdef ECL_LONG_FLOAT
case t_longfloat:
x = ecl_make_long_float(ldexpl(ecl_long_float(x), k));
break;
#endif
default:
FEwrong_type_nth_arg(@[scale-float],1,x,@[float]);
}
@ -230,10 +222,8 @@ ecl_signbit(cl_object x)
return signbit(ecl_single_float(x));
case t_doublefloat:
return signbit(ecl_double_float(x));
#ifdef ECL_LONG_FLOAT
case t_longfloat:
return signbit(ecl_long_float(x));
#endif
default:
FEwrong_type_nth_arg(@[float-sign],1,x,@[float]);
}
@ -257,13 +247,11 @@ ecl_signbit(cl_object x)
if (signbit(f) != negativep) y = ecl_make_double_float(-f);
break;
}
#ifdef ECL_LONG_FLOAT
case t_longfloat: {
long double f = ecl_long_float(y);
if (signbit(f) != negativep) y = ecl_make_long_float(-f);
break;
}
#endif
default:
FEwrong_type_nth_arg(@[float-sign],2,y,@[float]);
}
@ -281,11 +269,9 @@ cl_float_digits(cl_object x)
case t_doublefloat:
x = ecl_make_fixnum(DBL_MANT_DIG);
break;
#ifdef ECL_LONG_FLOAT
case t_longfloat:
x = ecl_make_fixnum(LDBL_MANT_DIG);
break;
#endif
default:
FEwrong_type_only_arg(@[float-digits],x,@[float]);
}
@ -328,7 +314,6 @@ cl_float_precision(cl_object x)
}
break;
}
#ifdef ECL_LONG_FLOAT
case t_longfloat: {
long double f = ecl_long_float(x);
if (f == 0.0) {
@ -344,7 +329,6 @@ cl_float_precision(cl_object x)
}
break;
}
#endif
default:
FEwrong_type_only_arg(@[float-precision],x,@[float]);
}
@ -358,7 +342,6 @@ cl_integer_decode_float(cl_object x)
int e, s = 1;
switch (ecl_t_of(x)) {
#ifdef ECL_LONG_FLOAT
case t_longfloat: {
long double d = ecl_long_float(x);
if (signbit(d)) {
@ -375,7 +358,6 @@ cl_integer_decode_float(cl_object x)
}
break;
}
#endif
case t_doublefloat: {
double d = ecl_double_float(x);
if (signbit(d)) {
@ -429,9 +411,7 @@ cl_realpart(cl_object x)
case t_ratio:
case t_singlefloat:
case t_doublefloat:
#ifdef ECL_LONG_FLOAT
case t_longfloat:
#endif
break;
case t_complex:
x = x->gencomplex.real;
@ -480,14 +460,12 @@ cl_imagpart(cl_object x)
else
x = cl_core.doublefloat_zero;
break;
#ifdef ECL_LONG_FLOAT
case t_longfloat:
if (signbit(ecl_long_float(x)))
x = cl_core.longfloat_minus_zero;
else
x = cl_core.longfloat_zero;
break;
#endif
case t_complex:
x = x->gencomplex.imag;
break;

View file

@ -70,10 +70,8 @@ ecl_float_nan_p(cl_object x)
/* return !isnan(ecl_single_float(x)); */
/* case t_doublefloat: */
/* return !isnan(ecl_double_float(x)); */
/* #ifdef ECL_LONG_FLOAT */
/* case t_longfloat: */
/* return !isnan(ecl_long_float(x)); */
/* #endif */
/* default: */
/* return 0; */
/* } */
@ -87,10 +85,8 @@ ecl_float_infinity_p(cl_object x)
return !isfinite(ecl_single_float(x));
case t_doublefloat:
return !isfinite(ecl_double_float(x));
#ifdef ECL_LONG_FLOAT
case t_longfloat:
return !isfinite(ecl_long_float(x));
#endif
default:
return 0;
}

View file

@ -263,12 +263,10 @@ rando(cl_object x, cl_object rs)
z = ecl_make_double_float(ecl_double_float(x) *
generate_double(rs->random.value));
break;
#ifdef ECL_LONG_FLOAT
case t_longfloat:
z = ecl_make_long_float(ecl_long_float(x) *
(long double)generate_double(rs->random.value));
break;
#endif
default: ERROR: {
const char *type = "(OR (INTEGER (0) *) (FLOAT (0) *))";
FEwrong_type_nth_arg(@[random],1,x, ecl_read_from_cstring(type));

View file

@ -511,7 +511,6 @@ ecl_make_double_float(double f)
return(x);
}
#ifdef ECL_LONG_FLOAT
cl_object
ecl_make_long_float(long double f)
{
@ -529,7 +528,6 @@ ecl_make_long_float(long double f)
x->longfloat.value = f;
return x;
}
#endif
cl_object
ecl_make_complex(cl_object r, cl_object i)
@ -555,13 +553,11 @@ ecl_make_complex(cl_object r, cl_object i)
c->gencomplex.real = ecl_make_double_float(ecl_to_double(r));
c->gencomplex.imag = ecl_make_double_float(ecl_to_double(i));
return c;
# ifdef ECL_LONG_FLOAT
case t_longfloat:
c = ecl_alloc_object(t_complex);
c->gencomplex.real = ecl_make_long_float(ecl_to_long_double(r));
c->gencomplex.imag = ecl_make_long_float(ecl_to_long_double(i));
return c;
# endif
#endif
case t_fixnum:
case t_bignum:
@ -722,7 +718,6 @@ ratio_to_double(cl_object num, cl_object den)
return ldexp(output, exponent);
}
#ifdef ECL_LONG_FLOAT
static long double
ratio_to_long_double(cl_object num, cl_object den)
{
@ -736,7 +731,6 @@ ratio_to_long_double(cl_object num, cl_object den)
#endif
return ldexpl(output, exponent);
}
#endif /* ECL_LONG_FLOAT */
float
ecl_to_float(cl_object x)
@ -754,10 +748,8 @@ ecl_to_float(cl_object x)
return ecl_single_float(x);
case t_doublefloat:
return (float)ecl_double_float(x);
#ifdef ECL_LONG_FLOAT
case t_longfloat:
return (float)ecl_long_float(x);
#endif
default:
FEwrong_type_nth_arg(@[coerce], 1, x, @[real]);
}
@ -777,16 +769,13 @@ ecl_to_double(cl_object x)
return (double)ecl_single_float(x);
case t_doublefloat:
return(ecl_double_float(x));
#ifdef ECL_LONG_FLOAT
case t_longfloat:
return (double)ecl_long_float(x);
#endif
default:
FEwrong_type_nth_arg(@[coerce], 1, x, @[real]);
}
}
#ifdef ECL_LONG_FLOAT
long double
ecl_to_long_double(cl_object x)
{
@ -807,7 +796,6 @@ ecl_to_long_double(cl_object x)
FEwrong_type_nth_arg(@[coerce], 1, x, @[real]);
}
}
#endif
#ifdef ECL_COMPLEX_FLOAT
float _Complex ecl_to_csfloat(cl_object x) {
@ -899,7 +887,6 @@ cl_rational(cl_object x)
}
}
break;
#ifdef ECL_LONG_FLOAT
case t_longfloat: {
long double d = ecl_long_float(x);
if (d == 0) {
@ -918,7 +905,6 @@ cl_rational(cl_object x)
}
break;
}
#endif
default:
x = ecl_type_error(@'rational',"argument",x,@'number');
goto AGAIN;
@ -926,7 +912,6 @@ cl_rational(cl_object x)
@(return x);
}
#ifdef ECL_LONG_FLOAT
cl_object
_ecl_long_double_to_integer(long double d0)
{
@ -947,7 +932,6 @@ _ecl_long_double_to_integer(long double d0)
return o;
}
}
#endif
cl_object
_ecl_double_to_integer(double d)

View file

@ -65,7 +65,6 @@ ecl_abs_double_float(cl_object x)
return ecl_make_double_float(f);
}
#ifdef ECL_LONG_FLOAT
static cl_object
ecl_abs_long_float(cl_object x)
{
@ -73,7 +72,6 @@ ecl_abs_long_float(cl_object x)
f = fabsl(f);
return ecl_make_long_float(f);
}
#endif
static cl_object
ecl_abs_complex(cl_object x)

View file

@ -26,7 +26,6 @@ ecl_atan2(cl_object y, cl_object x)
cl_object output;
ECL_MATHERR_CLEAR;
{
#ifdef ECL_LONG_FLOAT
int tx = ecl_t_of(x);
int ty = ecl_t_of(y);
if (tx < ty)
@ -44,16 +43,6 @@ ecl_atan2(cl_object y, cl_object x)
output = ecl_make_single_float(dz);
}
}
#else
double dy = ecl_to_double(y);
double dx = ecl_to_double(x);
double dz = atan2(dy, dx);
if (ECL_DOUBLE_FLOAT_P(x) || ECL_DOUBLE_FLOAT_P(y)) {
output = ecl_make_double_float(dz);
} else {
output = ecl_make_single_float(dz);
}
#endif
}
ECL_MATHERR_TEST;
return output;

View file

@ -56,7 +56,6 @@ ecl_ceiling1(cl_object x)
v1 = ecl_make_double_float(d - y);
break;
}
#ifdef ECL_LONG_FLOAT
case t_longfloat: {
long double d = ecl_long_float(x);
long double y = ceill(d);
@ -64,7 +63,6 @@ ecl_ceiling1(cl_object x)
v1 = ecl_make_long_float(d - y);
break;
}
#endif
default:
FEwrong_type_nth_arg(@[ceiling],1,x,@[real]);
}
@ -128,7 +126,6 @@ ecl_ceiling2(cl_object x, cl_object y)
v1 = ecl_make_double_float(p*n - q*n);
break;
}
#ifdef ECL_LONG_FLOAT
case t_longfloat: { /* FIX / LF */
long double n = ecl_long_float(y);
long double p = ecl_fixnum(x)/n;
@ -137,7 +134,6 @@ ecl_ceiling2(cl_object x, cl_object y)
v1 = ecl_make_long_float(p*n - q*n);
break;
}
#endif
default:
(void)0; /*Never reached */
}
@ -174,7 +170,6 @@ ecl_ceiling2(cl_object x, cl_object y)
v1 = ecl_make_double_float(p*n - q*n);
break;
}
#ifdef ECL_LONG_FLOAT
case t_longfloat: { /* BIG / LF */
long double n = ecl_long_float(y);
long double p = _ecl_big_to_double(x)/n;
@ -183,7 +178,6 @@ ecl_ceiling2(cl_object x, cl_object y)
v1 = ecl_make_long_float(p*n - q*n);
break;
}
#endif
default:
(void)0; /*Never reached */
}
@ -216,7 +210,6 @@ ecl_ceiling2(cl_object x, cl_object y)
v1 = ecl_make_double_float(p*n - q*n);
break;
}
#ifdef ECL_LONG_FLOAT
case t_longfloat: { /* LF / ANY */
long double n = ecl_to_long_double(y);
long double p = ecl_long_float(x)/n;
@ -225,7 +218,6 @@ ecl_ceiling2(cl_object x, cl_object y)
v1 = ecl_make_long_float(p*n - q*n);
break;
}
#endif
default:
FEwrong_type_nth_arg(@[ceiling], 1, x, @[real]);
}

View file

@ -43,13 +43,11 @@ ecl_cos_double_float(cl_object x)
return ecl_make_double_float(cos(ecl_double_float(x)));
}
#ifdef ECL_LONG_FLOAT
static cl_object
ecl_cos_long_float(cl_object x)
{
return ecl_make_long_float(cosl(ecl_long_float(x)));
}
#endif
static cl_object
ecl_cos_complex(cl_object x)

View file

@ -43,13 +43,11 @@ ecl_cosh_double_float(cl_object x)
return ecl_make_double_float(cosh(ecl_double_float(x)));
}
#ifdef ECL_LONG_FLOAT
static cl_object
ecl_cosh_long_float(cl_object x)
{
return ecl_make_long_float(coshl(ecl_long_float(x)));
}
#endif
static cl_object
ecl_cosh_complex(cl_object x)

View file

@ -111,7 +111,6 @@ ecl_divide(cl_object x, cl_object y)
CASE_DOUBLE_FLOAT_DOUBLE_FLOAT {
return ecl_make_double_float(ecl_double_float(x) / ecl_double_float(y));
}
#ifdef ECL_LONG_FLOAT
CASE_FIXNUM_LONG_FLOAT {
return ecl_make_long_float(ecl_fixnum(x) / ecl_long_float(y));
}
@ -147,7 +146,6 @@ ecl_divide(cl_object x, cl_object y)
CASE_COMPLEX_LONG_FLOAT; {
goto COMPLEX_X;
}
#endif
CASE_COMPLEX_FIXNUM;
CASE_COMPLEX_BIGNUM;
CASE_COMPLEX_RATIO;

View file

@ -43,13 +43,11 @@ ecl_exp_double_float(cl_object x)
return ecl_make_double_float(exp(ecl_double_float(x)));
}
#ifdef ECL_LONG_FLOAT
static cl_object
ecl_exp_long_float(cl_object x)
{
return ecl_make_long_float(expl(ecl_long_float(x)));
}
#endif
static cl_object
ecl_exp_complex(cl_object x)

View file

@ -45,9 +45,7 @@ cl_expt(cl_object x, cl_object y)
ecl_def_ct_single_float(singlefloat_one,1,static,const);
ecl_def_ct_double_float(doublefloat_one,1,static,const);
#ifdef ECL_LONG_FLOAT
ecl_def_ct_long_float(longfloat_one,1,static,const);
#endif
#ifdef ECL_COMPLEX_FLOAT
ecl_def_ct_csfloat(csfloat_one,1,static,const);
ecl_def_ct_cdfloat(cdfloat_one,1,static,const);
@ -74,10 +72,8 @@ expt_zero(cl_object x, cl_object y)
return singlefloat_one;
case t_doublefloat:
return doublefloat_one;
#ifdef ECL_LONG_FLOAT
case t_longfloat:
return longfloat_one;
#endif
case t_complex:
z = expt_zero((tx == t_complex)? x->gencomplex.real : x,
(ty == t_complex)? y->gencomplex.real : y);
@ -126,11 +122,9 @@ ecl_expt_float(cl_object x, cl_object y) {
tx = ecl_t_of(x),
ty = ecl_t_of(y);
switch((ty > tx) ? ty : tx) {
#ifdef ECL_LONG_FLOAT
case t_longfloat:
return ecl_make_long_float
(powl(ecl_to_long_double(x), ecl_to_long_double(y)));
#endif
case t_doublefloat:
return ecl_make_double_float
(pow(ecl_to_double(x), ecl_to_double(y)));
@ -209,9 +203,7 @@ ecl_expt(cl_object x, cl_object y)
case t_ratio:
case t_complex:
return ecl_expt_generic(x, y);
#ifdef ECL_LONG_FLOAT
case t_longfloat:
#endif
case t_doublefloat:
case t_singlefloat:
return ecl_expt_float(x, y);

View file

@ -47,7 +47,6 @@ double_fix_compare(cl_fixnum n, double d)
}
}
#ifdef ECL_LONG_FLOAT
static int
long_double_fix_compare(cl_fixnum n, long double d)
{
@ -68,5 +67,4 @@ long_double_fix_compare(cl_fixnum n, long double d)
}
}
}
#endif

View file

@ -58,7 +58,6 @@ ecl_floor1(cl_object x)
v1 = ecl_make_double_float(d - y);
break;
}
#ifdef ECL_LONG_FLOAT
case t_longfloat: {
long double d = ecl_long_float(x);
long double y = floorl(d);
@ -66,7 +65,6 @@ ecl_floor1(cl_object x)
v1 = ecl_make_long_float(d - y);
break;
}
#endif
default:
FEwrong_type_nth_arg(@[floor],1,x,@[real]);
}
@ -124,7 +122,6 @@ ecl_floor2(cl_object x, cl_object y)
v1 = ecl_make_double_float((p - q)*n);
break;
}
#ifdef ECL_LONG_FLOAT
CASE_FIXNUM_LONG_FLOAT { /* FIX / LF */
long double n = ecl_long_float(y);
long double p = ecl_fixnum(x) / n;
@ -133,7 +130,6 @@ ecl_floor2(cl_object x, cl_object y)
v1 = ecl_make_long_float((p - q)*n);
break;
}
#endif
CASE_BIGNUM_FIXNUM {
ECL_WITH_TEMP_BIGNUM(by,4);
_ecl_big_set_fixnum(by, ecl_fixnum(y));
@ -165,7 +161,6 @@ ecl_floor2(cl_object x, cl_object y)
v1 = ecl_make_double_float((p - q)*n);
break;
}
#ifdef ECL_LONG_FLOAT
CASE_BIGNUM_LONG_FLOAT {
long double n = ecl_long_float(y);
long double p = _ecl_big_to_double(x) / n;
@ -174,7 +169,6 @@ ecl_floor2(cl_object x, cl_object y)
v1 = ecl_make_long_float((p - q)*n);
break;
}
#endif
CASE_RATIO_RATIO {
v0 = ecl_floor2(ecl_times(x->ratio.num, y->ratio.den),
ecl_times(x->ratio.den, y->ratio.num));
@ -184,9 +178,7 @@ ecl_floor2(cl_object x, cl_object y)
CASE_RATIO_FIXNUM;
CASE_RATIO_BIGNUM;
CASE_RATIO_SINGLE_FLOAT;
#ifdef ECL_LONG_FLOAT
CASE_RATIO_LONG_FLOAT;
#endif
CASE_RATIO_DOUBLE_FLOAT {
v0 = ecl_floor2(x->ratio.num, ecl_times(x->ratio.den, y));
v1 = ecl_divide(ecl_nth_value(the_env, 1), x->ratio.den);
@ -197,9 +189,7 @@ ecl_floor2(cl_object x, cl_object y)
CASE_SINGLE_FLOAT_BIGNUM;
CASE_SINGLE_FLOAT_RATIO;
CASE_SINGLE_FLOAT_DOUBLE_FLOAT;
#ifdef ECL_LONG_FLOAT
CASE_SINGLE_FLOAT_LONG_FLOAT;
#endif
CASE_SINGLE_FLOAT_SINGLE_FLOAT {
float n = ecl_to_double(y);
float p = ecl_single_float(x)/n;
@ -215,9 +205,7 @@ ecl_floor2(cl_object x, cl_object y)
CASE_DOUBLE_FLOAT_BIGNUM;
CASE_DOUBLE_FLOAT_RATIO;
CASE_DOUBLE_FLOAT_SINGLE_FLOAT;
#ifdef ECL_LONG_FLOAT
CASE_DOUBLE_FLOAT_LONG_FLOAT;
#endif
CASE_DOUBLE_FLOAT_DOUBLE_FLOAT {
double n = ecl_to_double(y);
double p = ecl_double_float(x)/n;
@ -226,7 +214,6 @@ ecl_floor2(cl_object x, cl_object y)
v1 = ecl_make_double_float(p*n - q*n);
break;
}
#ifdef ECL_LONG_FLOAT
CASE_LONG_FLOAT_FIXNUM;
CASE_LONG_FLOAT_BIGNUM;
CASE_LONG_FLOAT_RATIO;
@ -240,7 +227,6 @@ ecl_floor2(cl_object x, cl_object y)
v1 = ecl_make_long_float(p*n - q*n);
break;
}
#endif
default: DISPATCH2_ERROR: {
if (!ecl_realp(x))
FEwrong_type_nth_arg(@[floor], 1, x, @[real]);

View file

@ -124,7 +124,6 @@ ecl_log1_double_float(cl_object x)
return ecl_make_double_float(log(f));
}
#ifdef ECL_LONG_FLOAT
static cl_object
ecl_log1_long_float(cl_object x)
{
@ -142,7 +141,6 @@ ecl_log1_long_float(cl_object x)
}
return ecl_make_long_float(logl(f));
}
#endif
static cl_object
ecl_log1_complex(cl_object x)
@ -259,7 +257,6 @@ ecl_log1p_double_float(cl_object x)
return ecl_make_double_float(log1p(f));
}
#ifdef ECL_LONG_FLOAT
static cl_object
ecl_log1p_long_float(cl_object x)
{
@ -276,7 +273,6 @@ ecl_log1p_long_float(cl_object x)
}
return ecl_make_long_float(log1pl(f));
}
#endif
static cl_object
ecl_log1p_complex(cl_object x)

View file

@ -105,7 +105,6 @@ ecl_minus(cl_object x, cl_object y)
CASE_DOUBLE_FLOAT_DOUBLE_FLOAT {
return ecl_make_double_float(ecl_double_float(x) - ecl_double_float(y));
}
#ifdef ECL_LONG_FLOAT
CASE_FIXNUM_LONG_FLOAT {
return ecl_make_long_float(ecl_fixnum(x) - ecl_long_float(y));
}
@ -143,7 +142,6 @@ ecl_minus(cl_object x, cl_object y)
CASE_COMPLEX_LONG_FLOAT; {
goto COMPLEX_X;
}
#endif
CASE_COMPLEX_FIXNUM;
CASE_COMPLEX_BIGNUM;
CASE_COMPLEX_RATIO;

View file

@ -51,12 +51,10 @@ ecl_minusp_double_float(cl_object x)
return ecl_double_float(x) < 0;
}
#ifdef ECL_LONG_FLOAT
static int ecl_minusp_long_float(cl_object x)
{
return ecl_long_float(x) < 0;
}
#endif
MATH_DEF_DISPATCH1_BOOL(minusp, @[minusp], @[real],
ecl_minusp_fixnum, ecl_minusp_big, ecl_minusp_ratio,

View file

@ -45,13 +45,11 @@ ecl_negate_double_float(cl_object x)
return ecl_make_double_float(-ecl_double_float(x));
}
#ifdef ECL_LONG_FLOAT
static cl_object
ecl_negate_long_float(cl_object x)
{
return ecl_make_long_float(-ecl_long_float(x));
}
#endif
static cl_object
ecl_negate_complex(cl_object x)

View file

@ -31,9 +31,7 @@ int
ecl_number_compare(cl_object x, cl_object y)
{
double dx, dy;
#ifdef ECL_LONG_FLOAT
long double ldx, ldy;
#endif
BEGIN:
MATH_DISPATCH2_BEGIN(x,y) {
/* rational x rational */
@ -59,19 +57,15 @@ ecl_number_compare(cl_object x, cl_object y)
CASE_FIXNUM_SINGLE_FLOAT { return double_fix_compare(ecl_fixnum(x), ecl_single_float(y)); }
CASE_DOUBLE_FLOAT_FIXNUM { return -double_fix_compare(ecl_fixnum(y), ecl_double_float(x)); }
CASE_FIXNUM_DOUBLE_FLOAT { return double_fix_compare(ecl_fixnum(x), ecl_double_float(y)); }
#ifdef ECL_LONG_FLOAT
CASE_LONG_FLOAT_FIXNUM { return -long_double_fix_compare(ecl_fixnum(y), ecl_long_float(x)); }
CASE_FIXNUM_LONG_FLOAT { return long_double_fix_compare(ecl_fixnum(x), ecl_long_float(y)); }
#endif
/* float x [bignum,ratio] */
CASE_SINGLE_FLOAT_BIGNUM;
CASE_SINGLE_FLOAT_RATIO;
CASE_DOUBLE_FLOAT_BIGNUM;
CASE_DOUBLE_FLOAT_RATIO;
#ifdef ECL_LONG_FLOAT
CASE_LONG_FLOAT_BIGNUM;
CASE_LONG_FLOAT_RATIO;
#endif
{
#ifdef ECL_IEEE_FP
if (ecl_float_infinity_p(x))
@ -84,10 +78,8 @@ ecl_number_compare(cl_object x, cl_object y)
CASE_RATIO_SINGLE_FLOAT;
CASE_BIGNUM_DOUBLE_FLOAT;
CASE_RATIO_DOUBLE_FLOAT;
#ifdef ECL_LONG_FLOAT
CASE_BIGNUM_LONG_FLOAT;
CASE_RATIO_LONG_FLOAT;
#endif
{
#ifdef ECL_IEEE_FP
if (ecl_float_infinity_p(y))
@ -119,7 +111,6 @@ ecl_number_compare(cl_object x, cl_object y)
if (dx == dy) return 0;
else return (dx < dy) ? -1 : 1;
}
#ifdef ECL_LONG_FLOAT
CASE_SINGLE_FLOAT_LONG_FLOAT {
ldx = ecl_single_float(x);
ldy = ecl_long_float(y);
@ -147,7 +138,6 @@ ecl_number_compare(cl_object x, cl_object y)
if (ldx == ldy) return 0;
else return (ldx < ldy) ? -1 : 1;
}
#endif
CASE_UNKNOWN(@[<],x,y,@[real]);
}
MATH_DISPATCH2_END;

View file

@ -57,10 +57,8 @@ ecl_number_equalp(cl_object x, cl_object y)
CASE_SINGLE_FLOAT_FIXNUM { return double_fix_compare(ecl_fixnum(y), ecl_single_float(x)) == 0; }
CASE_FIXNUM_DOUBLE_FLOAT { return double_fix_compare(ecl_fixnum(x), ecl_double_float(y)) == 0; }
CASE_DOUBLE_FLOAT_FIXNUM { return double_fix_compare(ecl_fixnum(y), ecl_double_float(x)) == 0; }
#ifdef ECL_LONG_FLOAT
CASE_FIXNUM_LONG_FLOAT { return long_double_fix_compare(ecl_fixnum(x), ecl_long_float(y)) == 0; }
CASE_LONG_FLOAT_FIXNUM { return long_double_fix_compare(ecl_fixnum(y), ecl_long_float(x)) == 0; }
#endif
CASE_BIGNUM_SINGLE_FLOAT;
CASE_BIGNUM_DOUBLE_FLOAT;
CASE_RATIO_SINGLE_FLOAT;
@ -81,7 +79,6 @@ ecl_number_equalp(cl_object x, cl_object y)
}
#endif
return ecl_number_equalp(cl_rational(x), y); }
#ifdef ECL_LONG_FLOAT
CASE_BIGNUM_LONG_FLOAT;
CASE_RATIO_LONG_FLOAT {
#ifdef ECL_IEEE_FP
@ -98,19 +95,16 @@ ecl_number_equalp(cl_object x, cl_object y)
}
#endif
return ecl_number_equalp(y, cl_rational(x)); }
#endif
/* float x float */
CASE_SINGLE_FLOAT_SINGLE_FLOAT { return ecl_single_float(x) == ecl_single_float(y); }
CASE_SINGLE_FLOAT_DOUBLE_FLOAT { return ecl_single_float(x) == ecl_double_float(y); }
CASE_DOUBLE_FLOAT_SINGLE_FLOAT { return ecl_double_float(x) == ecl_single_float(y); }
CASE_DOUBLE_FLOAT_DOUBLE_FLOAT { return ecl_double_float(x) == ecl_double_float(y); }
#ifdef ECL_LONG_FLOAT
CASE_SINGLE_FLOAT_LONG_FLOAT { return ecl_single_float(x) == ecl_long_float(y); }
CASE_LONG_FLOAT_SINGLE_FLOAT { return ecl_long_float(x) == ecl_single_float(y); }
CASE_DOUBLE_FLOAT_LONG_FLOAT { return ecl_double_float(x) == ecl_long_float(y); }
CASE_LONG_FLOAT_DOUBLE_FLOAT { return ecl_long_float(x) == ecl_double_float(y); }
CASE_LONG_FLOAT_LONG_FLOAT { return ecl_long_float(x) == ecl_long_float(y); }
#endif
/* complex x real ; c?float x real */
CASE_COMPLEX_FIXNUM;
CASE_COMPLEX_BIGNUM;
@ -134,13 +128,11 @@ ecl_number_equalp(cl_object x, cl_object y)
CASE_CLFLOAT_SINGLE_FLOAT;
CASE_CLFLOAT_DOUBLE_FLOAT;
#endif
#ifdef ECL_LONG_FLOAT
CASE_COMPLEX_LONG_FLOAT;
# ifdef ECL_COMPLEX_FLOAT
#ifdef ECL_COMPLEX_FLOAT
CASE_CSFLOAT_LONG_FLOAT;
CASE_CDFLOAT_LONG_FLOAT;
CASE_CLFLOAT_LONG_FLOAT;
# endif
#endif
{
if (!ecl_zerop(cl_imagpart(x))) { return 0; }
@ -168,13 +160,11 @@ ecl_number_equalp(cl_object x, cl_object y)
CASE_SINGLE_FLOAT_CLFLOAT;
CASE_DOUBLE_FLOAT_CLFLOAT;
#endif
#ifdef ECL_LONG_FLOAT
CASE_LONG_FLOAT_COMPLEX;
# ifdef ECL_COMPLEX_FLOAT
#ifdef ECL_COMPLEX_FLOAT
CASE_LONG_FLOAT_CSFLOAT;
CASE_LONG_FLOAT_CDFLOAT;
CASE_LONG_FLOAT_CLFLOAT;
# endif
#endif
{
if (!ecl_zerop(cl_imagpart(y))) { return 0; }

View file

@ -48,13 +48,11 @@ ecl_one_minus_double_float(cl_object x)
return ecl_make_double_float(ecl_double_float(x) - 1);
}
#ifdef ECL_LONG_FLOAT
static cl_object
ecl_one_minus_long_float(cl_object x)
{
return ecl_make_long_float(ecl_long_float(x) - 1);
}
#endif
static cl_object
ecl_one_minus_complex(cl_object x)

View file

@ -48,13 +48,11 @@ ecl_one_plus_double_float(cl_object x)
return ecl_make_double_float(ecl_double_float(x) + 1);
}
#ifdef ECL_LONG_FLOAT
static cl_object
ecl_one_plus_long_float(cl_object x)
{
return ecl_make_long_float(ecl_long_float(x) + 1);
}
#endif
static cl_object
ecl_one_plus_complex(cl_object x)

View file

@ -100,7 +100,6 @@ ecl_plus(cl_object x, cl_object y) {
CASE_DOUBLE_FLOAT_DOUBLE_FLOAT {
return ecl_make_double_float(ecl_double_float(x) + ecl_double_float(y));
}
#ifdef ECL_LONG_FLOAT
CASE_FIXNUM_LONG_FLOAT {
return ecl_make_long_float(ecl_fixnum(x) + ecl_long_float(y));
}
@ -138,7 +137,6 @@ ecl_plus(cl_object x, cl_object y) {
CASE_COMPLEX_LONG_FLOAT; {
goto COMPLEX_X;
}
#endif
CASE_COMPLEX_FIXNUM;
CASE_COMPLEX_BIGNUM;
CASE_COMPLEX_RATIO;

View file

@ -52,12 +52,10 @@ ecl_plusp_double_float(cl_object x)
return ecl_double_float(x) > 0;
}
#ifdef ECL_LONG_FLOAT
static int ecl_plusp_long_float(cl_object x)
{
return ecl_long_float(x) > 0;
}
#endif
MATH_DEF_DISPATCH1_BOOL(plusp, @[plusp], @[real],
ecl_plusp_fixnum, ecl_plusp_big, ecl_plusp_ratio,

View file

@ -58,7 +58,6 @@ round_double(double d)
}
}
#ifdef ECL_LONG_FLOAT
static long double
round_long_double(long double d)
{
@ -75,7 +74,6 @@ round_long_double(long double d)
return -round_long_double(-d);
}
}
#endif
static cl_object
ecl_round2_integer(const cl_env_ptr the_env, cl_object x, cl_object y, cl_object q)
@ -126,7 +124,6 @@ ecl_round1(cl_object x)
v1 = ecl_make_double_float(d - q);
break;
}
#ifdef ECL_LONG_FLOAT
case t_longfloat: {
long double d = ecl_long_float(x);
long double q = round_long_double(d);
@ -134,7 +131,6 @@ ecl_round1(cl_object x)
v1 = ecl_make_long_float(d - q);
break;
}
#endif
default:
FEwrong_type_nth_arg(@[round],1,x,@[real]);
}

View file

@ -44,13 +44,11 @@ ecl_sin_double_float(cl_object x)
return ecl_make_double_float(sin(ecl_double_float(x)));
}
#ifdef ECL_LONG_FLOAT
static cl_object
ecl_sin_long_float(cl_object x)
{
return ecl_make_long_float(sinl(ecl_long_float(x)));
}
#endif
static cl_object
ecl_sin_complex(cl_object x)

View file

@ -44,13 +44,11 @@ ecl_sinh_double_float(cl_object x)
return ecl_make_double_float(sinh(ecl_double_float(x)));
}
#ifdef ECL_LONG_FLOAT
static cl_object
ecl_sinh_long_float(cl_object x)
{
return ecl_make_long_float(sinhl(ecl_long_float(x)));
}
#endif
static cl_object
ecl_sinh_complex(cl_object x)

View file

@ -61,7 +61,6 @@ ecl_sqrt_double_float(cl_object x)
}
}
#ifdef ECL_LONG_FLOAT
static cl_object
ecl_sqrt_long_float(cl_object x)
{
@ -73,7 +72,6 @@ ecl_sqrt_long_float(cl_object x)
return ecl_make_long_float(sqrtl(f));
}
}
#endif
static cl_object
ecl_sqrt_complex(cl_object x)

View file

@ -58,13 +58,11 @@ ecl_tan_double_float(cl_object x)
return ecl_make_double_float(tan(ecl_double_float(x)));
}
#ifdef ECL_LONG_FLOAT
static cl_object
ecl_tan_long_float(cl_object x)
{
return ecl_make_long_float(tanl(ecl_long_float(x)));
}
#endif
static cl_object
ecl_tan_complex(cl_object x)

View file

@ -44,13 +44,11 @@ ecl_tanh_double_float(cl_object x)
return ecl_make_double_float(tanh(ecl_double_float(x)));
}
#ifdef ECL_LONG_FLOAT
static cl_object
ecl_tanh_long_float(cl_object x)
{
return ecl_make_long_float(tanhl(ecl_long_float(x)));
}
#endif
static cl_object
ecl_tanh_complex(cl_object x)

View file

@ -101,7 +101,6 @@ ecl_times(cl_object x, cl_object y)
CASE_DOUBLE_FLOAT_DOUBLE_FLOAT {
return ecl_make_double_float(ecl_double_float(x) * ecl_double_float(y));
}
#ifdef ECL_LONG_FLOAT
CASE_FIXNUM_LONG_FLOAT {
return ecl_make_long_float(ecl_fixnum(x) * ecl_long_float(y));
}
@ -137,7 +136,6 @@ ecl_times(cl_object x, cl_object y)
CASE_COMPLEX_LONG_FLOAT; {
goto COMPLEX_X;
}
#endif
CASE_COMPLEX_FIXNUM;
/* fallthrough */
CASE_COMPLEX_BIGNUM;

View file

@ -51,7 +51,6 @@ ecl_truncate1(cl_object x)
v1 = ecl_make_double_float(d - y);
break;
}
#ifdef ECL_LONG_FLOAT
case t_longfloat: {
long double d = ecl_long_float(x);
long double y = d > 0? floorl(d) : ceill(d);
@ -59,7 +58,6 @@ ecl_truncate1(cl_object x)
v1 = ecl_make_long_float(d - y);
break;
}
#endif
default:
FEwrong_type_nth_arg(@[truncate],1,x,@[real]);
}

View file

@ -46,12 +46,10 @@ ecl_zerop_double_float(cl_object x)
return ecl_double_float(x) == 0;
}
#ifdef ECL_LONG_FLOAT
static int ecl_zerop_long_float(cl_object x)
{
return ecl_long_float(x) == 0;
}
#endif
static int
ecl_zerop_complex(cl_object x)

View file

@ -92,11 +92,7 @@ bool
floatp(cl_object x)
{
cl_type t = ecl_t_of(x);
return (t == t_singlefloat) || (t == t_doublefloat)
#ifdef ECL_LONG_FLOAT
|| (t == t_longfloat)
#endif
;
return (t == t_singlefloat) || (t == t_doublefloat) || (t == t_longfloat);
}
cl_object
@ -289,12 +285,10 @@ ecl_eql(cl_object x, cl_object y)
ecl_eql(x->ratio.den, y->ratio.den));
case t_singlefloat:
return float_eql(ecl_single_float(x), ecl_single_float(y));
case t_doublefloat:
return double_eql(ecl_double_float(x), ecl_double_float(y));
#ifdef ECL_LONG_FLOAT
case t_longfloat:
return long_double_eql(ecl_long_float(x), ecl_long_float(y));
#endif
case t_doublefloat:
return double_eql(ecl_double_float(x), ecl_double_float(y));
case t_complex:
return (ecl_eql(x->gencomplex.real, y->gencomplex.real) &&
ecl_eql(x->gencomplex.imag, y->gencomplex.imag));
@ -362,12 +356,10 @@ ecl_equal(register cl_object x, cl_object y)
if (tx != ty) return 0;
return double_eql(ecl_double_float(x), ecl_double_float(y));
}
#ifdef ECL_LONG_FLOAT
case t_longfloat: {
if (tx != ty) return 0;
return long_double_eql(ecl_long_float(x), ecl_long_float(y));
}
#endif
case t_complex:
return (tx == ty) && ecl_eql(x->gencomplex.real, y->gencomplex.real) &&
ecl_eql(x->gencomplex.imag, y->gencomplex.imag);
@ -449,9 +441,7 @@ ecl_equalp(cl_object x, cl_object y)
case t_ratio:
case t_singlefloat:
case t_doublefloat:
#ifdef ECL_LONG_FLOAT
case t_longfloat:
#endif
case t_complex:
#ifdef ECL_COMPLEX_FLOAT
case t_csfloat:
@ -507,12 +497,6 @@ ecl_equalp(cl_object x, cl_object y)
return(FALSE); \
return(TRUE);
#ifdef ECL_LONG_FLOAT
#define AET_FLOAT_EQUALP_LF(t1, lf) AET_FLOAT_EQUALP(t1, lf)
#else
#define AET_FLOAT_EQUALP_LF(t1, lf)
#endif
#ifdef ECL_COMPLEX_FLOAT
#define AET_FLOAT_EQUALP_CF(t1, cf) AET_FLOAT_EQUALP(t1, cf)
#else
@ -524,7 +508,7 @@ ecl_equalp(cl_object x, cl_object y)
switch(ety) { \
AET_FLOAT_EQUALP(t1, sf); \
AET_FLOAT_EQUALP(t1, df); \
AET_FLOAT_EQUALP_LF(t1, lf); \
AET_FLOAT_EQUALP(t1, lf); \
AET_FLOAT_EQUALP_CF(t1, csf); \
AET_FLOAT_EQUALP_CF(t1, cdf); \
AET_FLOAT_EQUALP_CF(t1, clf); \
@ -535,9 +519,7 @@ ecl_equalp(cl_object x, cl_object y)
switch (etx) {
AET_FLOAT_SWITCH(sf);
AET_FLOAT_SWITCH(df);
#ifdef ECL_LONG_FLOAT
AET_FLOAT_SWITCH(lf);
#endif
#ifdef ECL_COMPLEX_FLOAT
AET_FLOAT_SWITCH(csf);
AET_FLOAT_SWITCH(cdf);
@ -548,7 +530,6 @@ ecl_equalp(cl_object x, cl_object y)
}
#undef AET_FLOAT_EQUALP
#undef AET_FLOAT_SWITCH
#undef AET_FLOAT_EQUALP_LF
#undef AET_FLOAT_EQUALP_CF
for (i = 0; i < j; i++)

View file

@ -49,13 +49,11 @@ setup(cl_object number, float_approx *approx)
limit_f = (number->DF.DFVAL ==
ldexp(FLT_RADIX, DBL_MANT_DIG-1));
break;
#ifdef ECL_LONG_FLOAT
case t_longfloat:
min_e = LDBL_MIN_EXP;
limit_f = (number->longfloat.value ==
ldexpl(FLT_RADIX, LDBL_MANT_DIG-1));
break;
#endif
default:
break;
}

View file

@ -65,18 +65,12 @@ print_float_exponent(cl_object buffer, cl_object number, cl_fixnum exp)
case t_singlefloat:
e = (r == @'single-float' || r == @'short-float')? 'e' : 'f';
break;
#ifdef ECL_LONG_FLOAT
case t_longfloat:
e = (r == @'long-float') ? 'e' : 'l';
break;
case t_doublefloat:
e = (r == @'double-float')? 'e' : 'd';
break;
#else
case t_doublefloat:
e = (r == @'double-float' || r == @'long-float')? 'e' : 'd';
case t_longfloat:
e = (r == @'long-float') ? 'e' : 'l';
break;
#endif
default:
ecl_internal_error("*** \n"
"*** print_float_exponent unexpected argument\n"

View file

@ -438,9 +438,7 @@ static printer dispatch[FREE+1] = {
/* write_float, */ /* t_shortfloat */
write_float, /* t_singlefloat */
write_float, /* t_doublefloat */
#ifdef ECL_LONG_FLOAT
write_float, /* t_longfloat */
#endif
write_complex, /* t_complex */
#ifdef ECL_COMPLEX_FLOAT
write_complex_float, /* t_csfloat */

View file

@ -1461,11 +1461,7 @@ ecl_current_read_default_float_format(void)
if (x == @'double-float')
return 'D';
if (x == @'long-float') {
#ifdef ECL_LONG_FLOAT
return 'L';
#else
return 'D';
#endif
}
ECL_SETQ(the_env, @'*read-default-float-format*', @'single-float');
FEerror("The value of *READ-DEFAULT-FLOAT-FORMAT*~& ~S~%"

View file

@ -52,18 +52,16 @@ infinity(cl_index exp_char, int sign)
@'ext::single-float-negative-infinity' :
@'ext::single-float-positive-infinity';
break;
case 'l': case 'L':
# ifdef ECL_LONG_FLOAT
var = (sign<0)?
@'ext::long-float-negative-infinity' :
@'ext::long-float-positive-infinity';
break;
# endif
case 'd': case 'D':
var = (sign<0)?
@'ext::double-float-negative-infinity' :
@'ext::double-float-positive-infinity';
break;
case 'l': case 'L':
var = (sign<0)?
@'ext::long-float-negative-infinity' :
@'ext::long-float-positive-infinity';
break;
#endif /* ECL_IEEE_FP */
default:
return OBJNULL;
@ -92,12 +90,10 @@ make_float(cl_object num, cl_object exp, cl_index exp_char, int sign)
case 's': case 'S':
case 'f': case 'F':
return ecl_make_single_float(sign * ecl_to_double(num));
case 'l': case 'L':
#ifdef ECL_LONG_FLOAT
return ecl_make_long_float(sign * ecl_to_long_double(num));
#endif
case 'd': case 'D': {
return ecl_make_double_float(sign * ecl_to_double(num));
case 'l': case 'L':
return ecl_make_long_float(sign * ecl_to_long_double(num));
}
default:
return OBJNULL;

View file

@ -42,15 +42,8 @@ static cl_index object_size[] = {
ROUNDED_SIZE(ecl_ratio), /* t_ratio */
ROUNDED_SIZE(ecl_singlefloat), /* t_singlefloat */
ROUNDED_SIZE(ecl_doublefloat), /* t_doublefloat */
#ifdef ECL_LONG_FLOAT
ROUNDED_SIZE(ecl_long_float), /* t_longfloat */
#endif
ROUNDED_SIZE(ecl_complex), /* t_complex */
#ifdef ECL_COMPLEX_FLOAT
ROUNDED_SIZE(ecl_csfloat), /* t_csfloat */
ROUNDED_SIZE(ecl_cdfloat), /* t_cdfloat */
ROUNDED_SIZE(ecl_clfloat), /* t_clfloat */
#endif
ROUNDED_SIZE(fake_symbol), /* t_symbol */
ROUNDED_SIZE(fake_package), /* t_package */
ROUNDED_SIZE(ecl_hashtable), /* t_hashtable */
@ -246,14 +239,7 @@ serialize_one(pool_t pool, cl_object what)
switch (ecl_t_of(what)) {
case t_singlefloat:
case t_doublefloat:
#ifdef ECL_LONG_FLOAT
case t_longfloat:
#endif
#ifdef ECL_COMPLEX_FLOAT
case t_csfloat:
case t_cdfloat:
case t_clfloat:
#endif
break;
case t_bignum: {
int8_t sign = mpz_sgn(buffer->big.big_num);

View file

@ -113,10 +113,8 @@ ecl_type_to_symbol(cl_type t)
return @'single-float';
case t_doublefloat:
return @'double-float';
#ifdef ECL_LONG_FLOAT
case t_longfloat:
return @'long-float';
#endif
case t_complex:
return @'complex';
#ifdef ECL_COMPLEX_FLOAT

View file

@ -212,7 +212,7 @@
(float real)
(single-float float)
(double-float float)
#+long-float (long-float float)
(long-float float)
(complex number)
#+complex-float (si:complex-float complex)
#+complex-float (si:complex-single-float si:complex-float)

View file

@ -112,7 +112,7 @@
output))
(defun to-fixnum-float-type (type)
(dolist (i '(FIXNUM DOUBLE-FLOAT SINGLE-FLOAT #+long-float LONG-FLOAT)
(dolist (i '(FIXNUM DOUBLE-FLOAT SINGLE-FLOAT LONG-FLOAT)
nil)
(when (type>= i type)
(return i))))
@ -120,7 +120,6 @@
(defun maximum-float-type (t1 t2)
(cond ((null t1)
t2)
#+long-float
((or (eq t1 'LONG-FLOAT) (eq t2 'LONG-FLOAT))
'LONG-FLOAT)
((or (eq t1 'DOUBLE-FLOAT) (eq t2 'DOUBLE-FLOAT))

View file

@ -99,7 +99,6 @@
#+:sse2 (:float-sse-pack . nil)
#+:sse2 (:double-sse-pack . nil)
#+:sse2 (:int-sse-pack . nil)
#+:long-float (:long-double . nil)
#+complex-float (:csfloat . nil)
#+complex-float (:cdfloat . nil)
#+complex-float (:clfloat . nil)))
@ -108,6 +107,7 @@
'((:object)
(:float)
(:double)
(:long-double)
(:char)
(:unsigned-char)
(:wchar)

View file

@ -115,9 +115,7 @@
(#.(coerce 0 'double-float) "cl_core.doublefloat_zero")
(#.(coerce -0.0 'single-float) "cl_core.singlefloat_minus_zero")
(#.(coerce -0.0 'double-float) "cl_core.doublefloat_minus_zero")
#+long-float
(#.(coerce 0 'long-float) "cl_core.longfloat_zero")
#+long-float
(#.(coerce -0.0 'long-float) "cl_core.longfloat_minus_zero")
;; We temporarily remove this constant, because the bytecodes compiler
@ -165,7 +163,6 @@
(SINGLE-FLOAT-NEGATIVE-INFINITY "-INFINITY")
(DOUBLE-FLOAT-NEGATIVE-INFINITY "-INFINITY"))
#+long-float
,@'((MOST-POSITIVE-LONG-FLOAT "LDBL_MAX")
(MOST-NEGATIVE-LONG-FLOAT "-LDBL_MAX")
(LEAST-POSITIVE-LONG-FLOAT "LDBL_TRUE_MIN")
@ -175,5 +172,4 @@
#+ieee-floating-point
(LONG-FLOAT-POSITIVE-INFINITY "INFINITY")
#+ieee-floating-point
(LONG-FLOAT-NEGATIVE-INFINITY "-INFINITY")
)))))
(LONG-FLOAT-NEGATIVE-INFINITY "-INFINITY"))))))

View file

@ -94,7 +94,7 @@
(loc-in-c1form-movable-p (third loc)))
((member (setf loc (car loc))
'(VV VV-TEMP FIXNUM-VALUE CHARACTER-VALUE
DOUBLE-FLOAT-VALUE SINGLE-FLOAT-VALUE #+long-float LONG-FLOAT-VALUE
DOUBLE-FLOAT-VALUE SINGLE-FLOAT-VALUE LONG-FLOAT-VALUE
#+complex-float CSFLOAT-VALUE
#+complex-float CDFLOAT-VALUE
#+complex-float CLFLOAT-VALUE

View file

@ -97,10 +97,10 @@
(default (if only-real 'REAL 'NUMBER))
(types-list (if only-real
'(FIXNUM INTEGER RATIONAL SINGLE-FLOAT
DOUBLE-FLOAT #+long-float LONG-FLOAT FLOAT REAL
DOUBLE-FLOAT LONG-FLOAT FLOAT REAL
NUMBER)
'(FIXNUM INTEGER RATIONAL SINGLE-FLOAT
DOUBLE-FLOAT #+long-float LONG-FLOAT FLOAT REAL))))
DOUBLE-FLOAT LONG-FLOAT FLOAT REAL))))
(dolist (i types-list)
(when (and (null t1-eq) (type>= i t1))
(if (equalp t1 t2)

View file

@ -124,7 +124,7 @@
;;
;; (INTEGER * *), etc
((member first '(INTEGER RATIONAL FLOAT REAL SINGLE-FLOAT
DOUBLE-FLOAT #+long-float LONG-FLOAT))
DOUBLE-FLOAT LONG-FLOAT))
(let ((var1 (gensym))
(var2 (gensym)))
;; Small optimization: it is easier to check for fixnum
@ -318,7 +318,7 @@
;; does not match. However, if safety settings are low, we
;; skip the interval test.
((member first '(INTEGER RATIONAL FLOAT REAL SINGLE-FLOAT
DOUBLE-FLOAT #+long-float LONG-FLOAT))
DOUBLE-FLOAT LONG-FLOAT))
(let ((unchecked (expand-coerce form value `',first env)))
(if (policy-assume-no-errors)
unchecked

View file

@ -481,7 +481,6 @@
(CHARACTER "CODE_CHAR")
(DOUBLE-FLOAT "ecl_make_double_float")
(SINGLE-FLOAT "ecl_make_single_float")
#+long-float
(LONG-FLOAT "ecl_make_long_float"))
"(LI" cfun "(")
(do ((types arg-types (cdr types))
@ -493,7 +492,6 @@
(CHARACTER "ecl_char_code")
(DOUBLE-FLOAT "df")
(SINGLE-FLOAT "sf")
#+long-float
(LONG-FLOAT "ecl_long_float")
(otherwise "")) "(")
(wt-lcl n) (wt ")")
@ -609,7 +607,7 @@
(:char . "_ecl_base_char_loc")
(:float . "_ecl_float_loc")
(:double . "_ecl_double_loc")
#+long-float (:long-double . "_ecl_long_double_loc")
(:long-double . "_ecl_long_double_loc")
#+complex-float (:csfloat . "_ecl_csfloat_loc")
#+complex-float (:cdfloat . "_ecl_cdfloat_loc")
#+complex-float (:clfloat . "_ecl_clfloat_loc")

View file

@ -36,9 +36,17 @@
(defun default-init (var &optional warn)
(declare (ignore warn))
(let ((new-value (cdr (assoc (var-type var)
'((fixnum . 0) (character . #\space)
#+long-float (long-float 0.0L1)
(double-float . 0.0D1) (single-float . 0.0F1))
'((fixnum . 0)
(character . #\space)
(long-float . 0.0L1)
(double-float . 0.0D1)
(single-float . 0.0F1)
#+complex-float
(si:complex-single-float . #c(0.0f0 0.0f0))
#+complex-float
(si:complex-double-float . #c(0.0d0 0.0d0))
#+complex-float
(si:complex-single-float . #c(0.0l0 0.0l0)))
:test #'subtypep))))
(if new-value
(c1constant-value new-value :only-small-values t)

View file

@ -252,7 +252,6 @@
(format stream "ecl_def_ct_double_float(~A,~S,static,const);"
name value stream)))
#+long-float
(defun static-long-float-builder (name value stream)
(let* ((*read-default-float-format* 'long-float)
(*print-readably* t))
@ -328,7 +327,6 @@
(double-float (and (not (ext:float-nan-p object))
(not (ext:float-infinity-p object))
#'static-double-float-builder))
#+long-float
(long-float (and (not (ext:float-nan-p object))
(not (ext:float-infinity-p object))
#'static-long-float-builder))

View file

@ -39,7 +39,6 @@
(def-inline aref :unsafe ((array base-char) fixnum fixnum) :unsigned-char "@0;(#0)->base_string.self[#1*(#0)->array.dims[1]+#2]")
(def-inline aref :unsafe ((array double-float) fixnum fixnum) :double "@0;(#0)->array.self.df[#1*(#0)->array.dims[1]+#2]")
(def-inline aref :unsafe ((array single-float) fixnum fixnum) :float "@0;(#0)->array.self.sf[#1*(#0)->array.dims[1]+#2]")
#+long-float
(def-inline aref :unsafe ((array long-float) fixnum fixnum) :long-double "@0;(#0)->array.self.lf[#1*(#0)->array.dims[1]+#2]")
#+complex-float (def-inline aref :unsafe ((array si:complex-single-float) fixnum fixnum) :csfloat "@0;(#0)->array.self.csf[#1*(#0)->array.dims[1]+#2]")
#+complex-float (def-inline aref :unsafe ((array si:complex-double-float) fixnum fixnum) :cdfloat "@0;(#0)->array.self.cdf[#1*(#0)->array.dims[1]+#2]")
@ -57,7 +56,6 @@
(def-inline aref :unsafe ((array base-char) fixnum) :unsigned-char "(#0)->base_string.self[#1]")
(def-inline aref :unsafe ((array double-float) fixnum) :double "(#0)->array.self.df[#1]")
(def-inline aref :unsafe ((array single-float) fixnum) :float "(#0)->array.self.sf[#1]")
#+long-float
(def-inline aref :unsafe ((array long-float) fixnum) :long-double "(#0)->array.self.lf[#1]")
#+complex-float (def-inline aref :unsafe ((array si:complex-single-float) fixnum) :csfloat "(#0)->array.self.csf[#1]")
#+complex-float (def-inline aref :unsafe ((array si:complex-double-float) fixnum) :cdfloat "(#0)->array.self.cdf[#1]")
@ -81,7 +79,6 @@
(def-inline row-major-aref :unsafe ((array ext:integer32) fixnum) :int32-t "(#0)->vector.self.i32[#1]")
(def-inline row-major-aref :unsafe ((array ext:byte64) fixnum) :uint64-t "(#0)->vector.self.b64[#1]")
(def-inline row-major-aref :unsafe ((array ext:integer64) fixnum) :int64-t "(#0)->vector.self.i64[#1]")
#+long-float
(def-inline row-major-aref :unsafe ((array long-float) fixnum) :long-double "(#0)->array.self.lf[#1]")
(def-inline row-major-aref :unsafe ((array double-float) fixnum) :double "(#0)->array.self.df[#1]")
(def-inline row-major-aref :unsafe ((array single-float) fixnum) :float "(#0)->array.self.sf[#1]")
@ -108,7 +105,6 @@
(def-inline si:row-major-aset :unsafe ((array ext:integer32) fixnum ext:integer32) :int32-t "(#0)->vector.self.i32[#1]= #2")
(def-inline si:row-major-aset :unsafe ((array ext:byte64) fixnum ext:byte64) :uint64-t "(#0)->vector.self.b64[#1]= #2")
(def-inline si:row-major-aset :unsafe ((array ext:integer64) fixnum ext:integer64) :int64-t "(#0)->vector.self.i64[#1]= #2")
#+long-float
(def-inline si:row-major-aset :unsafe ((array long-float) fixnum long-float) :long-double "(#0)->array.self.lf[#1]= #2")
(def-inline si:row-major-aset :unsafe ((array double-float) fixnum double-float) :double "(#0)->array.self.df[#1]= #2")
(def-inline si:row-major-aset :unsafe ((array single-float) fixnum single-float) :float "(#0)->array.self.sf[#1]= #2")
@ -326,7 +322,6 @@
(def-inline 1+ :always (t) t "ecl_one_plus(#0)")
(def-inline 1+ :always (fixnum) t "ecl_make_integer((#0)+1)")
#+long-float
(def-inline 1+ :always (long-float) :long-double "(long double)(#0)+1")
(def-inline 1+ :always (double-float) :double "(double)(#0)+1")
(def-inline 1+ :always (single-float) :float "(float)(#0)+1")
@ -337,7 +332,6 @@
(def-inline 1- :always (t) t "ecl_one_minus(#0)")
(def-inline 1- :always (fixnum) t "ecl_make_integer((#0)-1)")
#+long-float
(def-inline 1- :always (long-float) :long-double "(long double)(#0)-1")
(def-inline 1- :always (double-float) :double "(double)(#0)-1")
(def-inline 1- :always (single-float) :float "(float)(#0)-1")
@ -350,9 +344,7 @@
(def-inline float :always (t single-float) :float "ecl_to_float(#0)")
(def-inline float :always (t double-float) :double "ecl_to_double(#0)")
#+long-float
(def-inline float :always (t long-float) :long-double "ecl_to_long_double(#0)")
#+long-float
(def-inline float :always (fixnum-float) :long-double "((long double)(#0))" :exact-return-type t)
(def-inline float :always (fixnum-float) :double "((double)(#0))" :exact-return-type t)
(def-inline float :always (fixnum-float) :float "((float)(#0))" :exact-return-type t)
@ -491,7 +483,6 @@
(def-inline expt :always ((integer 2 2) (integer 0 29)) :fixnum "(1<<(#1))")
(def-inline expt :always ((integer 0 0) t) :fixnum "0")
(def-inline expt :always ((integer 1 1) t) :fixnum "1")
#+long-float
(def-inline expt :always ((long-float 0.0 *) long-float) :long-double "powl((long double)#0,(long double)#1)")
(def-inline expt :always ((double-float 0.0 *) double-float) :double "pow((double)#0,(double)#1)")
(def-inline expt :always ((single-float 0.0 *) single-float) :float "powf((float)#0,(float)#1)")
@ -499,7 +490,6 @@
#+complex-float (def-inline expt :always (si:complex-double-float si:complex-double-float) :cdfloat "cpow(#0,#1)")
#+complex-float (def-inline expt :always (si:complex-long-float si:complex-long-float) :clfloat "cpowl(#0,#1)")
#+long-float
(def-inline log :always (fixnum-float) :long-double "logl((long double)(#0))" :exact-return-type t)
(def-inline log :always (fixnum-float) :double "log((double)(#0))" :exact-return-type t)
(def-inline log :always (fixnum-float) :float "logf((float)(#0))" :exact-return-type t)
@ -508,7 +498,6 @@
#+complex-float (def-inline log :always (si:complex-long-float) :clfloat "clogl(#0)")
(def-inline sqrt :always (number) number "ecl_sqrt(#0)")
#+long-float
(def-inline sqrt :always ((long-float 0.0 *)) :long-double "sqrtl((long double)(#0))")
(def-inline sqrt :always ((double-float 0.0 *)) :double "sqrt((double)(#0))")
(def-inline sqrt :always ((single-float 0.0 *)) :float "sqrtf((float)(#0))")
@ -517,7 +506,6 @@
#+complex-float (def-inline sqrt :always (si:complex-long-float) :clfloat "csqrtl(#0)")
(def-inline sin :always (number) number "ecl_sin(#0)")
#+long-float
(def-inline sin :always (fixnum-float) :long-double "sinl((long double)(#0))" :exact-return-type t)
(def-inline sin :always (fixnum-float) :double "sin((double)(#0))" :exact-return-type t)
(def-inline sin :always (fixnum-float) :float "sinf((float)(#0))" :exact-return-type t)
@ -526,7 +514,6 @@
#+complex-float (def-inline sin :always (si:complex-long-float) :clfloat "csinl(#0)")
(def-inline cos :always (t) number "ecl_cos(#0)")
#+long-float
(def-inline cos :always (fixnum-float) :long-double "cosl((long double)(#0))" :exact-return-type t)
(def-inline cos :always (fixnum-float) :double "cos((double)(#0))" :exact-return-type t)
(def-inline cos :always (fixnum-float) :float "cosf((float)(#0))" :exact-return-type t)
@ -535,7 +522,6 @@
#+complex-float (def-inline cos :always (si:complex-long-float) :clfloat "ccosl(#0)")
(def-inline tan :always (t) number "ecl_tan(#0)")
#+long-float
(def-inline tan :always (fixnum-float) :long-double "tanl((long double)(#0))" :exact-return-type t)
(def-inline tan :always (fixnum-float) :double "tan((double)(#0))" :exact-return-type t)
(def-inline tan :always (fixnum-float) :float "tanf((float)(#0))" :exact-return-type t)
@ -544,7 +530,6 @@
#+complex-float (def-inline tan :always (si:complex-long-float) :clfloat "ctanl(#0)")
(def-inline sinh :always (t) number "ecl_sinh(#0)")
#+long-float
(def-inline sinh :always (fixnum-float) :long-double "sinhl((long double)(#0))" :exact-return-type t)
(def-inline sinh :always (fixnum-float) :double "sinh((double)(#0))" :exact-return-type t)
(def-inline sinh :always (fixnum-float) :float "sinhf((float)(#0))" :exact-return-type t)
@ -553,7 +538,6 @@
#+complex-float (def-inline sinh :always (si:complex-long-float) :clfloat "csinhl(#0)")
(def-inline cosh :always (t) number "ecl_cosh(#0)")
#+long-float
(def-inline cosh :always (fixnum-float) :long-double "coshl((long double)(#0))" :exact-return-type t)
(def-inline cosh :always (fixnum-float) :double "cosh((double)(#0))" :exact-return-type t)
(def-inline cosh :always (fixnum-float) :float "coshf((float)(#0))" :exact-return-type t)
@ -562,7 +546,6 @@
#+complex-float (def-inline cosh :always (si:complex-long-float) :clfloat "ccoshl(#0)")
(def-inline tanh :always (t) number "ecl_tanh(#0)")
#+long-float
(def-inline tanh :always (fixnum-float) :long-double "tanhl((long double)(#0))" :exact-return-type t)
(def-inline tanh :always (fixnum-float) :double "tanh((double)(#0))" :exact-return-type t)
(def-inline tanh :always (fixnum-float) :float "tanhf((float)(#0))" :exact-return-type t)
@ -775,9 +758,6 @@
(def-inline si:double-float-p :always (t) :bool "@0;ECL_DOUBLE_FLOAT_P(#0)")
#-long-float
(def-inline si:long-float-p :always (t) :bool "@0;ECL_DOUBLE_FLOAT_P(#0)")
#+long-float
(def-inline si:long-float-p :always (t) :bool "@0;ECL_LONG_FLOAT_P(#0)")
#+complex-float

79
src/configure vendored
View file

@ -740,6 +740,7 @@ infodir
docdir
oldincludedir
includedir
runstatedir
localstatedir
sharedstatedir
sysconfdir
@ -800,7 +801,6 @@ with_signed_zero
with_ieee_fp
with_sse
enable_unicode
enable_longdouble
enable_c99complex
enable_smallcons
enable_gengc
@ -866,6 +866,7 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@ -1118,6 +1119,15 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
-runstatedir | --runstatedir | --runstatedi | --runstated \
| --runstate | --runstat | --runsta | --runst | --runs \
| --run | --ru | --r)
ac_prev=runstatedir ;;
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
| --run=* | --ru=* | --r=*)
runstatedir=$ac_optarg ;;
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@ -1255,7 +1265,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir
libdir localedir mandir runstatedir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
@ -1408,6 +1418,7 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@ -1460,8 +1471,6 @@ Optional Features:
(portable|included|system|auto, default=auto)
--enable-unicode={32|16|no}
enable support for unicode (default=32)
--enable-longdouble include support for long double (yes|no|auto,
default=AUTO)
--enable-c99complex include support for c99 complex floats
(default=auto)
--enable-smallcons use small (2 words) cons types. Requires
@ -2958,14 +2967,6 @@ else
fi
# Check whether --enable-longdouble was given.
if test "${enable_longdouble+set}" = set; then :
enableval=$enable_longdouble; enable_longdouble=${enableval}
else
enable_longdouble=yes
fi
# Check whether --enable-c99complex was given.
if test "${enable_c99complex+set}" = set; then :
enableval=$enable_c99complex; enable_c99complex=${enableval}
@ -8219,22 +8220,6 @@ $as_echo "no" >&6; }
fi
if test "$enable_longdouble" != "no" ; then
ac_fn_c_check_type "$LINENO" "long double" "ac_cv_type_long_double" "$ac_includes_default"
if test "x$ac_cv_type_long_double" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LONG_DOUBLE 1
_ACEOF
enable_longdouble=yes,
$as_echo "#define ECL_LONG_FLOAT /**/" >>confdefs.h
enable_longdouble=no
fi
fi
if test "$enable_c99complex" != "no" ; then
ac_fn_c_check_type "$LINENO" "float complex" "ac_cv_type_float_complex" "#include <complex.h>
"
@ -8244,9 +8229,7 @@ cat >>confdefs.h <<_ACEOF
#define HAVE_FLOAT_COMPLEX 1
_ACEOF
enable_c99complex=yes,
$as_echo "#define ECL_COMPLEX_FLOAT /**/" >>confdefs.h
enable_c99complex=yes
else
enable_c99complex=no
fi
@ -8258,9 +8241,7 @@ cat >>confdefs.h <<_ACEOF
#define HAVE_DOUBLE_COMPLEX 1
_ACEOF
enable_c99complex=yes,
$as_echo "#define ECL_COMPLEX_FLOAT /**/" >>confdefs.h
enable_c99complex=yes
else
enable_c99complex=no
fi
@ -8272,13 +8253,37 @@ cat >>confdefs.h <<_ACEOF
#define HAVE_LONG_COMPLEX 1
_ACEOF
enable_c99complex=yes,
$as_echo "#define ECL_COMPLEX_FLOAT /**/" >>confdefs.h
enable_c99complex=yes
else
enable_c99complex=no
fi
fi
if test "$enable_c99complex" != "no" ; then
for ac_func in crealf creal creall cimagf cimag cimagl \
cabsf cabs cabsl conjf conj conjl csqrtf csqrt csqrtl \
ccosf ccos ccosl csinf csin csinl ctanf ctan ctanl \
ccoshf ccosh ccoshl csinhf csinh csinhl ctanhf ctanh ctanhl \
cexpf cexp cexpl cpowf cpow cpowl clogf clog clogl \
casinf casin casinl cacosf cacos cacosl catanf catan catanl \
casinhf casinh casinhl cacoshf cacosh cacoshl catanhf catanh catanhl \
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
enable_c99complex=no
fi
done
fi
if test "$enable_c99complex" != "no" ; then
$as_echo "#define ECL_COMPLEX_FLOAT /**/" >>confdefs.h
fi

View file

@ -229,12 +229,6 @@ AC_ARG_ENABLE(unicode,
[enable support for unicode (default=32)]),
[], [enable_unicode=32])
AC_ARG_ENABLE(longdouble,
AS_HELP_STRING( [--enable-longdouble],
[include support for long double]
[(yes|no|auto, default=AUTO)]),
[enable_longdouble=${enableval}], [enable_longdouble=yes])
AC_ARG_ENABLE(c99complex,
AS_HELP_STRING( [--enable-c99complex],
[include support for c99 complex floats]
@ -714,7 +708,6 @@ ECL_FIND_SETJMP
ECL_FILE_STRUCTURE
ECL_FPE_MODEL
ECL_SSE
ECL_LONG_DOUBLE
ECL_COMPLEX_C99
dnl -----------------------------------------------------------------------

View file

@ -178,10 +178,10 @@ Numeric C types understood by ECL
@subsubheading Description
The table above shows the relation between C types and the equivalent Common Lisp types. All types are standard C99 types, except for two. First, @code{cl_fixnum} is the smallest signed integer that can fit a fixnum. Second, @code{cl_index} is the smallest unsigned integer that fits a fixnum and is typically the unsigned counterpart of @code{cl_fixnum}.
@cfindex --enable-longdouble [auto]
(*) The long double does not exist on all platforms. When it exists,
the macro @code{ECL_LONG_DOUBLE} will be defined, and
@code{long-double} will be equivalent to it.
(*) @strong{DEPRECATED} Previous versions of ECL supported compilers
that did not define the long double type. The @code{ECL_LONG_DOUBLE}
macro and @code{long-double} feature will be removed in the next
release.
@cfindex --enable-c99complex [auto]
(**) The <float> _Complex types do not exist on all platforms. When

View file

@ -105,12 +105,15 @@ and environment variables.
Cross compiling ECL for Android requires first building the host ECL
program. At present this host ECL needs to have the same word size and
long double capabilities as the target system. Therefore, to build the
host ECL for a 32 bit ARM system, use the following commands:
same optional capabilities (e.g. threads, C99 complex floats) as
the target system. Therefore, to build the host ECL for a 32 bit ARM
system, use the following commands:
@example
# C99 complex numbers are not fully supported on Android
./configure ABI=32 CFLAGS="-m32 -g -O2" LDFLAGS="-m32 -g -O2"\
--prefix=`pwd`/ecl-android-host --disable-longdouble
--prefix=`pwd`/ecl-android-host \
--disable-c99complex
make -j9
make install
rm -r build
@ -142,6 +145,7 @@ export CPPFLAGS="--sysroot=${SYSROOT} -D__ANDROID_API__=${ANDROID_API} -isystem
export CC=arm-linux-androideabi-clang
./configure --host=arm-linux-androideabi \
--prefix=`pwd`/ecl-android \
--disable-c99complex \
--with-cross-config=`pwd`/src/util/android-arm.cross_config
make -j9
make install

View file

@ -33,9 +33,6 @@
/* ECL_LIBATOMIC_OPS_H */
#undef ECL_LIBATOMIC_OPS_H
/* ECL_LONG_FLOAT */
#undef ECL_LONG_FLOAT
/* ECL_LONG_LONG_BITS */
#undef ECL_LONG_LONG_BITS
@ -90,9 +87,126 @@
/* Define to 1 if you have the `backtrace_symbols' function. */
#undef HAVE_BACKTRACE_SYMBOLS
/* Define to 1 if you have the `cabs' function. */
#undef HAVE_CABS
/* Define to 1 if you have the `cabsf' function. */
#undef HAVE_CABSF
/* Define to 1 if you have the `cabsl' function. */
#undef HAVE_CABSL
/* Define to 1 if you have the `cacos' function. */
#undef HAVE_CACOS
/* Define to 1 if you have the `cacosf' function. */
#undef HAVE_CACOSF
/* Define to 1 if you have the `cacosh' function. */
#undef HAVE_CACOSH
/* Define to 1 if you have the `cacoshf' function. */
#undef HAVE_CACOSHF
/* Define to 1 if you have the `cacoshl' function. */
#undef HAVE_CACOSHL
/* Define to 1 if you have the `cacosl' function. */
#undef HAVE_CACOSL
/* Define to 1 if you have the `casin' function. */
#undef HAVE_CASIN
/* Define to 1 if you have the `casinf' function. */
#undef HAVE_CASINF
/* Define to 1 if you have the `casinh' function. */
#undef HAVE_CASINH
/* Define to 1 if you have the `casinhf' function. */
#undef HAVE_CASINHF
/* Define to 1 if you have the `casinhl' function. */
#undef HAVE_CASINHL
/* Define to 1 if you have the `casinl' function. */
#undef HAVE_CASINL
/* Define to 1 if you have the `catan' function. */
#undef HAVE_CATAN
/* Define to 1 if you have the `catanf' function. */
#undef HAVE_CATANF
/* Define to 1 if you have the `catanh' function. */
#undef HAVE_CATANH
/* Define to 1 if you have the `catanhf' function. */
#undef HAVE_CATANHF
/* Define to 1 if you have the `catanhl' function. */
#undef HAVE_CATANHL
/* Define to 1 if you have the `catanl' function. */
#undef HAVE_CATANL
/* Define to 1 if you have the `ccos' function. */
#undef HAVE_CCOS
/* Define to 1 if you have the `ccosf' function. */
#undef HAVE_CCOSF
/* Define to 1 if you have the `ccosh' function. */
#undef HAVE_CCOSH
/* Define to 1 if you have the `ccoshf' function. */
#undef HAVE_CCOSHF
/* Define to 1 if you have the `ccoshl' function. */
#undef HAVE_CCOSHL
/* Define to 1 if you have the `ccosl' function. */
#undef HAVE_CCOSL
/* Define to 1 if you have the `ceilf' function. */
#undef HAVE_CEILF
/* Define to 1 if you have the `cexp' function. */
#undef HAVE_CEXP
/* Define to 1 if you have the `cexpf' function. */
#undef HAVE_CEXPF
/* Define to 1 if you have the `cexpl' function. */
#undef HAVE_CEXPL
/* Define to 1 if you have the `cimag' function. */
#undef HAVE_CIMAG
/* Define to 1 if you have the `cimagf' function. */
#undef HAVE_CIMAGF
/* Define to 1 if you have the `cimagl' function. */
#undef HAVE_CIMAGL
/* Define to 1 if you have the `clog' function. */
#undef HAVE_CLOG
/* Define to 1 if you have the `clogf' function. */
#undef HAVE_CLOGF
/* Define to 1 if you have the `clogl' function. */
#undef HAVE_CLOGL
/* Define to 1 if you have the `conj' function. */
#undef HAVE_CONJ
/* Define to 1 if you have the `conjf' function. */
#undef HAVE_CONJF
/* Define to 1 if you have the `conjl' function. */
#undef HAVE_CONJL
/* Define to 1 if you have the `copysign' function. */
#undef HAVE_COPYSIGN
@ -102,6 +216,69 @@
/* Define to 1 if you have the `coshf' function. */
#undef HAVE_COSHF
/* Define to 1 if you have the `cpow' function. */
#undef HAVE_CPOW
/* Define to 1 if you have the `cpowf' function. */
#undef HAVE_CPOWF
/* Define to 1 if you have the `cpowl' function. */
#undef HAVE_CPOWL
/* Define to 1 if you have the `creal' function. */
#undef HAVE_CREAL
/* Define to 1 if you have the `crealf' function. */
#undef HAVE_CREALF
/* Define to 1 if you have the `creall' function. */
#undef HAVE_CREALL
/* Define to 1 if you have the `csin' function. */
#undef HAVE_CSIN
/* Define to 1 if you have the `csinf' function. */
#undef HAVE_CSINF
/* Define to 1 if you have the `csinh' function. */
#undef HAVE_CSINH
/* Define to 1 if you have the `csinhf' function. */
#undef HAVE_CSINHF
/* Define to 1 if you have the `csinhl' function. */
#undef HAVE_CSINHL
/* Define to 1 if you have the `csinl' function. */
#undef HAVE_CSINL
/* Define to 1 if you have the `csqrt' function. */
#undef HAVE_CSQRT
/* Define to 1 if you have the `csqrtf' function. */
#undef HAVE_CSQRTF
/* Define to 1 if you have the `csqrtl' function. */
#undef HAVE_CSQRTL
/* Define to 1 if you have the `ctan' function. */
#undef HAVE_CTAN
/* Define to 1 if you have the `ctanf' function. */
#undef HAVE_CTANF
/* Define to 1 if you have the `ctanh' function. */
#undef HAVE_CTANH
/* Define to 1 if you have the `ctanhf' function. */
#undef HAVE_CTANHF
/* Define to 1 if you have the `ctanhl' function. */
#undef HAVE_CTANHL
/* Define to 1 if you have the `ctanl' function. */
#undef HAVE_CTANL
/* Define to 1 if you have the <dirent.h> header file. */
#undef HAVE_DIRENT_H
@ -213,9 +390,6 @@
/* Define to 1 if the system has the type `long complex'. */
#undef HAVE_LONG_COMPLEX
/* Define to 1 if the system has the type `long double'. */
#undef HAVE_LONG_DOUBLE
/* Define to 1 if you have the `lstat' function. */
#undef HAVE_LSTAT

View file

@ -241,16 +241,7 @@
# define signbit(x) (copysign(1.0,(x)))
# endif
# ifndef isfinite
# ifdef __sun__
# ifndef ECL_LONG_FLOAT
# include <ieeefp.h>
# define isfinite(x) finite(x)
# else
# error "Function isfinite() is missing"
# endif
# else
# define isfinite(x) finite(x)
# endif
# error "Function isfinite() is missing"
# endif
# ifndef signbit
# ifndef ECL_SIGNED_ZERO

View file

@ -200,8 +200,9 @@ typedef unsigned char ecl_base_char;
*/
#define ECL_SLOTS_LIMIT 32768
/* compiler understands long double */
#undef ECL_LONG_FLOAT
/* compiler understands long float */
#define ECL_LONG_FLOAT
/* compiler understands complex */
#undef ECL_COMPLEX_FLOAT

View file

@ -44,10 +44,8 @@ enum ecl_locative_type {
_ecl_base_char_loc,
_ecl_uni_char_loc,
_ecl_float_loc,
_ecl_double_loc
#ifdef ECL_LONG_FLOAT
, _ecl_long_double_loc
#endif
_ecl_double_loc,
_ecl_long_double_loc
#ifdef ECL_COMPLEX_FLOAT
, _ecl_csfloat_loc
, _ecl_cdfloat_loc

View file

@ -10,6 +10,23 @@
#include <complex.h>
#endif
/*
* If minimum unnormalized floating point values defined in ISO C11
* are not declared, we use the normalized ones as the next best
* portable approximation.
*/
#include <float.h>
#ifndef FLT_TRUE_MIN
# define FLT_TRUE_MIN FLT_MIN
#endif
#ifndef DBL_TRUE_MIN
# define DBL_TRUE_MIN DBL_MIN
#endif
#ifndef LDBL_TRUE_MIN
# define LDBL_TRUE_MIN LDBL_MIN
#endif
/*
* Loops over a proper list. Complains on circularity
*/

View file

@ -206,10 +206,8 @@ struct cl_core_struct {
cl_object doublefloat_zero;
cl_object singlefloat_minus_zero;
cl_object doublefloat_minus_zero;
#ifdef ECL_LONG_FLOAT
cl_object longfloat_zero;
cl_object longfloat_minus_zero;
#endif
cl_object gensym_prefix;
cl_object gentemp_prefix;
@ -1133,10 +1131,8 @@ extern ECL_API cl_object cl_rational(cl_object x);
#define cl_rationalize cl_rational
extern ECL_API float ecl_to_float(cl_object x);
extern ECL_API double ecl_to_double(cl_object x);
#ifdef ECL_LONG_FLOAT
extern ECL_API long double ecl_to_long_double(cl_object x);
extern ECL_API cl_object ecl_make_long_float(long double f);
#endif
#ifdef ECL_COMPLEX_FLOAT
extern ECL_API cl_object ecl_make_csfloat(float _Complex x);
extern ECL_API cl_object ecl_make_cdfloat(double _Complex x);

View file

@ -23,12 +23,6 @@
typedef cl_object (*math_one_arg_fn)(cl_object);
#ifdef ECL_LONG_FLOAT
#define MATH_LONG_DOUBLE(opt) opt,
#else
#define MATH_LONG_DOUBLE(opt)
#endif
#ifdef ECL_COMPLEX_FLOAT
#define MATH_CFLOAT(c1,c2,c3) c1, c2, c3
#else
@ -48,7 +42,7 @@ typedef cl_object (*math_one_arg_fn)(cl_object);
fix, big, ratio, /* t_fixnum, t_bignum, t_ratio */ \
single_float, /* t_singlefloat */ \
double_float, /* t_doublefloat */ \
MATH_LONG_DOUBLE(long_float) /* t_longfloat */ \
long_float, /* t_longfloat */ \
complex, /* t_complex */ \
MATH_CFLOAT(csfloat,cdfloat,clfloat) /* t_c?float */ }; \
cl_object ecl_##name(cl_object arg) \
@ -89,9 +83,9 @@ typedef int (*math_one_arg_bool_fn)(cl_object);
fix, big, ratio, /* t_fixnum, t_bignum, t_ratio */ \
single_float, /* t_singlefloat */ \
double_float, /* t_doublefloat */ \
MATH_LONG_DOUBLE(long_float) /* t_longfloat */ \
complex, /* t_complex */ \
MATH_CFLOAT(csfloat,cdfloat,clfloat) /* t_c?float */ }; \
long_float, /* t_longfloat */ \
complex, /* t_complex */ \
MATH_CFLOAT(csfloat,cdfloat,clfloat) /* t_c?float */ }; \
int ecl_##name(cl_object arg) \
{ \
int t = ECL_IMMEDIATE(arg); \

View file

@ -72,9 +72,7 @@ static const cl_index ecl_aet_size[] = {
sizeof(cl_object), /* ecl_aet_object */
sizeof(float), /* ecl_aet_sf */
sizeof(double), /* ecl_aet_df */
#ifdef ECL_LONG_FLOAT
sizeof(long double), /* ecl_aet_lf */
#endif
#ifdef ECL_COMPLEX_FLOAT
sizeof(_Complex float), /* ecl_aet_csf */
sizeof(_Complex double), /* ecl_aet_cdf */
@ -346,9 +344,7 @@ extern cl_object _ecl_library_default_entry(void);
extern cl_object _ecl_double_to_integer(double d);
extern cl_object _ecl_float_to_integer(float d);
#ifdef ECL_LONG_FLOAT
extern cl_object _ecl_long_double_to_integer(long double d);
#endif
#ifdef ECL_COMPLEX_FLOAT
extern cl_object si_complex_float_p(cl_object o);
extern cl_object ecl_make_complex_float(cl_object r, cl_object i);
@ -681,23 +677,6 @@ static union {
# endif /* _MSC_VER == 1600 */
#endif /* ~NAN */
/*
* If minimum unnormalized floating point values defined in ISO C11
* are not declared, we use the normalized ones as the next best
* portable approximation.
*/
#include <float.h>
#ifndef FLT_TRUE_MIN
# define FLT_TRUE_MIN FLT_MIN
#endif
#ifndef DBL_TRUE_MIN
# define DBL_TRUE_MIN DBL_MIN
#endif
#ifndef LDBL_TRUE_MIN
# define LDBL_TRUE_MIN LDBL_MIN
#endif
#ifdef ECL_COMPLEX_FLOAT
#include <complex.h>
#endif

View file

@ -36,9 +36,7 @@ extern ECL_API cl_object _ecl_big_set_fixnum(cl_object x, cl_fixnum f);
extern ECL_API cl_object _ecl_big_set_index(cl_object x, cl_index f);
extern ECL_API cl_fixnum _ecl_big_get_fixnum(cl_object x);
extern ECL_API cl_index _ecl_big_get_index(cl_object x);
#ifdef ECL_LONG_FLOAT
extern ECL_API long double _ecl_big_to_long_double(cl_object x);
#endif
typedef void (*_ecl_big_binary_op)(cl_object out, cl_object o1, cl_object o2);
extern ECL_API _ecl_big_binary_op _ecl_big_boole_operator(int op);

View file

@ -49,9 +49,7 @@ typedef enum {
/* t_shortfloat, */
t_singlefloat,
t_doublefloat,
#ifdef ECL_LONG_FLOAT
t_longfloat,
#endif
t_complex,
#ifdef ECL_COMPLEX_FLOAT
t_csfloat,
@ -187,9 +185,7 @@ typedef cl_object (*cl_objectfn_fixed)();
#define ECL_RANDOM_STATE_P(x) ((ECL_IMMEDIATE(x) == 0) && ((x)->d.t == t_random))
#define ECL_SINGLE_FLOAT_P(x) ((ECL_IMMEDIATE(x) == 0) && ((x)->d.t == t_singlefloat))
#define ECL_DOUBLE_FLOAT_P(x) ((ECL_IMMEDIATE(x) == 0) && ((x)->d.t == t_doublefloat))
#ifdef ECL_LONG_FLOAT
#define ECL_LONG_FLOAT_P(x) ((ECL_IMMEDIATE(x) == 0) && ((x)->d.t == t_longfloat))
#endif
#define ECL_PACKAGEP(x) ((ECL_IMMEDIATE(x) == 0) && ((x)->d.t == t_package))
#define ECL_PATHNAMEP(x) ((ECL_IMMEDIATE(x) == 0) && ((x)->d.t == t_pathname))
#define ECL_READTABLEP(x) ((ECL_IMMEDIATE(x) == 0) && ((x)->d.t == t_readtable))
@ -214,13 +210,11 @@ struct ecl_doublefloat {
};
#define ecl_double_float(o) ((o)->DF.DFVAL)
#ifdef ECL_LONG_FLOAT
struct ecl_long_float {
_ECL_HDR;
long double value;
};
#define ecl_long_float(o) ((o)->longfloat.value)
#endif
struct ecl_bignum {
_ECL_HDR;
@ -424,9 +418,7 @@ typedef enum { /* array element type */
ecl_aet_object, /* t */
ecl_aet_sf, /* single-float */
ecl_aet_df, /* double-float */
#ifdef ECL_LONG_FLOAT
ecl_aet_lf, /* long-float */
#endif
#ifdef ECL_COMPLEX_FLOAT
ecl_aet_csf, /* complex-single-float */
ecl_aet_cdf, /* complex-double-float */
@ -479,9 +471,7 @@ union ecl_array_data {
#endif
float *sf;
double *df;
#ifdef ECL_LONG_FLOAT
long double *lf;
#endif
#ifdef ECL_COMPLEX_FLOAT
float _Complex *csf;
double _Complex *cdf;
@ -832,9 +822,7 @@ enum ecl_ffi_tag {
ECL_FFI_OBJECT,
ECL_FFI_FLOAT,
ECL_FFI_DOUBLE,
#ifdef ECL_LONG_FLOAT
ECL_FFI_LONG_DOUBLE,
#endif
#ifdef ECL_COMPLEX_FLOAT
ECL_FFI_CSFLOAT,
ECL_FFI_CDFLOAT,
@ -880,9 +868,7 @@ union ecl_ffi_values {
cl_object o;
float f;
double d;
#ifdef ECL_LONG_FLOAT
long double lf;
#endif
#ifdef ECL_COMPLEX_FLOAT
float _Complex csf;
double _Complex cdf;
@ -1091,9 +1077,7 @@ union cl_lispunion {
struct ecl_ratio ratio; /* ratio */
struct ecl_singlefloat SF; /* single floating-point number */
struct ecl_doublefloat DF; /* double floating-point number */
#ifdef ECL_LONG_FLOAT
struct ecl_long_float longfloat; /* long-float */
#endif
struct ecl_complex gencomplex; /* generic complex number */
#ifdef ECL_COMPLEX_FLOAT
struct ecl_csfloat csfloat; /* complex single float */

View file

@ -164,7 +164,6 @@ RADIANS) and (SIN RADIANS) respectively."
:one-liner t)
#-complex-float
(progn ,@gencomplex)))
#+long-float
(long-float
(if ,restriction
(ffi::c-inline (,arg) (:long-double) :long-double
@ -249,13 +248,11 @@ Returns the arc cosine of NUMBER."
(progn
(ffi:clines "double asinh(double x) { return log(x+sqrt(1.0+x*x)); }")
(ffi:clines "double acosh(double x) { return log(x+sqrt((x-1)*(x+1))); }")
(ffi:clines "double atanh(double x) { return log((1+x)/(1-x))/2; }"))
#+(and long-float (not ecl-min) win32 (not mingw32))
(progn
(ffi:clines "double asinhl(long double x) { return logl(x+sqrtl(1.0+x*x)); }")
(ffi:clines "double acoshl(long double x) { return logl(x+sqrtl((x-1)*(x+1))); }")
(ffi:clines "double atanhl(long double x) { return logl((1+x)/(1-x))/2; }"))
(ffi:clines "double atanh(double x) { return log((1+x)/(1-x))/2; }")
(ffi:clines "long double asinhl(long double x) { return logl(x+sqrtl(1.0+x*x)); }")
(ffi:clines "long double acoshl(long double x) { return logl(x+sqrtl((x-1)*(x+1))); }")
(ffi:clines "long double atanhl(long double x) { return logl((1+x)/(1-x))/2; }"))
(defun asinh (x)
"Args: (number)

View file

@ -186,12 +186,6 @@ MOST-POSITIVE-FIXNUM inclusive. Other integers are bignums."
`(single-float ,@args)
'single-float))
#-long-float
(deftype long-float (&rest args)
(if args
`(double-float ,@args)
'double-float))
(deftype bit ()
"A BIT is either integer 0 or 1."
'(INTEGER 0 1))
@ -376,20 +370,12 @@ and is not adjustable."
#+ecl-min
(eq (type-of x) 'double-float))
#+long-float
(defun long-float-p (x)
#-ecl-min
(ffi::c-inline (x) (t) :bool "ecl_t_of(#0) == t_longfloat" :one-liner t)
#+ecl-min
(eq (type-of x) 'long-float))
#-long-float
(defun long-float-p (x)
#-ecl-min
(ffi::c-inline (x) (t) :bool "ecl_t_of(#0) == t_doublefloat" :one-liner t)
#+ecl-min
(eq (type-of x) 'double-float))
#+complex-float
(defun complex-single-float-p (x)
#-ecl-min
@ -476,7 +462,7 @@ and is not adjustable."
(when (< 32 cl-fixnum-bits 64) '(EXT::CL-INDEX FIXNUM))
#+:uint64-t '(EXT:BYTE64 EXT:INTEGER64)
(when (< 64 cl-fixnum-bits) '(EXT::CL-INDEX FIXNUM))
'(SINGLE-FLOAT DOUBLE-FLOAT #+long-float LONG-FLOAT)
'(SINGLE-FLOAT DOUBLE-FLOAT LONG-FLOAT)
#+complex-float '(si:complex-single-float
si:complex-double-float
si:complex-long-float)
@ -1304,14 +1290,14 @@ if not possible."
#+short-float (SHORT-FLOAT (SHORT-FLOAT * *))
(SINGLE-FLOAT (SINGLE-FLOAT * *))
(DOUBLE-FLOAT (DOUBLE-FLOAT * *))
#+long-float (LONG-FLOAT (LONG-FLOAT * *))
(LONG-FLOAT (LONG-FLOAT * *))
(RATIO (RATIO * *))
(RATIONAL (OR INTEGER RATIO))
(FLOAT (OR #+short-float SHORT-FLOAT
SINGLE-FLOAT
DOUBLE-FLOAT
#+long-float LONG-FLOAT))
LONG-FLOAT))
(REAL (OR RATIONAL FLOAT))
@ -1482,14 +1468,13 @@ if not possible."
SINGLE-FLOAT
DOUBLE-FLOAT
RATIO
#+long-float LONG-FLOAT)
LONG-FLOAT)
(register-interval-type type))
((FLOAT)
(canonical-type `(OR #+short-float
(SHORT-FLOAT ,@(rest type))
(SINGLE-FLOAT ,@(rest type))
(DOUBLE-FLOAT ,@(rest type))
#+long-float
(LONG-FLOAT ,@(rest type)))))
((REAL)
(canonical-type `(OR (INTEGER ,@(rest type))
@ -1498,7 +1483,6 @@ if not possible."
(SHORT-FLOAT ,@(rest type))
(SINGLE-FLOAT ,@(rest type))
(DOUBLE-FLOAT ,@(rest type))
#+long-float
(LONG-FLOAT ,@(rest type)))))
((RATIONAL)
(canonical-type `(OR (INTEGER ,@(rest type))

View file

@ -911,13 +911,11 @@ Use special code 0 to cancel this operation.")
output = ecl_make_double_float(*p);
break;
}
#ifdef ECL_LONG_FLOAT
case _ecl_long_double_loc: {
long double *p = (long double*)value;
output = ecl_make_long_float(*p);
break;
}
#endif
#ifdef ECL_COMPLEX_FLOAT
case _ecl_csfloat_loc: {
_Complex float *p = (_Complex float*)value;

View file

@ -310,7 +310,7 @@
'(2/3 . eql) ; ratio
'(12.3f4 . eql) ; floats
'(13.2d4 . eql)
#+long-float '(14.2l3 . eql)
'(14.2l3 . eql)
'(#c(4 7) . eql) ; complexes
'(#c(1.0f0 2.0f0) . eql)
'(#c(1.0d0 2.0d0) . eql)