- Move the RET and RETI final flag into the high bit of the destination selector.

SVN r3922 (scripting)
This commit is contained in:
Randy Heit 2012-10-29 01:11:24 +00:00
commit c2e700f116
5 changed files with 35 additions and 27 deletions

View file

@ -501,13 +501,14 @@ size_t VMFunctionBuilder::EmitLoadInt(int regnum, int value)
size_t VMFunctionBuilder::EmitRetInt(int retnum, bool final, int value)
{
if (value >= -16384 && value <= 16383)
assert(retnum >= 0 && retnum <= 127);
if (value >= -32768 && value <= 32767)
{
return Emit(OP_RETI, retnum, value | (final << 15));
return Emit(OP_RETI, retnum | (final << 7), value);
}
else
{
return Emit(OP_RETI, retnum, REGT_INT | REGT_KONST | (final ? REGT_FINAL : 0), GetConstantInt(value));
return Emit(OP_RET, retnum | (final << 7), REGT_INT | REGT_KONST, GetConstantInt(value));
}
}