mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-23 04:52:42 -08:00
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:
parent
503cf170c7
commit
6b07439dfe
8 changed files with 30 additions and 25 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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},
|
||||
|
|
|
|||
|
|
@ -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},
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue