cpu.x86: fix silly bug in %clear

db4
Björn Lindqvist 2015-05-18 06:28:15 +02:00
parent c7ea419874
commit 6c43475183
2 changed files with 11 additions and 5 deletions

View File

@ -1,8 +1,8 @@
IN: cpu.x86.tests
USING: compiler.cfg.debugger compiler.cfg.instructions USING: compiler.cfg.debugger compiler.cfg.instructions
compiler.codegen.gc-maps compiler.codegen.relocation cpu.architecture compiler.codegen.gc-maps compiler.codegen.relocation compiler.cfg.registers
cpu.x86.features kernel kernel.private make math math.libm namespaces sequences cpu.architecture cpu.x86.features kernel kernel.private make math math.libm
tools.test ; namespaces sequences system tools.test ;
IN: cpu.x86.tests
{ } [ { } [
[ { float } declare fsqrt ] [ { float } declare fsqrt ]
@ -31,3 +31,9 @@ tools.test ;
] B{ } make drop ] B{ } make drop
gc-maps get length gc-maps get length
] unit-test ] unit-test
! %clear
{ t } [
[ D 0 %clear ] B{ } make
cpu x86.32? B{ 199 6 144 18 0 0 } B{ 73 199 6 144 18 0 0 } ? =
] unit-test

View File

@ -91,7 +91,7 @@ M: x86 %replace-imm
} cond ; } cond ;
M: x86 %clear ( loc -- ) M: x86 %clear ( loc -- )
loc>operand 297 MOV ; 297 swap %replace-imm ;
: (%inc) ( n reg -- ) swap cells dup 0 > [ ADD ] [ neg SUB ] if ; inline : (%inc) ( n reg -- ) swap cells dup 0 > [ ADD ] [ neg SUB ] if ; inline