summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp
diff options
context:
space:
mode:
authorGravatar ameerj2021-03-21 19:28:37 -0400
committerGravatar ameerj2021-07-22 21:51:24 -0400
commite4e1cc11b8f7649171fe922b2899e57120bfba53 (patch)
tree5aaac48ac64018bcaa5f7faf17c4eff886d29b12 /src/shader_recompiler/ir_opt/constant_propagation_pass.cpp
parentshader: Implement FADD32I (diff)
downloadyuzu-e4e1cc11b8f7649171fe922b2899e57120bfba53.tar.gz
yuzu-e4e1cc11b8f7649171fe922b2899e57120bfba53.tar.xz
yuzu-e4e1cc11b8f7649171fe922b2899e57120bfba53.zip
shader: Implement DMNMX, DSET, DSETP
Diffstat (limited to 'src/shader_recompiler/ir_opt/constant_propagation_pass.cpp')
-rw-r--r--src/shader_recompiler/ir_opt/constant_propagation_pass.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp b/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp
index a39db2bf1..ef7766d22 100644
--- a/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp
+++ b/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp
@@ -229,7 +229,6 @@ void FoldISub32(IR::Inst& inst) {
229 } 229 }
230} 230}
231 231
232template <typename T>
233void FoldSelect(IR::Inst& inst) { 232void FoldSelect(IR::Inst& inst) {
234 const IR::Value cond{inst.Arg(0)}; 233 const IR::Value cond{inst.Arg(0)};
235 if (cond.IsImmediate()) { 234 if (cond.IsImmediate()) {
@@ -340,8 +339,15 @@ void ConstantPropagation(IR::Block& block, IR::Inst& inst) {
340 return FoldBitCast<IR::Opcode::BitCastU32F32, u32, f32>(inst, IR::Opcode::BitCastF32U32); 339 return FoldBitCast<IR::Opcode::BitCastU32F32, u32, f32>(inst, IR::Opcode::BitCastF32U32);
341 case IR::Opcode::IAdd64: 340 case IR::Opcode::IAdd64:
342 return FoldAdd<u64>(block, inst); 341 return FoldAdd<u64>(block, inst);
342 case IR::Opcode::SelectU1:
343 case IR::Opcode::SelectU8:
344 case IR::Opcode::SelectU16:
343 case IR::Opcode::SelectU32: 345 case IR::Opcode::SelectU32:
344 return FoldSelect<u32>(inst); 346 case IR::Opcode::SelectU64:
347 case IR::Opcode::SelectF16:
348 case IR::Opcode::SelectF32:
349 case IR::Opcode::SelectF64:
350 return FoldSelect(inst);
345 case IR::Opcode::LogicalAnd: 351 case IR::Opcode::LogicalAnd:
346 return FoldLogicalAnd(inst); 352 return FoldLogicalAnd(inst);
347 case IR::Opcode::LogicalOr: 353 case IR::Opcode::LogicalOr: