From 1401c85d6ab79a2c3a3c42bbd446a4756b3e0493 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org>
Date: Wed, 20 Jul 2022 15:13:02 +0200
Subject: [PATCH] Bytecode: drop FCUML instruction
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

It’s redundant with FBINARY{BinaryOpcode::plus}.
---
 src/Bytecode.hh  | 17 -----------------
 src/ModelTree.hh |  2 +-
 2 files changed, 1 insertion(+), 18 deletions(-)

diff --git a/src/Bytecode.hh b/src/Bytecode.hh
index 9d867e55..974aaad9 100644
--- a/src/Bytecode.hh
+++ b/src/Bytecode.hh
@@ -69,8 +69,6 @@ enum class Tags
    FBINARY, // A binary operator
    FTRINARY, // A trinary operator
 
-   FCUML, // Cumulates the result
-
    FJMPIFEVAL, // Jump if evaluate = true
    FJMP, // Jump
 
@@ -217,14 +215,6 @@ public:
   };
 };
 
-class FCUML_ : public BytecodeInstruction
-{
-public:
-  FCUML_() : BytecodeInstruction{Tags::FCUML}
-  {
-  };
-};
-
 class FDIMT_ : public TagWithOneArgument<int>
 {
 public:
@@ -1242,13 +1232,6 @@ public:
             tags_liste.emplace_back(Tags::FENDEQU, code);
             code += sizeof(FENDEQU_);
             break;
-          case Tags::FCUML:
-# ifdef DEBUGL
-            mexPrintf("FCUML\n");
-# endif
-            tags_liste.emplace_back(Tags::FCUML, code);
-            code += sizeof(FCUML_);
-            break;
           case Tags::FDIMT:
 # ifdef DEBUGL
             mexPrintf("FDIMT = %d size = %d\n", Tags::FDIMT, sizeof(FDIMT_));
diff --git a/src/ModelTree.hh b/src/ModelTree.hh
index f11ac7c9..7c0a5746 100644
--- a/src/ModelTree.hh
+++ b/src/ModelTree.hh
@@ -1390,7 +1390,7 @@ ModelTree::writeBlockBytecodeHelper(BytecodeWriter &code_file, int block) const
                         code_file << FLDSU_{index_u}
                                   << FLDSV_{SymbolType::endogenous, var};
                       code_file << FBINARY_{BinaryOpcode::times}
-                                << FCUML_{};
+                                << FBINARY_{BinaryOpcode::plus};
                     }
                   code_file << FBINARY_{BinaryOpcode::minus};
                   if constexpr(dynamic)
-- 
GitLab