mirror of
https://github.com/FEX-Emu/FEX.git
synced 2025-02-01 12:02:32 +00:00
Adds Phi helper functions to OpDispatcher
This commit is contained in:
parent
88c6b629ce
commit
d5cb87d1eb
@ -338,6 +338,30 @@ public:
|
||||
return _CondJump(ssa0, InvalidNode, InvalidNode);
|
||||
}
|
||||
|
||||
IRPair<IROp_Phi> _Phi() {
|
||||
return _Phi(InvalidNode, InvalidNode, 0);
|
||||
}
|
||||
|
||||
IRPair<IROp_PhiValue> _PhiValue(OrderedNode *Value, OrderedNode *Block) {
|
||||
return _PhiValue(Value, Block, InvalidNode);
|
||||
}
|
||||
|
||||
void AddPhiValue(IR::IROp_Phi *Phi, OrderedNode *Value) {
|
||||
// Got to do some bookkeeping first
|
||||
Value->AddUse();
|
||||
auto ValueIROp = Value->Op(Data.Begin())->C<IR::IROp_PhiValue>()->Value.GetNode(ListData.Begin())->Op(Data.Begin());
|
||||
Phi->Header.Size = ValueIROp->Size;
|
||||
Phi->Header.Elements = ValueIROp->Elements;
|
||||
|
||||
if (!Phi->PhiBegin.ID()) {
|
||||
Phi->PhiBegin = Phi->PhiEnd = Value->Wrapped(ListData.Begin());
|
||||
return;
|
||||
}
|
||||
auto PhiValueEndNode = Phi->PhiEnd.GetNode(ListData.Begin());
|
||||
auto PhiValueEndOp = PhiValueEndNode->Op(Data.Begin())->CW<IR::IROp_PhiValue>();
|
||||
PhiValueEndOp->Next = Value->Wrapped(ListData.Begin());
|
||||
}
|
||||
|
||||
void SetJumpTarget(IR::IROp_Jump *Op, OrderedNode *Target) {
|
||||
LogMan::Throw::A(Target->Op(Data.Begin())->Op == OP_CODEBLOCK,
|
||||
"Tried setting Jump target to %%ssa%d %s",
|
||||
|
Loading…
x
Reference in New Issue
Block a user