Skip to content

Commit

Permalink
math: elide bignums in ROUND-TO-ODD/32
Browse files Browse the repository at this point in the history
  • Loading branch information
paulapatience committed Jun 29, 2024
1 parent d309745 commit 4453f92
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions code/math/implementation.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,15 @@
(ash p ,(- size)))))

(defun round-to-odd/32 (g cp)
#-(or ecl cmucl) (%round-to-odd-1 g cp 32)
#+(or ecl cmucl) (%round-to-odd-2 g cp 32))
#+quaviver/bignum-elision
(let ((p (umul96-upper64 cp g)))
(if (ldb-test (byte 31 1) p)
(logior (ash p -32) 1)
(ash p -32)))
#-quaviver/bignum-elision
(progn
#-(or ecl cmucl) (%round-to-odd-1 g cp 32)
#+(or ecl cmucl) (%round-to-odd-2 g cp 32)))

(defun round-to-odd/64 (g cp)
#+quaviver/bignum-elision
Expand Down

0 comments on commit 4453f92

Please sign in to comment.