]> gitweb.factorcode.org Git - factor.git/commitdiff
Tests for propagation additions; making fixnum-bit? inline
authorDaniel Ehrenberg <littledan@pool-224-36.res.carleton.edu>
Tue, 26 Jan 2010 02:15:17 +0000 (20:15 -0600)
committerDaniel Ehrenberg <littledan@pool-224-36.res.carleton.edu>
Tue, 26 Jan 2010 02:15:17 +0000 (20:15 -0600)
basis/compiler/tree/propagation/propagation-tests.factor
core/math/integers/integers.factor

index ad17ccc1c95f32e373ea069a72514c30950d407e..e2bfe587884d02bea894f1a2942f9573c94e1cfd 100644 (file)
@@ -8,7 +8,7 @@ layouts compiler.tree.propagation.info compiler.tree.def-use
 compiler.tree.debugger compiler.tree.checker slots.private words
 hashtables classes assocs locals specialized-arrays system
 sorting math.libm math.floats.private math.integers.private
-math.intervals quotations effects alien alien.data ;
+math.intervals quotations effects alien alien.data sets ;
 FROM: math => float ;
 SPECIALIZED-ARRAY: double
 SPECIALIZED-ARRAY: void*
@@ -952,3 +952,13 @@ M: tuple-with-read-only-slot clone
 
 ! Reduction
 [ 1 ] [ [ 4 <reversed> [ nth-unsafe ] [ ] unless ] final-info length ] unit-test
+
+! Optimization on bit?
+[ t ] [ [ 3 bit? ] { bit? fixnum-bit? } inlined? ] unit-test
+[ f ] [ [ 500 bit? ] { bit? fixnum-bit? } inlined? ] unit-test
+
+[ t ] [ [ { 1 } intersect ] { intersect } inlined? ] unit-test
+[ f ] [ [ { 1 } swap intersect ] { intersect } inlined? ] unit-test ! We could do this
+
+[ t ] [ [ { 1 } diff ] { diff } inlined? ] unit-test
+[ f ] [ [ { 1 } swap diff ] { diff } inlined? ] unit-test ! We could do this
index 9f7543ca133d976f1ac9293a4a3baa78e45cd9a6..5f461e22a3816ca25c2633422c4d06c90d17c505 100644 (file)
@@ -59,7 +59,7 @@ M: fixnum shift >fixnum fixnum-shift ; inline
 M: fixnum bitnot fixnum-bitnot ; inline
 
 : fixnum-bit? ( n m -- b )
-    neg shift 1 bitand 0 > ;
+    neg shift 1 bitand 0 > ; inline
 
 M: fixnum bit? fixnum-bit? ; inline