X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fsrctran.lisp;h=c1aa1064b4315ca6a74b2368ef2a403dd213e9e3;hb=3c25a14fa1f4c7f063babed8ef0a1a5d335298c6;hp=713a10698e3f3514e1c8d390ce4461f4676d6c61;hpb=54752bdd733ae3127d6dca2cc9a16413bf0126f3;p=sbcl.git diff --git a/src/compiler/srctran.lisp b/src/compiler/srctran.lisp index 713a106..c1aa106 100644 --- a/src/compiler/srctran.lisp +++ b/src/compiler/srctran.lisp @@ -3113,6 +3113,24 @@ (cut-to-width x kind w t) nil ; After fixing above, replace with T. ))))))) + +(defoptimizer (logior optimizer) ((x y) node) + (let ((result-type (single-value-type (node-derived-type node)))) + (multiple-value-bind (low high) + (integer-type-numeric-bounds result-type) + (when (and (numberp low) + (numberp high) + (<= high 0)) + (let ((width (integer-length low))) + (multiple-value-bind (w kind) + (best-modular-version (1+ width) t) + (when w + ;; FIXME: see comment in LOGAND optimizer + (let ((xact (cut-to-width x kind w t)) + (yact (cut-to-width y kind w t))) + (declare (ignore xact yact)) + nil) ; After fixing above, replace with T + ))))))) ;;; miscellanous numeric transforms