Update of /cvsroot/sbcl/sbcl/tests
In directory sc8-pr-cvs1:/tmp/cvs-serv32019/tests
Modified Files:
arith.pure.lisp
Log Message:
0.8.3.13:
Implement better constant multiply routines
... have a cutoff on Sparc, as measured by Raymond Toy
... use LEA more on x86, as per cited paper
... don't do anything at all (yet) on other architectures. This
needs to be fixed before 0.8.4, at least for PPC and
Alpha
Index: arith.pure.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/tests/arith.pure.lisp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- arith.pure.lisp 19 Aug 2003 15:42:42 -0000 1.7
+++ arith.pure.lisp 29 Aug 2003 17:59:09 -0000 1.8
@@ -81,5 +81,24 @@
(assert (<= exact-q q))
(assert (< q (1+ exact-q))))))
-;; CEILING had a corner case, spotted by Paul Dietz
+;;; CEILING had a corner case, spotted by Paul Dietz
(assert (= (ceiling most-negative-fixnum (1+ most-positive-fixnum)) -1))
+
+;;; give any optimizers of constant multiplication a light testing.
+;;; 100 may seem low, but (a) it caught CSR's initial errors, and (b)
+;;; before checking in, CSR tested with 10000. So one hundred
+;;; checkins later, we'll have doubled the coverage.
+(dotimes (i 100)
+ (let* ((x (random most-positive-fixnum))
+ (x2 (* x 2))
+ (x3 (* x 3)))
+ (let ((fn (handler-bind ((sb-ext:compiler-note #'error))
+ (compile nil
+ `(lambda (y)
+ (declare (optimize speed) (type (integer 0 3) y))
+ (* y ,x))))))
+ (unless (and (= (funcall fn 0) 0)
+ (= (funcall fn 1) x)
+ (= (funcall fn 2) x2)
+ (= (funcall fn 3) x3))
+ (error "bad results for ~D" x)))))
|