compiler.cfg: add peephole opt to never untag the input of ##bit-count. fixes #1764
parent
ccbf1c1429
commit
dc3ee923ca
|
@ -281,3 +281,6 @@ M: ##not optimize-insn
|
|||
}
|
||||
[ call-next-method ]
|
||||
} cond ;
|
||||
|
||||
M: ##bit-count optimize-insn
|
||||
[ no-use-conversion ] [ finish ] [ emit-def-conversion ] tri ;
|
||||
|
|
|
@ -897,3 +897,21 @@ cpu x86.64? [
|
|||
T{ ##replace f 1 D: 0 }
|
||||
} test-peephole
|
||||
] unit-test
|
||||
|
||||
! untag elimination for ##bit-count
|
||||
2 vreg-counter set-global
|
||||
|
||||
{
|
||||
V{
|
||||
T{ ##peek f 0 D: 0 }
|
||||
T{ ##bit-count f 3 0 }
|
||||
T{ ##shl-imm f 1 3 $[ tag-bits get ] }
|
||||
T{ ##replace f 1 D: 0 }
|
||||
}
|
||||
} [
|
||||
V{
|
||||
T{ ##peek f 0 D: 0 }
|
||||
T{ ##bit-count f 1 0 }
|
||||
T{ ##replace f 1 D: 0 }
|
||||
} test-peephole
|
||||
] unit-test
|
||||
|
|
|
@ -109,7 +109,8 @@ UNION: peephole-optimizable
|
|||
##test-imm
|
||||
##test
|
||||
##test-imm-branch
|
||||
##test-branch ;
|
||||
##test-branch
|
||||
##bit-count ;
|
||||
|
||||
GENERIC: compute-insn-costs ( insn -- )
|
||||
|
||||
|
|
Loading…
Reference in New Issue