diff options
Diffstat (limited to '')
| -rw-r--r-- | src/shader_recompiler/frontend/ir/microinstruction.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/shader_recompiler/frontend/ir/microinstruction.h b/src/shader_recompiler/frontend/ir/microinstruction.h index 43460b950..7f1ed6710 100644 --- a/src/shader_recompiler/frontend/ir/microinstruction.h +++ b/src/shader_recompiler/frontend/ir/microinstruction.h | |||
| @@ -5,6 +5,8 @@ | |||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <array> | 7 | #include <array> |
| 8 | #include <span> | ||
| 9 | #include <vector> | ||
| 8 | 10 | ||
| 9 | #include <boost/intrusive/list.hpp> | 11 | #include <boost/intrusive/list.hpp> |
| 10 | 12 | ||
| @@ -15,6 +17,8 @@ | |||
| 15 | 17 | ||
| 16 | namespace Shader::IR { | 18 | namespace Shader::IR { |
| 17 | 19 | ||
| 20 | class Block; | ||
| 21 | |||
| 18 | constexpr size_t MAX_ARG_COUNT = 4; | 22 | constexpr size_t MAX_ARG_COUNT = 4; |
| 19 | 23 | ||
| 20 | class Inst : public boost::intrusive::list_base_hook<> { | 24 | class Inst : public boost::intrusive::list_base_hook<> { |
| @@ -59,6 +63,11 @@ public: | |||
| 59 | /// Set the value of a given argument index. | 63 | /// Set the value of a given argument index. |
| 60 | void SetArg(size_t index, Value value); | 64 | void SetArg(size_t index, Value value); |
| 61 | 65 | ||
| 66 | /// Get an immutable span to the phi operands. | ||
| 67 | [[nodiscard]] std::span<const std::pair<Block*, Value>> PhiOperands() const noexcept; | ||
| 68 | /// Add phi operand to a phi instruction. | ||
| 69 | void AddPhiOperand(Block* predecessor, const Value& value); | ||
| 70 | |||
| 62 | void Invalidate(); | 71 | void Invalidate(); |
| 63 | void ClearArgs(); | 72 | void ClearArgs(); |
| 64 | 73 | ||
| @@ -76,6 +85,7 @@ private: | |||
| 76 | Inst* carry_inst{}; | 85 | Inst* carry_inst{}; |
| 77 | Inst* overflow_inst{}; | 86 | Inst* overflow_inst{}; |
| 78 | Inst* zsco_inst{}; | 87 | Inst* zsco_inst{}; |
| 88 | std::vector<std::pair<Block*, Value>> phi_operands; | ||
| 79 | u64 flags{}; | 89 | u64 flags{}; |
| 80 | }; | 90 | }; |
| 81 | 91 | ||