ieee-fp: remove si_infinity

Our "new" way of defining infinity constants breaks on ARM. Remove
unnecessary functions.

IEEE-FP are a nightmare (honestly).
This commit is contained in:
Daniel Kochmański 2016-11-18 13:48:22 +01:00
parent 503cf170c7
commit 6b07439dfe
8 changed files with 30 additions and 25 deletions

View file

@ -65,6 +65,18 @@ bool
ecl_float_nan_p(cl_object x)
{
return !ecl_number_equalp(x,x);
/* switch (ecl_t_of(x)) { */
/* case t_singlefloat: */
/* 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; */
/* } */
}
bool

View file

@ -923,10 +923,4 @@ si_nan() {
cl_object x = ecl_alloc_object(t_doublefloat);
ecl_double_float(x) = NAN;
}
cl_object
si_infinity() {
cl_object x = ecl_alloc_object(t_doublefloat);
ecl_double_float(x) = INFINITY;
}
#endif /* ECL_IEEE_FP */

View file

@ -1912,7 +1912,6 @@ cl_symbols[] = {
#ifdef ECL_IEEE_FP
{SYS_ "NAN", EXT_ORDINARY, si_nan, 0, OBJNULL},
{SYS_ "INFINITY", EXT_ORDINARY, si_infinity, 0, OBJNULL},
{EXT_ "SHORT-FLOAT-POSITIVE-INFINITY", EXT_CONSTANT, NULL, -1, OBJNULL},
{EXT_ "SINGLE-FLOAT-POSITIVE-INFINITY", EXT_CONSTANT, NULL, -1, OBJNULL},

View file

@ -1912,7 +1912,6 @@ cl_symbols[] = {
#ifdef ECL_IEEE_FP
{SYS_ "NAN","si_nan"},
{SYS_ "INFINITY","si_infinity"},
{EXT_ "SHORT-FLOAT-POSITIVE-INFINITY",NULL},
{EXT_ "SINGLE-FLOAT-POSITIVE-INFINITY",NULL},

View file

@ -63,7 +63,6 @@
@c build option --with-ieee-fp={yes|no}
@c si::trap-fpe
@c si::nan
@c si::infinity
@c ext:{short,single,double,long}-float-{positive,negative}-infinity
@c ext:float-nan-p
@c ext:float-infinity-p

View file

@ -1119,7 +1119,6 @@ extern ECL_API cl_object ecl_make_long_float(long double f);
#endif
#ifdef ECL_IEEE_FP
extern cl_object si_nan();
extern cl_object si_infinity();
#endif /* ECL_IEEE_FP */
/* num_co.c */

View file

@ -74,19 +74,23 @@
))
#+ieee-floating-point
(let ((bits (si:trap-fpe 'last nil)))
(unwind-protect
(locally (declare (notinline -))
(let ((inf (si:infinity)))
(defconstant short-float-positive-infinity (coerce inf 'short-float))
(defconstant short-float-negative-infinity (coerce (- inf) 'short-float))
(defconstant single-float-positive-infinity (coerce inf 'single-float))
(defconstant single-float-negative-infinity (coerce (- inf) 'single-float))
(defconstant double-float-positive-infinity (coerce inf 'double-float))
(defconstant double-float-negative-infinity (coerce (- inf) 'double-float))
(defconstant long-float-positive-infinity (coerce inf 'long-float))
(defconstant long-float-negative-infinity (coerce (- inf) 'long-float))))
(si:trap-fpe bits t)))
(locally (declare (notinline -))
(let ((bits (si::trap-fpe 'last nil)))
(unwind-protect
(progn
(let ((a (/ (coerce 1 'short-float) (coerce 0.0 'short-float))))
(defconstant short-float-positive-infinity a)
(defconstant short-float-negative-infinity (- a)))
(let ((a (/ (coerce 1 'single-float) (coerce 0.0 'single-float))))
(defconstant single-float-positive-infinity a)
(defconstant single-float-negative-infinity (- a)))
(let ((a (/ (coerce 1 'double-float) (coerce 0.0 'double-float))))
(defconstant double-float-positive-infinity a)
(defconstant double-float-negative-infinity (- a)))
(let ((a (/ (coerce 1 'long-float) (coerce 0.0 'long-float))))
(defconstant long-float-positive-infinity a)
(defconstant long-float-negative-infinity (- a))))
(si::trap-fpe bits t))))
(defconstant imag-one #C(0.0 1.0))

View file

@ -25,8 +25,7 @@
ext:single-float-positive-infinity
ext:double-float-negative-infinity
ext:double-float-positive-infinity
(si:nan)
(si:infinity)))
(si:nan)))
(*standard-output* (make-string-output-stream)))
(dolist (i nums)
(finishes