diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2021-03-26 20:46:07 +0100 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-07-23 03:51:24 +0200 |
commit | d9c5bd9509e82fcde72c18663989931f97ed6518 (patch) | |
tree | d6575e66d66a8abc8ee8776c1c2536c052424787 /src/shader_recompiler/ir_opt/constant_propagation_pass.cpp | |
parent | shader: Add IR opcode for ImageFetch (diff) | |
download | yuzu-d9c5bd9509e82fcde72c18663989931f97ed6518.tar yuzu-d9c5bd9509e82fcde72c18663989931f97ed6518.tar.gz yuzu-d9c5bd9509e82fcde72c18663989931f97ed6518.tar.bz2 yuzu-d9c5bd9509e82fcde72c18663989931f97ed6518.tar.lz yuzu-d9c5bd9509e82fcde72c18663989931f97ed6518.tar.xz yuzu-d9c5bd9509e82fcde72c18663989931f97ed6518.tar.zst yuzu-d9c5bd9509e82fcde72c18663989931f97ed6518.zip |
Diffstat (limited to 'src/shader_recompiler/ir_opt/constant_propagation_pass.cpp')
-rw-r--r-- | src/shader_recompiler/ir_opt/constant_propagation_pass.cpp | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp b/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp index 12159e738..052f1609b 100644 --- a/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp +++ b/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp @@ -355,17 +355,6 @@ void FoldBranchConditional(IR::Inst& inst) { } } -void FoldConstantComposite(IR::Inst& inst, size_t amount = 2) { - for (size_t i = 0; i < amount; i++) { - if (!inst.Arg(i).IsConstantContainer()) { - return; - } - } - auto info{inst.Flags<IR::CompositeDecoration>()}; - info.is_constant = true; - inst.SetFlags(info); -} - void ConstantPropagation(IR::Block& block, IR::Inst& inst) { switch (inst.Opcode()) { case IR::Opcode::GetRegister: @@ -391,13 +380,6 @@ void ConstantPropagation(IR::Block& block, IR::Inst& inst) { case IR::Opcode::SelectF32: case IR::Opcode::SelectF64: return FoldSelect(inst); - case IR::Opcode::CompositeConstructU32x2: - case IR::Opcode::CompositeConstructF16x2: - case IR::Opcode::CompositeConstructF32x2: - case IR::Opcode::CompositeConstructF64x2: - return FoldConstantComposite(inst, 2); - case IR::Opcode::CompositeConstructArrayU32x2: - return FoldConstantComposite(inst, 4); case IR::Opcode::FPMul32: return FoldFPMul32(inst); case IR::Opcode::LogicalAnd: @@ -423,12 +405,12 @@ void ConstantPropagation(IR::Block& block, IR::Inst& inst) { return; case IR::Opcode::BitFieldSExtract: FoldWhenAllImmediates(inst, [](s32 base, u32 shift, u32 count) { - const size_t back_shift = static_cast<size_t>(shift) + static_cast<size_t>(count); + const size_t back_shift{static_cast<size_t>(shift) + static_cast<size_t>(count)}; if (back_shift > Common::BitSize<s32>()) { throw LogicError("Undefined result in {}({}, {}, {})", IR::Opcode::BitFieldSExtract, base, shift, count); } - const size_t left_shift = Common::BitSize<s32>() - back_shift; + const size_t left_shift{Common::BitSize<s32>() - back_shift}; return static_cast<u32>(static_cast<s32>(base << left_shift) >> static_cast<size_t>(Common::BitSize<s32>() - count)); }); |