From: Nathan Froyd Date: Wed, 27 Jan 2010 01:57:12 +0000 (+0000) Subject: 1.0.34.13: add DERIVE-TYPE optimizer for %UNARY-ROUND X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=38cf000d1082aa571d2f7245a7812023e1c8e065;p=sbcl.git 1.0.34.13: add DERIVE-TYPE optimizer for %UNARY-ROUND This change enables %UNARY-ROUND to be inlined on several platforms. --- diff --git a/NEWS b/NEWS index be09eae..b73bb9b 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,7 @@ ;;;; -*- coding: utf-8; fill-column: 78 -*- changes relative to sbcl-1.0.34: + * optimization: ROUND with a single single-float or double-float argument + is properly inlined when possible. * optimization: Slightly better code is generated for integer<->float conversions and for single-float<->double-float conversions on x86-64. * optimization: SB-ROTATE-BYTE:ROTATE-BYTE now generates more efficient diff --git a/src/compiler/srctran.lisp b/src/compiler/srctran.lisp index f084086..22186ad 100644 --- a/src/compiler/srctran.lisp +++ b/src/compiler/srctran.lisp @@ -1806,6 +1806,24 @@ (ftruncate-derive-type-quot-aux n divisor nil)) #'%unary-ftruncate))) +(defoptimizer (%unary-round derive-type) ((number)) + (one-arg-derive-type number + (lambda (n) + (block nil + (unless (numeric-type-real-p n) + (return *empty-type*)) + (let* ((interval (numeric-type->interval n)) + (low (interval-low interval)) + (high (interval-high interval))) + (specifier-type + `(integer ,(if low + (round low) + '*) + ,(if high + (round high) + '*)))))) + #'%unary-round)) + ;;; Define optimizers for FLOOR and CEILING. (macrolet ((def (name q-name r-name) diff --git a/version.lisp-expr b/version.lisp-expr index 29fb8a8..132f8f1 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"1.0.34.12" +"1.0.34.13"