diff --git a/basis/compiler/cfg/two-operand/two-operand-tests.factor b/basis/compiler/cfg/two-operand/two-operand-tests.factor index 0d0c57e0f7..0717f1c536 100644 --- a/basis/compiler/cfg/two-operand/two-operand-tests.factor +++ b/basis/compiler/cfg/two-operand/two-operand-tests.factor @@ -27,19 +27,12 @@ compiler.cfg.registers cpu.architecture namespaces tools.test ; [ V{ - T{ ##copy f V int-regs 4 V int-regs 2 } - 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 4 } + T{ ##copy f V int-regs 4 V int-regs 1 } + T{ ##copy f V int-regs 1 V int-regs 2 } + 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 } } (convert-two-operand) ] 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 diff --git a/basis/compiler/cfg/two-operand/two-operand.factor b/basis/compiler/cfg/two-operand/two-operand.factor index db3462bf0d..3508585552 100644 --- a/basis/compiler/cfg/two-operand/two-operand.factor +++ b/basis/compiler/cfg/two-operand/two-operand.factor @@ -65,15 +65,11 @@ GENERIC: convert-two-operand* ( insn -- ) : case-2? ( insn -- ? ) [ dst>> ] [ src2>> ] bi = ; inline -ERROR: bad-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 - [ swap src1>> emit-copy ] - [ [ >>src1 ] [ >>dst ] bi , ] - [ [ src2>> ] dip emit-copy ] + [ swap src2>> emit-copy ] + [ drop [ src2>> ] [ src1>> ] bi emit-copy ] + [ >>src2 dup dst>> >>src1 , ] 2tri ; inline : case-3 ( insn -- )