Skip to content

Commit

Permalink
Fix inverted TEST
Browse files Browse the repository at this point in the history
Remove sign extend when loading int32
  • Loading branch information
dpjudas committed Jun 8, 2020
1 parent 5112f5a commit 31a603b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/common/scripting/jit/jit_flow.cpp
Expand Up @@ -6,7 +6,7 @@ void JitCompiler::EmitTEST()
int i = (int)(ptrdiff_t)(pc - sfunc->Code);

auto continuebb = irfunc->createBasicBlock({});
cc.CreateCondBr(cc.CreateICmpEQ(LoadD(A), ConstValueD(BC)), GetLabel(i + 2), continuebb);
cc.CreateCondBr(cc.CreateICmpNE(LoadD(A), ConstValueD(BC)), GetLabel(i + 2), continuebb);
cc.SetInsertPoint(continuebb);
}

Expand All @@ -16,7 +16,7 @@ void JitCompiler::EmitTESTN()
int i = (int)(ptrdiff_t)(pc - sfunc->Code);

auto continuebb = irfunc->createBasicBlock({});
cc.CreateCondBr(cc.CreateICmpEQ(LoadD(A), ConstValueD(-bc)), GetLabel(i + 2), continuebb);
cc.CreateCondBr(cc.CreateICmpNE(LoadD(A), ConstValueD(-bc)), GetLabel(i + 2), continuebb);
cc.SetInsertPoint(continuebb);
}

Expand Down
4 changes: 2 additions & 2 deletions src/common/scripting/jit/jit_load.cpp
Expand Up @@ -114,13 +114,13 @@ void JitCompiler::EmitLH_R()
void JitCompiler::EmitLW()
{
EmitNullPointerThrow(B, X_READ_NIL);
StoreD(SExt(Load(ToInt32Ptr(LoadA(B), ConstD(C)))), A);
StoreD(Load(ToInt32Ptr(LoadA(B), ConstD(C))), A);
}

void JitCompiler::EmitLW_R()
{
EmitNullPointerThrow(B, X_READ_NIL);
StoreD(SExt(Load(ToInt32Ptr(LoadA(B), LoadD(C)))), A);
StoreD(Load(ToInt32Ptr(LoadA(B), LoadD(C))), A);
}

void JitCompiler::EmitLBU()
Expand Down

0 comments on commit 31a603b

Please sign in to comment.