From: Alexey Dejneka Date: Mon, 22 Sep 2003 14:12:00 +0000 (+0000) Subject: 0.8.3.86: X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=3d8b0be4f66dcaf0ed8e0ef703f5ce04da5e44d1;p=sbcl.git 0.8.3.86: * Fix transformers for /<=/>=: ... when swap arguments, change function name "<" <-> ">"; ... do not check whether an interval is a constant LVAR; * add type declaration in CONSTANT-LVAR-P. --- diff --git a/src/compiler/ir1opt.lisp b/src/compiler/ir1opt.lisp index 618b3d7..955f4c8 100644 --- a/src/compiler/ir1opt.lisp +++ b/src/compiler/ir1opt.lisp @@ -21,6 +21,7 @@ ;;; Return true for an LVAR whose sole use is a reference to a ;;; constant leaf. (defun constant-lvar-p (thing) + (declare (type (or lvar null) thing)) (and (lvar-p thing) (let ((use (principal-lvar-use thing))) (and (ref-p use) (constant-p (ref-leaf use)))))) diff --git a/src/compiler/srctran.lisp b/src/compiler/srctran.lisp index bee1713..a5ea013 100644 --- a/src/compiler/srctran.lisp +++ b/src/compiler/srctran.lisp @@ -2981,27 +2981,27 @@ ;;; information. If X's high bound is < Y's low, then X < Y. ;;; Similarly, if X's low is >= to Y's high, the X >= Y (so return ;;; NIL). If not, at least make sure any constant arg is second. -(macrolet ((def (name reflexive-p surely-true surely-false) +(macrolet ((def (name inverse reflexive-p surely-true surely-false) `(deftransform ,name ((x y)) (if (same-leaf-ref-p x y) ,reflexive-p - (let ((x (or (type-approximate-interval (lvar-type x)) - (give-up-ir1-transform))) - (y (or (type-approximate-interval (lvar-type y)) - (give-up-ir1-transform)))) + (let ((ix (or (type-approximate-interval (lvar-type x)) + (give-up-ir1-transform))) + (iy (or (type-approximate-interval (lvar-type y)) + (give-up-ir1-transform)))) (cond (,surely-true t) (,surely-false nil) ((and (constant-lvar-p x) (not (constant-lvar-p y))) - `(,',name y x)) + `(,',inverse y x)) (t (give-up-ir1-transform)))))))) - (def < nil (interval-< x y) (interval->= x y)) - (def > nil (interval-< y x) (interval->= y x)) - (def <= t (interval->= y x) (interval-< y x)) - (def >= t (interval->= x y) (interval-< x y))) + (def < > nil (interval-< ix iy) (interval->= ix iy)) + (def > < nil (interval-< iy ix) (interval->= iy ix)) + (def <= >= t (interval->= iy ix) (interval-< iy ix)) + (def >= <= t (interval->= ix iy) (interval-< ix iy))) (defun ir1-transform-char< (x y first second inverse) (cond diff --git a/version.lisp-expr b/version.lisp-expr index 375344a..351dffd 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".) -"0.8.3.85" +"0.8.3.86"