mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-06-26 20:36:16 +00:00
Optimise out unnecessary shifts (#1021)
This commit is contained in:
parent
581ddfec4d
commit
5db27109c9
2 changed files with 18 additions and 0 deletions
|
@ -278,6 +278,12 @@ void ConstantPropagation(IR::Block& block, IR::Inst& inst) {
|
|||
case IR::Opcode::FPCmpClass32:
|
||||
FoldCmpClass(inst);
|
||||
return;
|
||||
case IR::Opcode::ShiftLeftLogical32:
|
||||
FoldWhenAllImmediates(inst, [](u32 a, u32 b) { return static_cast<u32>(a << b); });
|
||||
return;
|
||||
case IR::Opcode::ShiftRightLogical32:
|
||||
FoldWhenAllImmediates(inst, [](u32 a, u32 b) { return static_cast<u32>(a >> b); });
|
||||
return;
|
||||
case IR::Opcode::ShiftRightArithmetic32:
|
||||
FoldWhenAllImmediates(inst, [](s32 a, s32 b) { return static_cast<u32>(a >> b); });
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue