mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 23:32:02 +00:00
- made CMP_CHECK checking compile time
This commit is contained in:
parent
740415246e
commit
dc03cb7a80
1 changed files with 6 additions and 7 deletions
|
@ -226,16 +226,15 @@ template <typename Func>
|
||||||
void emitComparisonOpcode(asmjit::X86Compiler& cc, const TArray<asmjit::Label>& labels, const VMOP* pc, int i, Func compFunc) {
|
void emitComparisonOpcode(asmjit::X86Compiler& cc, const TArray<asmjit::Label>& labels, const VMOP* pc, int i, Func compFunc) {
|
||||||
using namespace asmjit;
|
using namespace asmjit;
|
||||||
|
|
||||||
auto tmp0 = cc.newInt32();
|
auto tmp = cc.newInt32();
|
||||||
auto tmp1 = cc.newInt32();
|
|
||||||
|
|
||||||
compFunc(tmp0);
|
compFunc(tmp);
|
||||||
|
|
||||||
cc.mov(tmp1, A);
|
bool check = static_cast<bool>(A & CMP_CHECK);
|
||||||
cc.and_(tmp1, CMP_CHECK);
|
|
||||||
|
|
||||||
cc.cmp(tmp0, tmp1);
|
cc.test(tmp, tmp);
|
||||||
cc.jne(labels[i + 2]);
|
if (check) cc.je (labels[i + 2]);
|
||||||
|
else cc.jne(labels[i + 2]);
|
||||||
|
|
||||||
cc.jmp(labels[i + 2 + JMPOFS(pc + 1)]);
|
cc.jmp(labels[i + 2 + JMPOFS(pc + 1)]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue