compiler.cfg.*: fixing tests so they work on 32bit archs too

db4
Björn Lindqvist 2015-04-30 04:49:48 +02:00
parent c99b3e0b53
commit 6097e80178
3 changed files with 35 additions and 13 deletions

View File

@ -1,12 +1,27 @@
USING: alien.c-types compiler.cfg.builder.alien compiler.cfg.instructions USING: alien.c-types compiler.cfg.builder.alien compiler.cfg.instructions
compiler.cfg.registers compiler.cfg.stacks.local compiler.test compiler.cfg.registers compiler.cfg.stacks.local compiler.test
cpu.architecture kernel make namespaces tools.test ; cpu.architecture kernel make namespaces system tools.test ;
IN: compiler.cfg.builder.alien.tests IN: compiler.cfg.builder.alien.tests
! unboxing ints is only needed on 32bit archs
cpu x86.32?
{
{ 2 4 }
{ { int-rep f f } { int-rep f f } }
V{
T{ ##unbox-any-c-ptr { dst 2 } { src 1 } }
T{ ##unbox
{ dst 4 }
{ src 3 }
{ unboxer "to_fixnum" }
{ rep int-rep }
}
}
}
{ {
{ 2 3 } { 2 3 }
{ { int-rep f f } { int-rep f f } } { { int-rep f f } { int-rep f f } }
V{ T{ ##unbox-any-c-ptr { dst 2 } { src 1 } } } V{ T{ ##unbox-any-c-ptr { dst 2 } { src 1 } } }
} [ } ? [
[ { c-string int } unbox-parameters ] V{ } make [ { c-string int } unbox-parameters ] V{ } make
] cfg-unit-test ] cfg-unit-test

View File

@ -1,5 +1,6 @@
USING: alien.c-types compiler.cfg.instructions compiler.cfg.intrinsics.strings USING: accessors alien.c-types compiler.cfg.instructions
compiler.test cpu.architecture make tools.test ; compiler.cfg.intrinsics.strings compiler.test cpu.architecture kernel make
sequences tools.test ;
IN: compiler.cfg.intrinsics.strings.tests IN: compiler.cfg.intrinsics.strings.tests
{ {
@ -9,11 +10,12 @@ IN: compiler.cfg.intrinsics.strings.tests
T{ ##store-memory-imm T{ ##store-memory-imm
{ src 1 } { src 1 }
{ base 5 } { base 5 }
{ offset 21 } { offset "varies" }
{ rep int-rep } { rep int-rep }
{ c-type uchar } { c-type uchar }
} }
} }
} [ } [
[ emit-set-string-nth-fast ] V{ } make [ emit-set-string-nth-fast ] V{ } make
dup third "varies" >>offset drop
] cfg-unit-test ] cfg-unit-test

View File

@ -1,4 +1,4 @@
USING: accessors assocs combinators.extras compiler.cfg USING: accessors arrays assocs combinators.extras compiler.cfg
compiler.cfg.instructions compiler.cfg.linear-scan.allocation.state compiler.cfg.instructions compiler.cfg.linear-scan.allocation.state
compiler.cfg.linear-scan.live-intervals compiler.cfg.utilities cpu.architecture compiler.cfg.linear-scan.live-intervals compiler.cfg.utilities cpu.architecture
cpu.x86.assembler.operands heaps kernel layouts namespaces sequences system cpu.x86.assembler.operands heaps kernel layouts namespaces sequences system
@ -62,13 +62,18 @@ cpu x86.64? [
] when ] when
! assign-spill-slot ! assign-spill-slot
{ cpu x86.32?
H{ H{
{ { 3 8 } T{ spill-slot { n 32 } } } { { 3 4 } T{ spill-slot { n 32 } } }
{ { 1234 8 } T{ spill-slot } } { { 1234 4 } T{ spill-slot } }
{ { 45 16 } T{ spill-slot { n 16 } } } { { 45 16 } T{ spill-slot { n 16 } } }
} }
} [ H{
{ { 3 8 } T{ spill-slot { n 32 } } }
{ { 1234 8 } T{ spill-slot } }
{ { 45 16 } T{ spill-slot { n 16 } } }
} ? 1array
[
H{ } clone spill-slots set H{ } clone spill-slots set
f f <basic-block> <cfg> cfg set f f <basic-block> <cfg> cfg set
{ 1234 45 3 } { int-rep double-2-rep tagged-rep } { 1234 45 3 } { int-rep double-2-rep tagged-rep }