mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2025-12-28 02:05:00 +01:00
constant_propagation_pass: Handle GetCarryFromOp for MostSignificantWord
This commit is contained in:
parent
ada66d7092
commit
39bd2c034d
3 changed files with 50 additions and 0 deletions
|
|
@ -158,11 +158,16 @@ void FoldMostSignificantBit(IR::Inst& inst) {
|
|||
}
|
||||
|
||||
void FoldMostSignificantWord(IR::Inst& inst) {
|
||||
IR::Inst* carry_inst = inst.GetAssociatedPseudoOperation(IR::Opcode::GetCarryFromOp);
|
||||
|
||||
if (!inst.AreAllArgsImmediates()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const auto operand = inst.GetArg(0);
|
||||
if (carry_inst) {
|
||||
carry_inst->ReplaceUsesWith(IR::Value{Common::Bit<31>(operand.GetImmediateAsU64())});
|
||||
}
|
||||
inst.ReplaceUsesWith(IR::Value{static_cast<u32>(operand.GetImmediateAsU64() >> 32)});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue