From: Nathan Froyd Date: Tue, 7 Feb 2006 16:23:41 +0000 (+0000) Subject: 0.9.9.20: X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=625e155af989109f79fc4759a72a54ab2d18c8c1;p=sbcl.git 0.9.9.20: Oops. Add functions for constant folding purposes and fix AVER in the x86 backend. Add tests from (where else?) ansi-tests. --- diff --git a/src/compiler/ppc/arith.lisp b/src/compiler/ppc/arith.lisp index aca19f4..c8f1eae 100644 --- a/src/compiler/ppc/arith.lisp +++ b/src/compiler/ppc/arith.lisp @@ -666,6 +666,9 @@ (defknown %%ldb (integer unsigned-byte unsigned-byte) unsigned-byte (movable foldable flushable)) +(defun %%ldb (integer size posn) + (sb-kernel::%ldb size posn integer)) + (define-vop (ldb-c/fixnum) (:translate %%ldb) (:args (x :scs (any-reg))) @@ -829,6 +832,9 @@ (defknown %logbitp (integer unsigned-byte) boolean (movable foldable flushable)) +(defun %logbitp (index integer) + (logbitp index integer)) + ;;; We only handle the constant cases because those are the only ones ;;; guaranteed to make it past COMBINATION-IMPLEMENTATION-STYLE. ;;; --njf, 06-02-2006 diff --git a/src/compiler/x86/arith.lisp b/src/compiler/x86/arith.lisp index a17925b..3c08693 100644 --- a/src/compiler/x86/arith.lisp +++ b/src/compiler/x86/arith.lisp @@ -1059,11 +1059,14 @@ (defknown %logbitp (integer unsigned-byte) boolean (movable foldable flushable)) +(defun %logbitp (index integer) + (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) (:generator 4 - (aver (< y 29)) + (aver (<= y 29)) (inst bt x (+ y n-fixnum-tag-bits)) (inst jmp (if not-p :nc :c) target))) @@ -1085,7 +1088,7 @@ (inst bt x y) (inst jmp (if not-p :nc :c) target))) -(define-vop (fast-logbitp-/unsigned fast-conditional-c/unsigned) +(define-vop (fast-logbitp-c/unsigned fast-conditional-c/unsigned) (:translate %logbitp) (:generator 5 (inst bt x y) diff --git a/tests/compiler.pure.lisp b/tests/compiler.pure.lisp index ef90f49..f5652e7 100644 --- a/tests/compiler.pure.lisp +++ b/tests/compiler.pure.lisp @@ -1921,3 +1921,37 @@ (declare (type (or (simple-array character (6)) (simple-array character (5))) x)) (aref x 0)))) + +;;; MISC.623: missing functions for constant-folding +(assert (eql 0 + (funcall + (compile + nil + '(lambda () + (declare (optimize (space 2) (speed 0) (debug 2) + (compilation-speed 3) (safety 0))) + (loop for lv3 below 1 + count (minusp + (loop for lv2 below 2 + count (logbitp 0 + (bit #*1001101001001 + (min 12 (max 0 lv3)))))))))))) + +;;; MISC.624: erronous AVER in x86's %LOGBITP VOPs +(assert (eql 0 + (funcall + (compile + nil + '(lambda (a) + (declare (type (integer 21 28) a)) + (declare (optimize (compilation-speed 1) (safety 2) + (speed 0) (debug 0) (space 1))) + (let* ((v7 (flet ((%f3 (f3-1 f3-2) + (loop for lv2 below 1 + count + (logbitp 29 + (sbit #*10101111 + (min 7 (max 0 (eval '0)))))))) + (%f3 0 a)))) + 0))) + 22))) diff --git a/version.lisp-expr b/version.lisp-expr index ae996c9..18332b0 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.9.9.19" +"0.9.9.20"