Skip to content
Snippets Groups Projects
Commit 13cc9bdc authored by ram's avatar ram
Browse files

Made ROUND source transform like the one for TRUNCATE, and also used

explicit supplied-p so that anyone who does (truncate x nil) gets
what they deserve.
parent eafdc708
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
;;; Scott Fahlman (FAHLMAN@CMUC). ;;; Scott Fahlman (FAHLMAN@CMUC).
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/srctran.lisp,v 1.22 1990/12/04 19:36:55 wlott Exp $ ;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/srctran.lisp,v 1.23 1990/12/12 00:07:24 ram Exp $
;;; ;;;
;;; This file contains macro-like source transformations which convert ;;; This file contains macro-like source transformations which convert
;;; uses of certain functions into the canonical form desired within the ;;; uses of certain functions into the canonical form desired within the
...@@ -139,10 +139,14 @@ ...@@ -139,10 +139,14 @@
;;; Note that all the integer division functions are available for inline ;;; Note that all the integer division functions are available for inline
;;; expansion. ;;; expansion.
(def-source-transform truncate (x &optional y) (macrolet ((frob (fun)
(if y `(def-source-transform ,fun (x &optional (y nil y-p))
(values nil t) (declare (ignore y))
`(truncate ,x 1))) (if y-p
(values nil t)
`(,',fun ,x 1)))))
(frob truncate)
(frob round))
(def-source-transform lognand (x y) `(lognot (logand ,x ,y))) (def-source-transform lognand (x y) `(lognot (logand ,x ,y)))
(def-source-transform lognor (x y) `(lognot (logior ,x ,y))) (def-source-transform lognor (x y) `(lognot (logior ,x ,y)))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment