2015-06-15 04:44:53 -04:00
|
|
|
USING: alien.syntax compiler.cfg.instructions compiler.cfg.registers
|
2015-06-13 20:44:45 -04:00
|
|
|
compiler.cfg.ssa.destruction compiler.cfg.ssa.destruction.leaders
|
2015-05-09 17:02:30 -04:00
|
|
|
compiler.cfg.ssa.destruction.private compiler.cfg.utilities
|
2015-06-15 04:44:53 -04:00
|
|
|
cpu.architecture cpu.x86.assembler.operands kernel make namespaces
|
|
|
|
sequences tools.test ;
|
2015-04-20 15:22:09 -04:00
|
|
|
IN: compiler.cfg.ssa.destruction.tests
|
|
|
|
|
2015-07-28 17:15:21 -04:00
|
|
|
: setup-leader/reps-scenario ( -- )
|
|
|
|
! Note the differences in representation.
|
2015-04-20 15:22:09 -04:00
|
|
|
H{ { 45 45 } { 46 45 } { 47 47 } { 100 47 } } leader-map set
|
|
|
|
H{
|
|
|
|
{ 45 double-2-rep }
|
|
|
|
{ 46 double-rep }
|
|
|
|
{ 47 double-rep }
|
|
|
|
{ 100 double-rep }
|
2015-07-28 17:15:21 -04:00
|
|
|
} representations set ;
|
|
|
|
|
|
|
|
! cleanup-insn
|
|
|
|
{
|
|
|
|
V{ T{ ##copy { dst 100 } { src 46 } } }
|
|
|
|
} [
|
|
|
|
setup-leader/reps-scenario
|
|
|
|
T{ ##copy { src 46 } { dst 100 } } [ cleanup-insn ] V{ } make
|
|
|
|
] unit-test
|
|
|
|
|
|
|
|
! I think the difference is because ##parallel-copy may encode a swap
|
|
|
|
! between two vregs.
|
|
|
|
{
|
|
|
|
V{ T{ ##copy { dst 47 } { src 45 } { rep double-2-rep } } }
|
|
|
|
} [
|
|
|
|
setup-leader/reps-scenario
|
|
|
|
T{ ##parallel-copy { values V{ { 100 46 } } } } [ cleanup-insn ] V{ } make
|
2015-04-20 15:22:09 -04:00
|
|
|
] unit-test
|
|
|
|
|
|
|
|
{ V{ } } [
|
|
|
|
T{ ##parallel-copy { values V{ } } }
|
|
|
|
[ cleanup-insn ] V{ } make
|
|
|
|
] unit-test
|
2015-05-09 17:02:30 -04:00
|
|
|
|
|
|
|
! destruct-ssa
|
|
|
|
{ } [
|
|
|
|
H{ { 36 23 } { 23 23 } } leader-map set
|
|
|
|
H{ { 36 int-rep } { 37 tagged-rep } } representations set
|
|
|
|
V{
|
|
|
|
T{ ##alien-invoke
|
|
|
|
{ reg-inputs V{ { 56 int-rep RDI } } }
|
|
|
|
{ stack-inputs V{ } }
|
|
|
|
{ reg-outputs { { 36 int-rep RAX } } }
|
|
|
|
{ dead-outputs { } }
|
|
|
|
{ cleanup 0 }
|
|
|
|
{ stack-size 0 }
|
|
|
|
{ symbols "g_quark_to_string" }
|
|
|
|
{ dll DLL" libglib-2.0.so" }
|
2016-09-11 14:34:44 -04:00
|
|
|
{ gc-map T{ gc-map } }
|
2015-05-09 17:02:30 -04:00
|
|
|
{ insn# 14 }
|
|
|
|
}
|
2016-09-11 14:34:44 -04:00
|
|
|
T{ ##call-gc { gc-map T{ gc-map } } }
|
2015-05-09 17:02:30 -04:00
|
|
|
T{ ##box-alien
|
|
|
|
{ dst 37 }
|
|
|
|
{ src 36 }
|
|
|
|
{ temp 11 }
|
|
|
|
{ insn# 18 }
|
|
|
|
}
|
|
|
|
} 0 insns>block block>cfg destruct-ssa
|
|
|
|
] unit-test
|