
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMU Common Lisp". The branch, master has been updated via e99b2b29bf65f7a2a678e9d7199085bf4aabd81a (commit) from d337d008ea8f8a47a34b27516bd4f60f8299881a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit e99b2b29bf65f7a2a678e9d7199085bf4aabd81a Author: Raymond Toy <toy.raymond@gmail.com> Date: Sat Oct 26 17:01:54 2013 -0700 Document why %unary-ftruncate multiplies the result by x when result = 0. diff --git a/src/compiler/float-tran.lisp b/src/compiler/float-tran.lisp index a107e79..187d17b 100644 --- a/src/compiler/float-tran.lisp +++ b/src/compiler/float-tran.lisp @@ -210,10 +210,9 @@ ;; if x is known to be of the right type. Also, if the result is ;; known to fit in the same range as a (signed-byte 32), convert this ;; to %unary-truncate, which might be a single instruction, and float -;; the result. However, for sparc, we have a vop to do this so call -;; that, and for Sparc V9, we can actually handle a 64-bit integer -;; range. - +;; the result. However, for sparc and x86, we have a vop to do this +;; so call that, and for Sparc V9, we can actually handle a 64-bit +;; integer range. (macrolet ((frob (ftype func) `(deftransform %unary-ftruncate ((x) (,ftype)) (let* ((x-type (continuation-type x)) @@ -226,6 +225,9 @@ (< hi limit-hi)) #-(or sparc (and x86 sse2)) '(let ((result (coerce (%unary-truncate x) ',ftype))) + ;; Multiply by x when result is 0 so that we + ;; get the correct signed zero to match what + ;; ftruncate in float.lisp would return. (if (zerop result) (* result x) result)) ----------------------------------------------------------------------- Summary of changes: src/compiler/float-tran.lisp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) hooks/post-receive -- CMU Common Lisp