summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/frontend/ir/microinstruction.cpp
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2021-04-21 00:25:46 -0300
committerGravatar ameerj2021-07-22 21:51:28 -0400
commit6944cabb899c4367a63cde97ae2bc2eb1a0fb790 (patch)
treeb52f0687254b6c5c123dd1b5171bad124055c6dc /src/shader_recompiler/frontend/ir/microinstruction.cpp
parentshader: Inline common IR::Block methods (diff)
downloadyuzu-6944cabb899c4367a63cde97ae2bc2eb1a0fb790.tar.gz
yuzu-6944cabb899c4367a63cde97ae2bc2eb1a0fb790.tar.xz
yuzu-6944cabb899c4367a63cde97ae2bc2eb1a0fb790.zip
shader: Inline common Opcode and Inst functions
Diffstat (limited to 'src/shader_recompiler/frontend/ir/microinstruction.cpp')
-rw-r--r--src/shader_recompiler/frontend/ir/microinstruction.cpp18
1 files changed, 0 insertions, 18 deletions
diff --git a/src/shader_recompiler/frontend/ir/microinstruction.cpp b/src/shader_recompiler/frontend/ir/microinstruction.cpp
index 7555ac00a..41f9fa0cd 100644
--- a/src/shader_recompiler/frontend/ir/microinstruction.cpp
+++ b/src/shader_recompiler/frontend/ir/microinstruction.cpp
@@ -221,28 +221,10 @@ Inst* Inst::GetAssociatedPseudoOperation(IR::Opcode opcode) {
221 } 221 }
222} 222}
223 223
224size_t Inst::NumArgs() const {
225 return op == Opcode::Phi ? phi_args.size() : NumArgsOf(op);
226}
227
228IR::Type Inst::Type() const { 224IR::Type Inst::Type() const {
229 return TypeOf(op); 225 return TypeOf(op);
230} 226}
231 227
232Value Inst::Arg(size_t index) const {
233 if (op == Opcode::Phi) {
234 if (index >= phi_args.size()) {
235 throw InvalidArgument("Out of bounds argument index {} in phi instruction", index);
236 }
237 return phi_args[index].second;
238 } else {
239 if (index >= NumArgsOf(op)) {
240 throw InvalidArgument("Out of bounds argument index {} in opcode {}", index, op);
241 }
242 return args[index];
243 }
244}
245
246void Inst::SetArg(size_t index, Value value) { 228void Inst::SetArg(size_t index, Value value) {
247 if (index >= NumArgs()) { 229 if (index >= NumArgs()) {
248 throw InvalidArgument("Out of bounds argument index {} in opcode {}", index, op); 230 throw InvalidArgument("Out of bounds argument index {} in opcode {}", index, op);