mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-28 22:36:26 -05:00
shader: Add constant propagation for arithmetic right shifts
This commit is contained in:
parent
469f8bb857
commit
a8d46a5eae
1 changed files with 3 additions and 0 deletions
|
@ -482,6 +482,9 @@ void ConstantPropagation(IR::Block& block, IR::Inst& inst) {
|
||||||
case IR::Opcode::IMul32:
|
case IR::Opcode::IMul32:
|
||||||
FoldWhenAllImmediates(inst, [](u32 a, u32 b) { return a * b; });
|
FoldWhenAllImmediates(inst, [](u32 a, u32 b) { return a * b; });
|
||||||
return;
|
return;
|
||||||
|
case IR::Opcode::ShiftRightArithmetic32:
|
||||||
|
FoldWhenAllImmediates(inst, [](s32 a, s32 b) { return static_cast<u32>(a >> b); });
|
||||||
|
return;
|
||||||
case IR::Opcode::BitCastF32U32:
|
case IR::Opcode::BitCastF32U32:
|
||||||
return FoldBitCast<IR::Opcode::BitCastF32U32, f32, u32>(inst, IR::Opcode::BitCastU32F32);
|
return FoldBitCast<IR::Opcode::BitCastF32U32, f32, u32>(inst, IR::Opcode::BitCastU32F32);
|
||||||
case IR::Opcode::BitCastU32F32:
|
case IR::Opcode::BitCastU32F32:
|
||||||
|
|
Loading…
Reference in a new issue