Thank you very much. This patch seemed to do the trick on a ppc G5.   Please ignore my previous email
concerning the kludgier fix.   This is the first time that FLOOR and CEILING and ROUND all inline nicely.


On Mon, Jan 25, 2010 at 3:43 PM, Nathan Froyd <> wrote:
Christophe said in:

that he would accept a tested and reviewed patch that fixes the issue
described therein.  The patch below (a little late, but hey...)
enables inlining %UNARY-TRUNCATE/*-FLOAT when the argument has an
appropriate range.  It tests fine; a review would be appreciated.


diff --git a/src/compiler/srctran.lisp b/src/compiler/srctran.lisp
index 7421fd7..f084086 100644
--- a/src/compiler/srctran.lisp
+++ b/src/compiler/srctran.lisp
@@ -1789,6 +1789,16 @@

+(defoptimizer (%unary-truncate/single-float derive-type) ((number))
+  (one-arg-derive-type number
+                       #'%unary-truncate-derive-type-aux
+                       #'%unary-truncate))
+(defoptimizer (%unary-truncate/double-float derive-type) ((number))
+  (one-arg-derive-type number
+                       #'%unary-truncate-derive-type-aux
+                       #'%unary-truncate))
 (defoptimizer (%unary-ftruncate derive-type) ((number))
  (let ((divisor (specifier-type '(integer 1 1))))
    (one-arg-derive-type number

The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
Sbcl-devel mailing list