2014-12-08 16:39:35 -05:00
|
|
|
USING: compiler.cfg.debugger compiler.cfg.instructions
|
2015-07-21 17:45:25 -04:00
|
|
|
compiler.cfg.registers compiler.codegen.gc-maps
|
|
|
|
compiler.codegen.relocation cpu.architecture cpu.x86 cpu.x86.assembler
|
2016-05-08 12:44:31 -04:00
|
|
|
cpu.x86.assembler.operands cpu.x86.features kernel kernel.private
|
|
|
|
layouts make math math.libm namespaces sequences system tools.test ;
|
2015-05-18 00:28:15 -04:00
|
|
|
IN: cpu.x86.tests
|
2010-08-13 00:41:57 -04:00
|
|
|
|
2014-12-08 16:39:35 -05:00
|
|
|
{ } [
|
2010-08-13 00:41:57 -04:00
|
|
|
[ { float } declare fsqrt ]
|
|
|
|
[ ##sqrt? ] contains-insn?
|
|
|
|
sse2?
|
|
|
|
assert=
|
|
|
|
] unit-test
|
2014-12-08 16:39:35 -05:00
|
|
|
|
2016-05-19 16:43:52 -04:00
|
|
|
! (%compare-tagged)
|
|
|
|
cpu x86.64? [
|
|
|
|
{
|
|
|
|
B{ 72 129 248 255 255 255 255 }
|
|
|
|
} [
|
|
|
|
init-relocation [ RAX RAX (%compare-tagged) ] B{ } make
|
|
|
|
] unit-test
|
|
|
|
] when
|
|
|
|
|
2016-05-08 12:44:31 -04:00
|
|
|
! %add-imm
|
|
|
|
{
|
|
|
|
B{ 72 255 192 }
|
|
|
|
B{ 72 131 192 29 }
|
|
|
|
} [
|
|
|
|
[ RAX RAX 1 %add-imm ] B{ } make
|
|
|
|
[ RAX RAX 29 %add-imm ] B{ } make
|
|
|
|
] unit-test
|
|
|
|
|
2016-05-19 16:43:52 -04:00
|
|
|
! %alien-invoke
|
|
|
|
{ 1 } [
|
|
|
|
init-relocation init-gc-maps [
|
|
|
|
{ } { } { } { } 0 0 { } "dll" T{ gc-map { scrub-d V{ 0 } } } %alien-invoke
|
|
|
|
] B{ } make drop
|
|
|
|
gc-maps get length
|
|
|
|
] unit-test
|
|
|
|
|
2014-12-08 16:39:35 -05:00
|
|
|
! %call-gc
|
|
|
|
{ V{ } } [
|
|
|
|
init-relocation init-gc-maps
|
|
|
|
[ T{ gc-map { scrub-d V{ } } } %call-gc ] B{ } make drop
|
|
|
|
gc-maps get
|
|
|
|
] unit-test
|
|
|
|
|
|
|
|
{ 1 } [
|
|
|
|
init-relocation init-gc-maps
|
|
|
|
[ T{ gc-map { scrub-d V{ 0 0 } } } %call-gc ] B{ } make drop
|
|
|
|
gc-maps get length
|
|
|
|
] unit-test
|
|
|
|
|
2015-05-18 00:28:15 -04:00
|
|
|
! %clear
|
|
|
|
{ t } [
|
2015-08-13 21:14:16 -04:00
|
|
|
[ D: 0 %clear ] B{ } make
|
2015-05-18 00:28:15 -04:00
|
|
|
cpu x86.32? B{ 199 6 144 18 0 0 } B{ 73 199 6 144 18 0 0 } ? =
|
|
|
|
] unit-test
|
2015-07-21 17:45:25 -04:00
|
|
|
|
2016-05-19 16:43:52 -04:00
|
|
|
! %dispatch
|
|
|
|
cpu x86.64? [
|
|
|
|
{
|
|
|
|
B{ 72 187 0 0 0 0 0 0 0 0 72 255 100 3 6 0 }
|
|
|
|
}
|
|
|
|
[
|
|
|
|
init-relocation [ RAX RBX %dispatch ] B{ } make
|
|
|
|
] unit-test
|
|
|
|
] when
|
|
|
|
|
2015-07-21 17:45:25 -04:00
|
|
|
! %prologue
|
|
|
|
{ t } [
|
|
|
|
[ 2 cells %prologue ] B{ } make
|
|
|
|
[ pic-tail-reg PUSH ] B{ } make =
|
|
|
|
] unit-test
|
|
|
|
|
|
|
|
{ t } [
|
|
|
|
[ 8 cells %prologue ] B{ } make
|
|
|
|
[ stack-reg 7 cells SUB ] B{ } make =
|
|
|
|
] unit-test
|
2016-05-19 16:43:52 -04:00
|
|
|
|
|
|
|
! %replace-imm
|
|
|
|
cpu x86.64? [
|
|
|
|
{
|
|
|
|
B{ 73 199 6 0 0 0 0 }
|
|
|
|
}
|
|
|
|
[
|
|
|
|
init-relocation [ 34.0 D: 0 %replace-imm ] B{ } make
|
|
|
|
] unit-test
|
|
|
|
] when
|