summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2021-04-19 16:36:57 -0300
committerGravatar ameerj2021-07-22 21:51:28 -0400
commita8d46a5eae4e0d65c08f6574cffc48bc55d00940 (patch)
treeded7e72824650f4329450b320432f7121c7b862e /src/shader_recompiler/ir_opt/constant_propagation_pass.cpp
parentshader: Simplify code for local memory (diff)
downloadyuzu-a8d46a5eae4e0d65c08f6574cffc48bc55d00940.tar.gz
yuzu-a8d46a5eae4e0d65c08f6574cffc48bc55d00940.tar.xz
yuzu-a8d46a5eae4e0d65c08f6574cffc48bc55d00940.zip
shader: Add constant propagation for arithmetic right shifts
Diffstat (limited to 'src/shader_recompiler/ir_opt/constant_propagation_pass.cpp')
-rw-r--r--src/shader_recompiler/ir_opt/constant_propagation_pass.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp b/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp
index 7e86f64a8..2206f93c2 100644
--- a/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp
+++ b/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp
@@ -482,6 +482,9 @@ void ConstantPropagation(IR::Block& block, IR::Inst& inst) {
482 case IR::Opcode::IMul32: 482 case IR::Opcode::IMul32:
483 FoldWhenAllImmediates(inst, [](u32 a, u32 b) { return a * b; }); 483 FoldWhenAllImmediates(inst, [](u32 a, u32 b) { return a * b; });
484 return; 484 return;
485 case IR::Opcode::ShiftRightArithmetic32:
486 FoldWhenAllImmediates(inst, [](s32 a, s32 b) { return static_cast<u32>(a >> b); });
487 return;
485 case IR::Opcode::BitCastF32U32: 488 case IR::Opcode::BitCastF32U32:
486 return FoldBitCast<IR::Opcode::BitCastF32U32, f32, u32>(inst, IR::Opcode::BitCastU32F32); 489 return FoldBitCast<IR::Opcode::BitCastF32U32, f32, u32>(inst, IR::Opcode::BitCastU32F32);
487 case IR::Opcode::BitCastU32F32: 490 case IR::Opcode::BitCastU32F32: