]> gitweb.factorcode.org Git - factor.git/commitdiff
Code cleanups
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Wed, 28 Apr 2010 06:53:08 +0000 (02:53 -0400)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Mon, 3 May 2010 21:34:17 +0000 (17:34 -0400)
basis/compiler/cfg/representations/peephole/peephole.factor
vm/layouts.hpp

index 6c6347f11c1e0bbbcc05dcbd39d5d724e98b44cd..23e2e9c50c83091c9f437e0b7bfc32af767db652 100644 (file)
@@ -94,9 +94,6 @@ M: ##load-reference optimize-insn
 ! Into either
 ! ##shl-imm by X - tag-bits, or
 ! ##sar-imm by tag-bits - X.
-: combine-shl-imm-input? ( insn -- ? )
-     ;
-
 : combine-shl-imm-input ( insn -- )
     [ dst>> ] [ src1>> ] [ src2>> ] tri tag-bits get {
         { [ 2dup < ] [ swap - ##sar-imm here ] }
@@ -232,6 +229,9 @@ M: ##compare-integer-branch optimize-insn
         [ call-next-method ]
     } cond ;
 
+! Identities:
+! tag(neg(untag(x))) = x
+! tag(neg(x)) = x * -2^tag-bits
 : inert-tag/untag-unary? ( insn -- ? )
     [ dst>> ] [ src>> ] bi [ rep-of tagged-rep? ] both? ;
 
@@ -252,6 +252,8 @@ M: ##neg optimize-insn
         [ call-next-method ]
     } cond ;
 
+! Identity:
+! tag(not(untag(x))) = not(x) xor tag-mask
 :: emit-tagged-not ( insn -- )
     tagged-rep next-vreg-rep :> temp
     temp insn src>> ##not
index 0cf8607a0565adb3c5504b502f389de5e7a92d32..5275c796128d06758688d36810dac2079208b5bb 100644 (file)
@@ -91,8 +91,6 @@ inline static cell tag_fixnum(fixnum untagged)
        return RETAG(untagged << TAG_BITS,FIXNUM_TYPE);
 }
 
-struct object;
-
 #define NO_TYPE_CHECK static const cell type_number = TYPE_COUNT
 
 struct object {