mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-13 12:52:08 -08:00
Activated the use of statically defined floating point constants in compiled code
This commit is contained in:
parent
21e1ab0455
commit
2c68c6f008
1 changed files with 12 additions and 6 deletions
|
|
@ -170,13 +170,15 @@
|
|||
|
||||
(defun static-single-float-builder (name value stream)
|
||||
(let* ((*read-default-float-format* 'single-float)
|
||||
(*print-readably* t))
|
||||
(format stream "ecl_def_ct_single_float(~A,~S,static,const);" name value stream)))
|
||||
(*print-readably* t))
|
||||
(format stream "ecl_def_ct_single_float(~A,~S,static,const);"
|
||||
name value stream)))
|
||||
|
||||
(defun static-double-float-builder (name value stream)
|
||||
(let* ((*read-default-float-format* 'double-float)
|
||||
(*print-readably* t))
|
||||
(format stream "ecl_def_ct_single_float(~A,~S,static,const);" name value stream)))
|
||||
(*print-readably* t))
|
||||
(format stream "ecl_def_ct_double_float(~A,~S,static,const);"
|
||||
name value stream)))
|
||||
|
||||
(defun static-constant-builder (format value)
|
||||
(lambda (name stream)
|
||||
|
|
@ -185,8 +187,12 @@
|
|||
(defun static-constant-expression (object)
|
||||
(typecase object
|
||||
(base-string #'static-base-string-builder)
|
||||
;;(single-float #'static-single-float-builder)
|
||||
;;(double-float #'static-double-float-builder)
|
||||
(single-float (and (not (si:float-nan-p object))
|
||||
(not (si:float-infinity-p object))
|
||||
#'static-single-float-builder))
|
||||
(double-float (and (not (si:float-nan-p object))
|
||||
(not (si:float-infinity-p object))
|
||||
#'static-double-float-builder))
|
||||
(t nil)))
|
||||
|
||||
(defun add-static-constant (object)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue