Commit 967464f7 authored by rtoy's avatar rtoy
Browse files

compiler/srctran.lisp:

o Remove the %ldb change in rev 1.164 to workaround in ticket #20.
o Delay the logand optimizer so that it runs later.  This allows type
  propagation a chance to converge before we run the logand
  optimizer.  This fixes ticket #20 and #21.  This may increase
  compilation time since the IR1 optimizations will run more often due
  to logand changes.

general-info/release-19f.txt:
o Update for modular arith fixes
o Update ticket #15 since we have SSE2 now.
parent 3d9b078d
Loading
Loading
Loading
Loading
+18 −18
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain.
;;;
(ext:file-comment
  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/srctran.lisp,v 1.168 2008/09/02 04:23:48 rtoy Exp $")
  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/srctran.lisp,v 1.169 2008/11/26 17:17:18 rtoy Exp $")
;;;
;;; **********************************************************************
;;;
@@ -2862,21 +2862,9 @@
		    (fixnum fixnum integer)
		    (unsigned-byte #.vm:word-bits))
  "convert to inline logical ops"
  ;; Try to help out the compiler by precomputing things if SIZE or
  ;; POSN are constants.  This helps out modular arithmetic in some
  ;; cases.  (I think it's a deficiency in modular arithmetic that it
  ;; can't figure some things out for itself.)
  (let ((shift-form (if (constant-continuation-p posn)
		       (if (zerop (continuation-value posn))
			   'int
			   `(ash int ,(- (continuation-value posn))))
		       '(ash int (- posn))))
	(mask-form (if (constant-continuation-p size)
		       (ash (1- (ash 1 vm:word-bits))
			    (- (continuation-value size) vm:word-bits))
		       `(ash ,(1- (ash 1 vm:word-bits))
			     (- size vm:word-bits)))))
    `(logand ,shift-form ,mask-form)))
  `(logand (ash int (- posn))
	   (ash ,(1- (ash 1 vm:word-bits))
		(- size ,vm:word-bits))))

(deftransform %mask-field ((size posn int)
			   (fixnum fixnum integer)
@@ -3915,7 +3903,7 @@
                   (>= low 0))
          (let ((width (integer-length high)))
	    ;; If both arguments of LOGAND would fit in a fixnum, we
	    ;; don't need to do anything.  This allows the any fixnum
	    ;; don't need to do anything.  This allows any fixnum
	    ;; vops to run.  However, if the result won't fit in a
	    ;; fixnum, look to see if we can apply modular arithmetic.
	    ;;
@@ -3942,4 +3930,16 @@
#+modular-arith
(defoptimizer (logand optimizer) ((x y) node)
  (when *enable-modular-arithmetic*
    (logand-defopt-helper x y node)))
    ;; This is a KLUDGE.  We want to give type propagation and friends
    ;; a chance to stabilize before we run the logand optimizer.  So,
    ;; we pretend this is a delayed traansform and skip it until
    ;; later.  DELAY-TRANSFORM throws to 'GIVE-UP if the operation
    ;; should be delayed , so we need to catch that.  This appears to
    ;; fix Trac bug 21.
    (let ((result (catch 'give-up
		    (delay-transform node :optimize)
		    (logand-defopt-helper x y node))))
      ;; Do we need to do this?  Can we just always return NIL?
      (if (eq result :delayed)
	  nil
	  result))))
+6 −1
Original line number Diff line number Diff line
@@ -112,10 +112,15 @@ New in this release:
      Fixed by not doing modular arith if the args are known to be
      fixnums.
    - #20: Modular arith bug?
      Workaround applied.
      Fixed via the fix for Trac #21.  The original workaround has
      been removed.
    - #24: Float contagion for expt
      Float contagion is applied to the arguments before computing
      expt.
    - #21: Modular arith bug 3
      Fixed by delaying the logand defoptimizer.
    - #15: x86 double-float issue
      Fixed when using SSE2 support.  We will not fix this for x87.

  * Other changes:
    - IS1, IS2, IS3, and IS4 are recognized character names for the