diff --git a/basis/compiler/cfg/representations/peephole/peephole.factor b/basis/compiler/cfg/representations/peephole/peephole.factor index 6c6347f11c..23e2e9c50c 100644 --- a/basis/compiler/cfg/representations/peephole/peephole.factor +++ b/basis/compiler/cfg/representations/peephole/peephole.factor @@ -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 diff --git a/vm/layouts.hpp b/vm/layouts.hpp index 0cf8607a05..5275c79612 100644 --- a/vm/layouts.hpp +++ b/vm/layouts.hpp @@ -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 {