Skip to content

Commit

Permalink
benchmark: add report/float-traits
Browse files Browse the repository at this point in the history
  • Loading branch information
yitzchak committed Jul 8, 2024
1 parent ea47406 commit a439fec
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
3 changes: 2 additions & 1 deletion code/benchmark/packages.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
(:use #:common-lisp)
(:export #:float-integer
#:integer-float
#:report))
#:report
#:report/float-traits))
27 changes: 27 additions & 0 deletions code/benchmark/report.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,30 @@
and collect (make-string 21
:initial-element #\space)))))
(ascii-table:display table)))

(defun report/float-traits ()
(let ((table (ascii-table:make-table
(list "trait"
#+quaviver/short-float "short-float"
"single-float"
"double-float"
#+quaviver/long-float "long-float"))))
(loop for trait in '(quaviver:storage-size
quaviver:significand-size
quaviver:exponent-size
quaviver:sign-size
quaviver:hidden-bit-p
quaviver:subnormalp
quaviver:non-number-p
quaviver:exponent-bias
quaviver:max-exponent
quaviver:min-exponent
quaviver:arithmetic-size)
do (ascii-table:add-row table
(list (string-downcase (symbol-name trait))
#+quaviver/short-float (funcall trait 'short-float)
(funcall trait 'single-float)
(funcall trait 'double-float)
#+quaviver/long-float (funcall trait 'long-float))))
(format t "~a float traits~%" (lisp-implementation-type))
(ascii-table:display table)))

0 comments on commit a439fec

Please sign in to comment.