|
[Sbcl-commits] CVS: sbcl/tests compiler.pure.lisp,1.217,1.218
From: Nathan Froyd <nfroyd@us...> - 2010-01-26 15:43
|
Update of /cvsroot/sbcl/sbcl/tests
In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv10172/tests
Modified Files:
compiler.pure.lisp
Log Message:
1.0.34.11: properly inline %UNARY-TRUNCATE/{SINGLE,DOUBLE}-FLOAT
Add DERIVE-TYPE optimizers for them so the compiler can see that VOPs
are applicable. Add a testcase that should be valid everywhere.
Index: compiler.pure.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/tests/compiler.pure.lisp,v
retrieving revision 1.217
retrieving revision 1.218
diff -u -d -r1.217 -r1.218
--- compiler.pure.lisp 19 Nov 2009 11:50:43 -0000 1.217
+++ compiler.pure.lisp 26 Jan 2010 15:42:43 -0000 1.218
@@ -3253,14 +3253,27 @@
(truncate x))))
(d (compile nil `(lambda (x)
(declare (double-float x))
- (truncate x)))))
+ (truncate x))))
+ (s-inlined (compile nil '(lambda (x)
+ (declare (type (single-float 0.0s0 1.0s0) x))
+ (truncate x))))
+ (d-inlined (compile nil '(lambda (x)
+ (declare (type (double-float 0.0d0 1.0d0) x))
+ (truncate x)))))
;; Check that there is no generic arithmetic
(assert (not (search "GENERIC"
(with-output-to-string (out)
(disassemble s :stream out)))))
(assert (not (search "GENERIC"
(with-output-to-string (out)
- (disassemble d :stream out)))))))
+ (disassemble d :stream out)))))
+ ;; Check that we actually inlined the call when we were supposed to.
+ (assert (not (search "UNARY-TRUNCATE"
+ (with-output-to-string (out)
+ (disassemble s-inlined :stream out)))))
+ (assert (not (search "UNARY-TRUNCATE"
+ (with-output-to-string (out)
+ (disassemble d-inlined :stream out)))))))
(with-test (:name :make-array-unnamed-dimension-leaf)
(let ((fun (compile nil `(lambda (stuff)
|
| Thread | Author | Date |
|---|---|---|
| [Sbcl-commits] CVS: sbcl/tests compiler.pure.lisp,1.217,1.218 | Nathan Froyd <nfroyd@us...> |