0.9.9.23:
authorNathan Froyd <froydnj@cs.rice.edu>
Wed, 8 Feb 2006 19:19:28 +0000 (19:19 +0000)
committerNathan Froyd <froydnj@cs.rice.edu>
Wed, 8 Feb 2006 19:19:28 +0000 (19:19 +0000)
More fixes courtesy of PFD's ansi-tests:
...%LOGBITP had its arglist reversed.  Oops;
...be more proactive in declaring the types of constant arguments
   in the %LOGBITP VOPs to avoid bogosity.

src/compiler/ppc/arith.lisp
src/compiler/x86/arith.lisp
tests/compiler.pure.lisp
version.lisp-expr

index c8f1eae..a0288fb 100644 (file)
 (defknown %logbitp (integer unsigned-byte) boolean
   (movable foldable flushable))
 
-(defun %logbitp (index integer)
+(defun %logbitp (integer index)
   (logbitp index integer))
 
 ;;; We only handle the constant cases because those are the only ones
 ;;;  --njf, 06-02-2006
 (define-vop (fast-logbitp-c/fixnum fast-conditional-c/fixnum)
   (:translate %logbitp)
+  (:arg-types tagged-num (:constant (integer 0 29)))
   (:temporary (:scs (any-reg) :to (:result 0)) test)
   (:generator 4
     (if (< y 14)
 
 (define-vop (fast-logbitp-c/signed fast-conditional-c/signed)
   (:translate %logbitp)
+  (:arg-types signed-num (:constant (integer 0 31)))
   (:temporary (:scs (signed-reg) :to (:result 0)) test)
   (:generator 4
     (if (< y 16)
 
 (define-vop (fast-logbitp-c/unsigned fast-conditional-c/unsigned)
   (:translate %logbitp)
+  (:arg-types unsigned-num (:constant (integer 0 31)))
   (:temporary (:scs (unsigned-reg) :to (:result 0)) test)
   (:generator 4
     (if (< y 16)
index 3c08693..3910de9 100644 (file)
 (defknown %logbitp (integer unsigned-byte) boolean
   (movable foldable flushable))
 
-(defun %logbitp (index integer)
+(defun %logbitp (integer index)
   (logbitp index integer))
 
 ;;; too much work to do the non-constant case (maybe?)
 (define-vop (fast-logbitp-c/fixnum fast-conditional-c/fixnum)
   (:translate %logbitp)
+  (:arg-types tagged-num (:constant (integer 0 29)))
   (:generator 4
-    (aver (<= y 29))
     (inst bt x (+ y n-fixnum-tag-bits))
     (inst jmp (if not-p :nc :c) target)))
 
 
 (define-vop (fast-logbitp-c/signed fast-conditional-c/signed)
   (:translate %logbitp)
+  (:arg-types signed-num (:constant (integer 0 31)))
   (:generator 5
     (inst bt x y)
     (inst jmp (if not-p :nc :c) target)))
 
 (define-vop (fast-logbitp-c/unsigned fast-conditional-c/unsigned)
   (:translate %logbitp)
+  (:arg-types unsigned-num (:constant (integer 0 31)))
   (:generator 5
     (inst bt x y)
     (inst jmp (if not-p :nc :c) target)))
index f5652e7..e68cfe0 100644 (file)
                               (%f3 0 a))))
                    0)))
               22)))
+
+;;; MISC.626: bandaged AVER was still wrong
+(assert (eql -829253
+            (funcall
+             (compile
+              nil
+              '(lambda (a)
+                 (declare (type (integer -902970 2) a))
+                 (declare (optimize (space 2) (debug 0) (compilation-speed 1)
+                                    (speed 0) (safety 3)))
+                 (prog2 (if (logbitp 30 a) 0 (block b3 0)) a)))
+             -829253)))
+
+;; MISC.628: constant-folding %LOGBITP was buggy
+(assert (eql t
+            (funcall
+             (compile
+              nil
+              '(lambda ()
+                 (declare (optimize (safety 3) (space 3) (compilation-speed 3)
+                                    (speed 0) (debug 1)))
+                 (not (not (logbitp 0 (floor 2147483651 (min -23 0))))))))))
index 561ef7a..d37beec 100644 (file)
@@ -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.9.9.22"
+"0.9.9.23"