compiler.cfg.two-operand: if last instruction in a basic block is an overflowing arithmetic op of the form x = y op x, we now convert it correctly. This fixes compiler regression with benchmark.dawes after recent coalescing changes
parent
e01fc93812
commit
9bde92220b
|
@ -27,19 +27,12 @@ compiler.cfg.registers cpu.architecture namespaces tools.test ;
|
||||||
|
|
||||||
[
|
[
|
||||||
V{
|
V{
|
||||||
T{ ##copy f V int-regs 4 V int-regs 2 }
|
T{ ##copy f V int-regs 4 V int-regs 1 }
|
||||||
T{ ##sub f V int-regs 4 V int-regs 4 V int-regs 1 }
|
T{ ##copy f V int-regs 1 V int-regs 2 }
|
||||||
T{ ##copy f V int-regs 1 V int-regs 4 }
|
T{ ##sub f V int-regs 1 V int-regs 1 V int-regs 4 }
|
||||||
}
|
}
|
||||||
] [
|
] [
|
||||||
{
|
{
|
||||||
T{ ##sub f V int-regs 1 V int-regs 2 V int-regs 1 }
|
T{ ##sub f V int-regs 1 V int-regs 2 V int-regs 1 }
|
||||||
} (convert-two-operand)
|
} (convert-two-operand)
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
||||||
! This should never come up after coalescing
|
|
||||||
[
|
|
||||||
V{
|
|
||||||
T{ ##fixnum-add f V int-regs 2 V int-regs 4 V int-regs 2 }
|
|
||||||
} (convert-two-operand)
|
|
||||||
] must-fail
|
|
||||||
|
|
|
@ -65,15 +65,11 @@ GENERIC: convert-two-operand* ( insn -- )
|
||||||
|
|
||||||
: case-2? ( insn -- ? ) [ dst>> ] [ src2>> ] bi = ; inline
|
: case-2? ( insn -- ? ) [ dst>> ] [ src2>> ] bi = ; inline
|
||||||
|
|
||||||
ERROR: bad-case-2 insn ;
|
|
||||||
|
|
||||||
: case-2 ( insn -- )
|
: case-2 ( insn -- )
|
||||||
! This can't work with a ##fixnum-overflow since it branches
|
|
||||||
dup ##fixnum-overflow? [ bad-case-2 ] when
|
|
||||||
dup dst>> reg-class>> next-vreg
|
dup dst>> reg-class>> next-vreg
|
||||||
[ swap src1>> emit-copy ]
|
[ swap src2>> emit-copy ]
|
||||||
[ [ >>src1 ] [ >>dst ] bi , ]
|
[ drop [ src2>> ] [ src1>> ] bi emit-copy ]
|
||||||
[ [ src2>> ] dip emit-copy ]
|
[ >>src2 dup dst>> >>src1 , ]
|
||||||
2tri ; inline
|
2tri ; inline
|
||||||
|
|
||||||
: case-3 ( insn -- )
|
: case-3 ( insn -- )
|
||||||
|
|
Loading…
Reference in New Issue