mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-02-22 11:21:09 +00:00
- adds OP_EQ_R, the first instruction using jumps
This commit is contained in:
parent
5c3ef8ac15
commit
166ce87a86
1 changed files with 30 additions and 0 deletions
|
@ -309,6 +309,11 @@ JitFuncPtr JitCompile(VMScriptFunction *sfunc)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int size = sfunc->CodeSize;
|
int size = sfunc->CodeSize;
|
||||||
|
|
||||||
|
TArray<Label> labels(size, true);
|
||||||
|
|
||||||
|
for (int i = 0; i < size; i++) labels[i] = cc.newLabel();
|
||||||
|
|
||||||
for (int i = 0; i < size; i++)
|
for (int i = 0; i < size; i++)
|
||||||
{
|
{
|
||||||
const VMOP *pc = sfunc->Code + i;
|
const VMOP *pc = sfunc->Code + i;
|
||||||
|
@ -316,6 +321,8 @@ JitFuncPtr JitCompile(VMScriptFunction *sfunc)
|
||||||
int a = pc->a;
|
int a = pc->a;
|
||||||
int b;// , c;
|
int b;// , c;
|
||||||
|
|
||||||
|
cc.bind(labels[i]);
|
||||||
|
|
||||||
switch (op)
|
switch (op)
|
||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
|
@ -905,6 +912,29 @@ JitFuncPtr JitCompile(VMScriptFunction *sfunc)
|
||||||
cc.not_(regD[a]);
|
cc.not_(regD[a]);
|
||||||
break;
|
break;
|
||||||
case OP_EQ_R: // if ((dB == dkC) != A) then pc++
|
case OP_EQ_R: // if ((dB == dkC) != A) then pc++
|
||||||
|
{
|
||||||
|
Label elseLabel = cc.newLabel();
|
||||||
|
|
||||||
|
auto tmp0 = cc.newInt32();
|
||||||
|
auto tmp1 = cc.newInt32();
|
||||||
|
|
||||||
|
cc.cmp(regD[B], regD[C]);
|
||||||
|
cc.sete(tmp0);
|
||||||
|
|
||||||
|
cc.mov(tmp1, A);
|
||||||
|
cc.and_(tmp1, CMP_CHECK);
|
||||||
|
cc.setz(tmp1);
|
||||||
|
|
||||||
|
cc.cmp(tmp0, tmp1);
|
||||||
|
cc.je(elseLabel);
|
||||||
|
|
||||||
|
cc.jmp(labels[i + 2 + JMPOFS(pc + 1)]);
|
||||||
|
|
||||||
|
cc.bind(elseLabel);
|
||||||
|
cc.jmp(labels[i + 2]);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
case OP_EQ_K:
|
case OP_EQ_K:
|
||||||
case OP_LT_RR: // if ((dkB < dkC) != A) then pc++
|
case OP_LT_RR: // if ((dkB < dkC) != A) then pc++
|
||||||
case OP_LT_RK:
|
case OP_LT_RK:
|
||||||
|
|
Loading…
Reference in a new issue