mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-25 05:21:16 +00:00
Clean up EmitSBIT slightly
This commit is contained in:
parent
1e82cf877d
commit
4ed578e0d2
1 changed files with 7 additions and 5 deletions
|
@ -139,19 +139,21 @@ void JitCompiler::EmitSBIT()
|
|||
{
|
||||
EmitNullPointerThrow(A, X_WRITE_NIL);
|
||||
|
||||
IRValue* ptr = LoadA(A);
|
||||
IRValue* value = cc.CreateLoad(ptr);
|
||||
|
||||
IRBasicBlock* ifbb = irfunc->createBasicBlock({});
|
||||
IRBasicBlock* elsebb = irfunc->createBasicBlock({});
|
||||
IRBasicBlock* endbb = irfunc->createBasicBlock({});
|
||||
|
||||
cc.CreateCondBr(cc.CreateICmpNE(LoadD(B), ConstValueD(0)), ifbb, elsebb);
|
||||
|
||||
cc.SetInsertPoint(ifbb);
|
||||
cc.CreateStore(cc.CreateOr(value, ircontext->getConstantInt(int8Ty, (int)C)), ptr);
|
||||
IRValue* ptr = LoadA(A);
|
||||
Store(cc.CreateOr(Load(ptr), ircontext->getConstantInt(int8Ty, (int)C)), ptr);
|
||||
cc.CreateBr(endbb);
|
||||
|
||||
cc.SetInsertPoint(elsebb);
|
||||
cc.CreateStore(cc.CreateAnd(value, ircontext->getConstantInt(int8Ty, ~(int)C)), ptr);
|
||||
ptr = LoadA(A);
|
||||
Store(cc.CreateAnd(Load(ptr), ircontext->getConstantInt(int8Ty, ~(int)C)), ptr);
|
||||
cc.CreateBr(endbb);
|
||||
|
||||
cc.SetInsertPoint(endbb);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue