gtst_addr(): short conditional jumps (i386, x86_64)

This commit is contained in:
Pavlas, Zdenek
2016-09-30 07:29:38 -07:00
parent fc0fc6aba3
commit e238e6521b
4 changed files with 34 additions and 3 deletions

View File

@ -1686,8 +1686,21 @@ void gjmp_addr(int a)
}
}
ST_FUNC void gtst_addr(int inv, int a)
{
inv ^= (vtop--)->c.i;
a -= ind + 2;
if (a == (char)a) {
g(inv - 32);
g(a);
} else {
g(0x0f);
oad(inv - 16, a - 4);
}
}
/* generate a test. set 'inv' to invert test. Stack entry is popped */
int gtst(int inv, int t)
ST_FUNC int gtst(int inv, int t)
{
int v = vtop->r & VT_VALMASK;
if (v == VT_CMP) {