compiler.cfg.value-numbering: fix overly-zealous ##compare-imm conversion
parent
4c856e51e1
commit
b677822b76
|
@ -16,6 +16,7 @@ IN: compiler.cfg.value-numbering.rewrite
|
||||||
: vreg-small-constant? ( vreg -- ? )
|
: vreg-small-constant? ( vreg -- ? )
|
||||||
vreg>expr {
|
vreg>expr {
|
||||||
[ constant-expr? ]
|
[ constant-expr? ]
|
||||||
|
[ value>> fixnum? ]
|
||||||
[ value>> small-enough? ]
|
[ value>> small-enough? ]
|
||||||
} 1&& ;
|
} 1&& ;
|
||||||
|
|
||||||
|
|
|
@ -406,6 +406,20 @@ IN: compiler.cfg.value-numbering.tests
|
||||||
} value-numbering-step trim-temps
|
} value-numbering-step trim-temps
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
||||||
|
[
|
||||||
|
{
|
||||||
|
T{ ##peek f 0 D 0 }
|
||||||
|
T{ ##load-constant f 1 3.5 }
|
||||||
|
T{ ##compare f 2 0 1 cc= }
|
||||||
|
}
|
||||||
|
] [
|
||||||
|
{
|
||||||
|
T{ ##peek f 0 D 0 }
|
||||||
|
T{ ##load-constant f 1 3.5 }
|
||||||
|
T{ ##compare f 2 0 1 cc= }
|
||||||
|
} value-numbering-step trim-temps
|
||||||
|
] unit-test
|
||||||
|
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
T{ ##peek f 0 D 0 }
|
T{ ##peek f 0 D 0 }
|
||||||
|
@ -434,6 +448,20 @@ IN: compiler.cfg.value-numbering.tests
|
||||||
} value-numbering-step
|
} value-numbering-step
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
||||||
|
[
|
||||||
|
{
|
||||||
|
T{ ##peek f 0 D 0 }
|
||||||
|
T{ ##load-constant f 1 3.5 }
|
||||||
|
T{ ##compare-branch f 0 1 cc= }
|
||||||
|
}
|
||||||
|
] [
|
||||||
|
{
|
||||||
|
T{ ##peek f 0 D 0 }
|
||||||
|
T{ ##load-constant f 1 3.5 }
|
||||||
|
T{ ##compare-branch f 0 1 cc= }
|
||||||
|
} value-numbering-step trim-temps
|
||||||
|
] unit-test
|
||||||
|
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
T{ ##peek f 0 D 0 }
|
T{ ##peek f 0 D 0 }
|
||||||
|
|
Loading…
Reference in New Issue