summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/frontend/ir/microinstruction.h
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-02-03 01:07:00 +0100
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:21 +0200
commit6c4cc0cd062fbbba5349da1108d3c23cb330ca8a (patch)
tree544291931da8a85fafcea71964c77d9278ec7f29 /src/shader_recompiler/frontend/ir/microinstruction.h
parentshader: Initial recompiler work (diff)
downloadyuzu-6c4cc0cd062fbbba5349da1108d3c23cb330ca8a.tar
yuzu-6c4cc0cd062fbbba5349da1108d3c23cb330ca8a.tar.gz
yuzu-6c4cc0cd062fbbba5349da1108d3c23cb330ca8a.tar.bz2
yuzu-6c4cc0cd062fbbba5349da1108d3c23cb330ca8a.tar.lz
yuzu-6c4cc0cd062fbbba5349da1108d3c23cb330ca8a.tar.xz
yuzu-6c4cc0cd062fbbba5349da1108d3c23cb330ca8a.tar.zst
yuzu-6c4cc0cd062fbbba5349da1108d3c23cb330ca8a.zip
Diffstat (limited to '')
-rw-r--r--src/shader_recompiler/frontend/ir/microinstruction.h10
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 @@
#pragma once
#include <array>
+#include <span>
+#include <vector>
#include <boost/intrusive/list.hpp>
@@ -15,6 +17,8 @@
namespace Shader::IR {
+class Block;
+
constexpr size_t MAX_ARG_COUNT = 4;
class Inst : public boost::intrusive::list_base_hook<> {
@@ -59,6 +63,11 @@ public:
/// Set the value of a given argument index.
void SetArg(size_t index, Value value);
+ /// Get an immutable span to the phi operands.
+ [[nodiscard]] std::span<const std::pair<Block*, Value>> PhiOperands() const noexcept;
+ /// Add phi operand to a phi instruction.
+ void AddPhiOperand(Block* predecessor, const Value& value);
+
void Invalidate();
void ClearArgs();
@@ -76,6 +85,7 @@ private:
Inst* carry_inst{};
Inst* overflow_inst{};
Inst* zsco_inst{};
+ std::vector<std::pair<Block*, Value>> phi_operands;
u64 flags{};
};