Skip to content

Commit 4d16959

Browse files
committed
x86: revert changes to CMP emitter instruction, but keep the test
1 parent e4ddfba commit 4d16959

File tree

1 file changed

+2
-24
lines changed

1 file changed

+2
-24
lines changed

src/compiler/emit_x86.bas

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4153,30 +4153,8 @@ private sub hCMPI _
41534153
ostr = "test " + dst + COMMA + dst
41544154
outp ostr
41554155
else
4156-
4157-
'' immediate and offset? it's invalid for CMP so use a temp reg
4158-
if( (svreg->typ = IR_VREGTYPE_IMM) and (dvreg->typ = IR_VREGTYPE_OFS) ) then
4159-
4160-
dim reg as integer, isfree as integer, rname as string
4161-
reg = hFindRegNotInVreg( dvreg )
4162-
rname = *hGetRegName( dvreg->dtype, reg )
4163-
isfree = hIsRegFree( FB_DATACLASS_INTEGER, reg )
4164-
4165-
if( isfree = FALSE ) then
4166-
hPUSH( rname )
4167-
end if
4168-
4169-
outp "mov " + rname + COMMA + dst
4170-
outp "cmp " + rname + COMMA + src
4171-
4172-
if( isfree = FALSE ) then
4173-
hPop( rname )
4174-
end if
4175-
4176-
else
4177-
outp "cmp " + dst + COMMA + src
4178-
4179-
end if
4156+
ostr = "cmp " + dst + COMMA + src
4157+
outp ostr
41804158
end if
41814159

41824160
'' no result to be set? just branch

0 commit comments

Comments
 (0)