2008-02-03 11:28:36 +01:00
/*
2021-02-01 11:10:59 +01:00
* Copyright © 2007 - 2021 Dynare Team
2008-02-03 11:28:36 +01:00
*
* This file is part of Dynare .
*
* Dynare is free software : you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) any later version .
*
* Dynare is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
2021-06-09 16:52:20 +02:00
* along with Dynare . If not , see < https : //www.gnu.org/licenses/>.
2008-02-03 11:28:36 +01:00
*/
2008-10-17 19:15:23 +02:00
# ifndef _CODEINTERPRETER_HH
# define _CODEINTERPRETER_HH
2014-12-17 09:37:43 +01:00
2009-10-16 18:34:27 +02:00
# include <fstream>
# include <cstring>
2018-06-04 12:31:07 +02:00
# include <utility>
2009-10-23 13:26:29 +02:00
# include <vector>
2009-10-16 18:34:27 +02:00
# ifdef BYTE_CODE
2021-02-01 14:46:08 +01:00
# include <dynmex.h>
2009-10-16 18:34:27 +02:00
# endif
using namespace std ;
2018-07-17 16:32:00 +02:00
const double near_zero { 1e-12 } ;
2009-10-16 18:34:27 +02:00
/**
2009-12-16 18:13:23 +01:00
* \ enum Tags
* \ brief The differents flags of the bytecode
*/
2021-02-01 11:10:59 +01:00
enum class Tags
2009-10-16 18:34:27 +02:00
{
2019-12-20 16:59:30 +01:00
FLDZ , //!< Stores zero in the stack - 0 (0)
FLDC , //!< Stores a constant term in the stack - 1 (1)
2009-10-16 18:34:27 +02:00
2019-12-20 16:59:30 +01:00
FDIMT , //!< Defines the number of temporary terms - dynamic context (the period has to be indicated) - 2 (2)
FDIMST , //!< Defines the number of temporary terms - static context (the period hasn't to be indicated) - 3 (3)
FLDT , //!< Stores a temporary term in the stack - dynamic context (the period has to be indicated) - 4 (4)
FLDST , //!< Stores a temporary term in the stack - static context (the period hasn't to be indicated) - 5 (5)
FSTPT , //!< Loads a temporary term from the stack - dynamic context (the period has to be indicated) - 6 (6)
FSTPST , //!< Loads a temporary term from the stack - static context (the period hasn't to be indicated) - 7 (7)
2009-10-16 18:34:27 +02:00
2019-12-20 16:59:30 +01:00
FLDU , //!< Stores an element of the vector U in the stack - dynamic context (the period has to be indicated) - 8 (8)
FLDSU , //!< Stores an element of the vector U in the stack - static context (the period hasn't to be indicated) - 9 (9)
FSTPU , //!< Loads an element of the vector U from the stack - dynamic context (the period has to be indicated) - A (10)
FSTPSU , //!< Loads an element of the vector U from the stack - static context (the period hasn't to be indicated) - B (11)
2009-10-16 18:34:27 +02:00
2019-12-20 16:59:30 +01:00
FLDV , //!< Stores a variable (described in SymbolType) in the stack - dynamic context (the period has to be indicated) - C (12)
FLDSV , //!< Stores a variable (described in SymbolType) in the stack - static context (the period hasn't to be indicated) - D (13)
FLDVS , //!< Stores a variable (described in SymbolType) in the stack - dynamic context but inside the STEADYSTATE function (the period hasn't to be indicated) - E (14)
FSTPV , //!< Loads a variable (described in SymbolType) from the stack - dynamic context (the period has to be indicated) - F (15)
FSTPSV , //!< Loads a variable (described in SymbolType) from the stack - static context (the period hasn't to be indicated) - 10 (16)
2009-10-16 18:34:27 +02:00
2019-12-20 16:59:30 +01:00
FLDR , //!< Stores a residual in the stack - 11 (17)
FSTPR , //!< Loads a residual from the stack - 12 (18)
2009-10-16 18:34:27 +02:00
2019-12-20 16:59:30 +01:00
FSTPG , //!< Loads a derivative from the stack - 13 (19)
FSTPG2 , //!< Loads a derivative matrix for static model from the stack - 14 (20)
FSTPG3 , //!< Loads a derivative matrix for a dynamic model from the stack - 15 (21)
FSTPG4 , //!< Loads a second order derivative matrix for a dynamic model from the stack - 16 (22)
2008-02-03 11:28:36 +01:00
2019-12-20 16:59:30 +01:00
FUNARY , //!< A Unary operator - 17 (23)
FBINARY , //!< A binary operator - 18 (24)
FTRINARY , //!< A trinary operator - 19 (25)
2009-10-16 18:34:27 +02:00
2019-12-20 16:59:30 +01:00
FCUML , //!< Cumulates the result - 1A (26)
2009-10-16 18:34:27 +02:00
2019-12-20 16:59:30 +01:00
FJMPIFEVAL , //!< Jump if evaluate = true - 1B (27)
FJMP , //!< Jump - 1C (28)
2010-01-22 17:42:08 +01:00
2019-12-20 16:59:30 +01:00
FBEGINBLOCK , //!< Defines the begining of a model block - 1D (29)
FENDBLOCK , //!< Defines the end of a model block - 1E (30)
FENDEQU , //!< Defines the last equation of the block. For block that has to be solved, the derivatives appear just after this flag - 1F (31)
FEND , //!< Defines the end of the model code - 20 (32)
2010-07-23 11:20:24 +02:00
2019-12-20 16:59:30 +01:00
FOK , //!< Used for debugging purpose - 21 (33)
2010-07-23 11:20:24 +02:00
2019-12-20 16:59:30 +01:00
FNUMEXPR , //!< Store the expression type and references - 22 (34)
2010-12-10 11:50:27 +01:00
2019-12-20 16:59:30 +01:00
FCALL , //!< Call an external function - 23 (35)
FPUSH , //!< Push a double in the stack - 24 (36)
FPOP , //!< Pop a double from the stack - 25 (37)
FLDTEF , //!< Stores the result of an external function in the stack - 26 (38)
FSTPTEF , //!< Loads the result of an external function from the stack- 27 (39)
FLDTEFD , //!< Stores the result of an external function in the stack - 28 (40)
FSTPTEFD , //!< Loads the result of an external function from the stack- 29 (41)
FLDTEFDD , //!< Stores the result of an external function in the stack - 28 (42)
FSTPTEFDD //!< Loads the result of an external function from the stack- 29 (43)
2009-10-16 18:34:27 +02:00
2009-12-16 18:13:23 +01:00
} ;
2008-02-03 11:28:36 +01:00
2020-03-20 18:00:56 +01:00
enum class EquationType
2009-05-16 00:41:51 +02:00
{
2020-03-20 18:00:56 +01:00
unknown , //!< Unknown equation type
2020-04-24 18:59:50 +02:00
evaluate , //!< Simple evaluation, normalized variable on left-hand side (written as such by the user)
2020-05-20 11:49:32 +02:00
evaluateRenormalized , //!< Simple evaluation, normalized variable on left-hand side (normalization computed by the preprocessor)
2020-03-20 18:00:56 +01:00
solve //!< No simple evaluation of the equation, it has to be solved
2009-05-16 00:41:51 +02:00
} ;
2020-03-20 17:31:14 +01:00
enum class BlockSimulationType
2008-12-24 16:49:01 +01:00
{
2020-03-20 17:31:14 +01:00
unknown , //!< Unknown simulation type
evaluateForward , //!< Simple evaluation, normalized variable on left-hand side, forward
evaluateBackward , //!< Simple evaluation, normalized variable on left-hand side, backward
solveForwardSimple , //!< Block of one equation, newton solver needed, forward
solveBackwardSimple , //!< Block of one equation, newton solver needed, backward
2020-04-24 18:59:50 +02:00
solveTwoBoundariesSimple , //!< Block of one equation, Newton solver needed, forward and backward
solveForwardComplete , //!< Block of several equations, Newton solver needed, forward
solveBackwardComplete , //!< Block of several equations, Newton solver needed, backward
solveTwoBoundariesComplete //!< Block of several equations, Newton solver needed, forward and backwar
2008-12-24 16:49:01 +01:00
} ;
2008-02-03 11:28:36 +01:00
//! Enumeration of possible symbol types
2009-02-27 13:19:25 +01:00
/*! Warning: do not to change existing values for 0 to 4: the values matter for homotopy_setup command */
2018-07-17 18:34:07 +02:00
enum class SymbolType
2008-02-03 11:28:36 +01:00
{
2019-12-20 16:59:30 +01:00
endogenous = 0 , //!< Endogenous
exogenous = 1 , //!< Exogenous
exogenousDet = 2 , //!< Exogenous deterministic
parameter = 4 , //!< Parameter
modelLocalVariable = 10 , //!< Local variable whose scope is model (pound expression)
modFileLocalVariable = 11 , //!< Local variable whose scope is mod file (model excluded)
externalFunction = 12 , //!< External (user-defined) function
trend = 13 , //!< Trend variable
statementDeclaredVariable = 14 , //!< Local variable assigned within a Statement (see subsample statement for example)
logTrend = 15 , //!< Log-trend variable
unusedEndogenous = 16 , //!< Type to mark unused endogenous variables when `nostrict` option is passed
endogenousVAR = 17 , //!< Variables declared in a var_model statement
epilogue = 18 , //!< Variables created in epilogue block
excludedVariable = 19 //!< Type to use when an equation is excluded via include/exclude_eqs and the LHS variable is not used elsewhere in the model
2008-02-03 11:28:36 +01:00
} ;
2021-02-01 11:10:59 +01:00
enum class ExpressionType
2010-01-22 17:42:08 +01:00
{
2019-12-20 16:59:30 +01:00
TemporaryTerm ,
ModelEquation ,
FirstEndoDerivative ,
FirstOtherEndoDerivative ,
FirstExoDerivative ,
FirstExodetDerivative ,
FirstParamDerivative ,
SecondEndoDerivative ,
SecondExoDerivative ,
SecondExodetDerivative ,
SecondParamDerivative ,
ThirdEndoDerivative ,
ThirdExoDerivative ,
ThirdExodetDerivative ,
ThirdParamDerivative
2010-01-22 17:42:08 +01:00
} ;
2018-07-18 16:18:26 +02:00
enum class UnaryOpcode
2008-02-03 11:28:36 +01:00
{
2019-12-20 16:59:30 +01:00
uminus ,
exp ,
log ,
log10 ,
cos ,
sin ,
tan ,
acos ,
asin ,
atan ,
cosh ,
sinh ,
tanh ,
acosh ,
asinh ,
atanh ,
sqrt ,
cbrt ,
abs ,
sign ,
steadyState ,
steadyStateParamDeriv , // for the derivative of the STEADY_STATE operator w.r.t. to a parameter
steadyStateParam2ndDeriv , // for the 2nd derivative of the STEADY_STATE operator w.r.t. to a parameter
expectation ,
erf ,
diff ,
adl
2008-02-03 11:28:36 +01:00
} ;
2008-10-17 12:11:54 +02:00
2018-07-18 16:18:26 +02:00
enum class BinaryOpcode
2008-02-03 11:28:36 +01:00
{
2019-12-20 16:59:30 +01:00
plus ,
minus ,
times ,
divide ,
power ,
powerDeriv , // for the derivative of the power function (see trac ticket #78)
equal ,
max ,
min ,
less ,
greater ,
lessEqual ,
greaterEqual ,
equalEqual ,
different
2008-02-03 11:28:36 +01:00
} ;
2018-07-18 16:18:26 +02:00
enum class TrinaryOpcode
2009-04-14 16:39:53 +02:00
{
2019-12-20 16:59:30 +01:00
normcdf ,
normpdf
2009-04-14 16:39:53 +02:00
} ;
2018-07-18 16:56:55 +02:00
enum class ExternalFunctionType
2017-06-01 19:58:32 +02:00
{
2019-12-20 16:59:30 +01:00
withoutDerivative ,
withFirstDerivative ,
withFirstAndSecondDerivative ,
numericalFirstDerivative ,
firstDerivative ,
numericalSecondDerivative ,
secondDerivative
2017-06-01 19:58:32 +02:00
} ;
2010-12-10 11:50:27 +01:00
2018-07-18 16:52:12 +02:00
enum class PriorDistributions
2011-12-29 18:43:21 +01:00
{
2019-12-20 16:59:30 +01:00
noShape = 0 ,
beta = 1 ,
gamma = 2 ,
normal = 3 ,
invGamma = 4 ,
invGamma1 = 4 ,
uniform = 5 ,
invGamma2 = 6 ,
dirichlet = 7 ,
weibull = 8
2011-12-29 18:43:21 +01:00
} ;
2009-12-16 18:13:23 +01:00
struct Block_contain_type
{
int Equation , Variable , Own_Derivative ;
} ;
2009-10-16 18:34:27 +02:00
2009-10-29 18:16:10 +01:00
# pragma pack(push, 1)
2009-10-16 18:34:27 +02:00
class TagWithoutArgument
{
protected :
uint8_t op_code ;
public :
2018-10-04 15:17:13 +02:00
inline explicit
2021-02-01 11:10:59 +01:00
TagWithoutArgument ( Tags op_code_arg ) : op_code { static_cast < uint8_t > ( op_code_arg ) }
2009-12-16 18:13:23 +01:00
{
} ;
inline void
2010-07-23 11:20:24 +02:00
write ( ostream & CompileCode , unsigned int & instruction_number )
2009-12-16 18:13:23 +01:00
{
CompileCode . write ( reinterpret_cast < char * > ( this ) , sizeof ( * this ) ) ;
2010-07-23 11:20:24 +02:00
instruction_number + + ;
2009-12-16 18:13:23 +01:00
} ;
2009-10-16 18:34:27 +02:00
} ;
2018-10-04 18:00:30 +02:00
template < typename T1 >
2009-10-16 18:34:27 +02:00
class TagWithOneArgument
{
protected :
uint8_t op_code ;
T1 arg1 ;
public :
2018-10-04 15:17:13 +02:00
inline explicit
2021-02-01 11:10:59 +01:00
TagWithOneArgument ( Tags op_code_arg ) : op_code { static_cast < uint8_t > ( op_code_arg ) }
2009-12-16 18:13:23 +01:00
{
} ;
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
TagWithOneArgument ( Tags op_code_arg , T1 arg_arg1 ) : op_code { static_cast < uint8_t > ( op_code_arg ) } ,
arg1 { arg_arg1 }
2009-12-16 18:13:23 +01:00
{
} ;
inline void
2010-07-23 11:20:24 +02:00
write ( ostream & CompileCode , unsigned int & instruction_number )
2009-12-16 18:13:23 +01:00
{
CompileCode . write ( reinterpret_cast < char * > ( this ) , sizeof ( TagWithOneArgument ) ) ;
2010-07-23 11:20:24 +02:00
instruction_number + + ;
2009-12-16 18:13:23 +01:00
} ;
2009-10-16 18:34:27 +02:00
} ;
2018-10-04 18:00:30 +02:00
template < typename T1 , typename T2 >
2009-10-16 18:34:27 +02:00
class TagWithTwoArguments
{
protected :
uint8_t op_code ;
T1 arg1 ;
T2 arg2 ;
public :
2018-10-04 15:17:13 +02:00
inline explicit
2021-02-01 11:10:59 +01:00
TagWithTwoArguments ( Tags op_code_arg ) : op_code { static_cast < uint8_t > ( op_code_arg ) }
2009-12-16 18:13:23 +01:00
{
} ;
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
TagWithTwoArguments ( Tags op_code_arg , T1 arg_arg1 , T2 arg_arg2 ) :
op_code { static_cast < uint8_t > ( op_code_arg ) } , arg1 { arg_arg1 } , arg2 { arg_arg2 }
2009-12-16 18:13:23 +01:00
{
} ;
inline void
2010-07-23 11:20:24 +02:00
write ( ostream & CompileCode , unsigned int & instruction_number )
2009-12-16 18:13:23 +01:00
{
CompileCode . write ( reinterpret_cast < char * > ( this ) , sizeof ( * this ) ) ;
2010-07-23 11:20:24 +02:00
instruction_number + + ;
2009-12-16 18:13:23 +01:00
} ;
2009-10-16 18:34:27 +02:00
} ;
2018-10-04 18:00:30 +02:00
template < typename T1 , typename T2 , typename T3 >
2009-10-16 18:34:27 +02:00
class TagWithThreeArguments
{
protected :
uint8_t op_code ;
T1 arg1 ;
T2 arg2 ;
T3 arg3 ;
public :
2018-10-04 15:17:13 +02:00
inline explicit
2021-02-01 11:10:59 +01:00
TagWithThreeArguments ( Tags op_code_arg ) : op_code { static_cast < uint8_t > ( op_code_arg ) }
2009-12-16 18:13:23 +01:00
{
} ;
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
TagWithThreeArguments ( Tags op_code_arg , T1 arg_arg1 , T2 arg_arg2 , T3 arg_arg3 ) :
op_code { static_cast < uint8_t > ( op_code_arg ) } , arg1 { arg_arg1 } , arg2 { arg_arg2 } , arg3 { arg_arg3 }
2009-12-16 18:13:23 +01:00
{
} ;
inline void
2010-07-23 11:20:24 +02:00
write ( ostream & CompileCode , unsigned int & instruction_number )
2009-12-16 18:13:23 +01:00
{
CompileCode . write ( reinterpret_cast < char * > ( this ) , sizeof ( * this ) ) ;
2010-07-23 11:20:24 +02:00
instruction_number + + ;
2009-12-16 18:13:23 +01:00
} ;
2009-10-16 18:34:27 +02:00
} ;
2018-10-04 18:00:30 +02:00
template < typename T1 , typename T2 , typename T3 , typename T4 >
2010-07-23 11:20:24 +02:00
class TagWithFourArguments
{
protected :
uint8_t op_code ;
T1 arg1 ;
T2 arg2 ;
T3 arg3 ;
T4 arg4 ;
public :
2018-10-04 15:17:13 +02:00
inline explicit
2021-02-01 11:10:59 +01:00
TagWithFourArguments ( Tags op_code_arg ) : op_code { static_cast < uint8_t > ( op_code_arg ) }
2010-07-23 11:20:24 +02:00
{
} ;
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
TagWithFourArguments ( Tags op_code_arg , T1 arg_arg1 , T2 arg_arg2 , T3 arg_arg3 , T4 arg_arg4 ) :
op_code { static_cast < uint8_t > ( op_code_arg ) } , arg1 { arg_arg1 } , arg2 { arg_arg2 } ,
arg3 { move ( arg_arg3 ) } , arg4 { arg_arg4 }
2010-07-23 11:20:24 +02:00
{
} ;
inline void
write ( ostream & CompileCode , unsigned int & instruction_number )
{
CompileCode . write ( reinterpret_cast < char * > ( this ) , sizeof ( * this ) ) ;
instruction_number + + ;
} ;
} ;
2009-10-16 18:34:27 +02:00
class FLDZ_ : public TagWithoutArgument
{
public :
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FLDZ_ ( ) : TagWithoutArgument { Tags : : FLDZ }
2009-12-16 18:13:23 +01:00
{
} ;
2009-10-16 18:34:27 +02:00
} ;
class FEND_ : public TagWithoutArgument
{
public :
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FEND_ ( ) : TagWithoutArgument { Tags : : FEND }
2009-12-16 18:13:23 +01:00
{
} ;
2009-10-16 18:34:27 +02:00
} ;
class FENDBLOCK_ : public TagWithoutArgument
{
public :
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FENDBLOCK_ ( ) : TagWithoutArgument { Tags : : FENDBLOCK }
2009-12-16 18:13:23 +01:00
{
} ;
2009-10-16 18:34:27 +02:00
} ;
class FENDEQU_ : public TagWithoutArgument
{
public :
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FENDEQU_ ( ) : TagWithoutArgument { Tags : : FENDEQU }
2009-12-16 18:13:23 +01:00
{
} ;
2009-10-16 18:34:27 +02:00
} ;
class FCUML_ : public TagWithoutArgument
{
public :
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FCUML_ ( ) : TagWithoutArgument { Tags : : FCUML }
2009-12-16 18:13:23 +01:00
{
} ;
2009-10-16 18:34:27 +02:00
} ;
2010-12-10 11:50:27 +01:00
class FPUSH_ : public TagWithoutArgument
{
public :
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FPUSH_ ( ) : TagWithoutArgument { Tags : : FPUSH }
2010-12-10 11:50:27 +01:00
{
} ;
} ;
class FPOP_ : public TagWithoutArgument
{
public :
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FPOP_ ( ) : TagWithoutArgument { Tags : : FPOP }
2010-12-10 11:50:27 +01:00
{
} ;
} ;
2009-10-16 18:34:27 +02:00
class FDIMT_ : public TagWithOneArgument < unsigned int >
{
public :
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FDIMT_ ( ) : TagWithOneArgument < unsigned int > : : TagWithOneArgument { Tags : : FDIMT }
2009-12-16 18:13:23 +01:00
{
} ;
2018-10-04 15:17:13 +02:00
inline explicit
2021-02-01 11:10:59 +01:00
FDIMT_ ( unsigned int size_arg ) : TagWithOneArgument < unsigned int > : : TagWithOneArgument { Tags : : FDIMT , size_arg }
2009-12-16 18:13:23 +01:00
{
} ;
inline unsigned int
get_size ( )
{
return arg1 ;
} ;
2009-10-16 18:34:27 +02:00
} ;
class FDIMST_ : public TagWithOneArgument < unsigned int >
{
public :
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FDIMST_ ( ) : TagWithOneArgument < unsigned int > : : TagWithOneArgument { Tags : : FDIMST }
2009-12-16 18:13:23 +01:00
{
} ;
2018-10-04 15:17:13 +02:00
inline explicit
2021-02-01 11:10:59 +01:00
FDIMST_ ( const unsigned int size_arg ) : TagWithOneArgument < unsigned int > : : TagWithOneArgument { Tags : : FDIMST , size_arg }
2009-12-16 18:13:23 +01:00
{
} ;
inline unsigned int
get_size ( )
{
return arg1 ;
} ;
2009-10-16 18:34:27 +02:00
} ;
class FLDC_ : public TagWithOneArgument < double >
{
public :
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FLDC_ ( ) : TagWithOneArgument < double > : : TagWithOneArgument { Tags : : FLDC }
2009-12-16 18:13:23 +01:00
{
} ;
2018-10-04 15:17:13 +02:00
inline explicit
2021-02-01 11:10:59 +01:00
FLDC_ ( double value_arg ) : TagWithOneArgument < double > : : TagWithOneArgument { Tags : : FLDC , value_arg }
2009-12-16 18:13:23 +01:00
{
} ;
inline double
get_value ( )
{
return arg1 ;
} ;
2009-10-16 18:34:27 +02:00
} ;
class FLDU_ : public TagWithOneArgument < unsigned int >
{
public :
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FLDU_ ( ) : TagWithOneArgument < unsigned int > : : TagWithOneArgument { Tags : : FLDU }
2009-12-16 18:13:23 +01:00
{
} ;
2018-10-04 15:17:13 +02:00
inline explicit
2021-02-01 11:10:59 +01:00
FLDU_ ( unsigned int pos_arg ) : TagWithOneArgument < unsigned int > : : TagWithOneArgument { Tags : : FLDU , pos_arg }
2009-12-16 18:13:23 +01:00
{
} ;
inline unsigned int
get_pos ( )
{
return arg1 ;
} ;
2009-10-16 18:34:27 +02:00
} ;
class FLDSU_ : public TagWithOneArgument < unsigned int >
{
public :
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FLDSU_ ( ) : TagWithOneArgument < unsigned int > : : TagWithOneArgument { Tags : : FLDSU }
2009-12-16 18:13:23 +01:00
{
} ;
2018-10-04 15:17:13 +02:00
inline explicit
2021-02-01 11:10:59 +01:00
FLDSU_ ( unsigned int pos_arg ) : TagWithOneArgument < unsigned int > : : TagWithOneArgument { Tags : : FLDSU , pos_arg }
2009-12-16 18:13:23 +01:00
{
} ;
inline unsigned int
get_pos ( )
{
return arg1 ;
} ;
2009-10-16 18:34:27 +02:00
} ;
class FLDR_ : public TagWithOneArgument < unsigned int >
{
public :
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FLDR_ ( ) : TagWithOneArgument < unsigned int > : : TagWithOneArgument { Tags : : FLDR }
2009-12-16 18:13:23 +01:00
{
} ;
2018-10-04 15:17:13 +02:00
inline explicit
2021-02-01 11:10:59 +01:00
FLDR_ ( unsigned int pos_arg ) : TagWithOneArgument < unsigned int > : : TagWithOneArgument { Tags : : FLDR , pos_arg }
2009-12-16 18:13:23 +01:00
{
} ;
inline unsigned int
get_pos ( )
{
return arg1 ;
} ;
2009-10-16 18:34:27 +02:00
} ;
class FLDT_ : public TagWithOneArgument < unsigned int >
{
public :
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FLDT_ ( ) : TagWithOneArgument < unsigned int > : : TagWithOneArgument { Tags : : FLDT }
2009-12-16 18:13:23 +01:00
{
} ;
2018-10-04 15:17:13 +02:00
inline explicit
2021-02-01 11:10:59 +01:00
FLDT_ ( unsigned int pos_arg ) : TagWithOneArgument < unsigned int > : : TagWithOneArgument { Tags : : FLDT , pos_arg }
2009-12-16 18:13:23 +01:00
{
} ;
inline unsigned int
get_pos ( )
{
return arg1 ;
} ;
2009-10-16 18:34:27 +02:00
} ;
class FLDST_ : public TagWithOneArgument < unsigned int >
{
public :
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FLDST_ ( ) : TagWithOneArgument < unsigned int > : : TagWithOneArgument { Tags : : FLDST }
2009-12-16 18:13:23 +01:00
{
} ;
2018-10-04 15:17:13 +02:00
inline explicit
2021-02-01 11:10:59 +01:00
FLDST_ ( unsigned int pos_arg ) : TagWithOneArgument < unsigned int > : : TagWithOneArgument { Tags : : FLDST , pos_arg }
2009-12-16 18:13:23 +01:00
{
} ;
inline unsigned int
get_pos ( )
{
return arg1 ;
} ;
2009-10-16 18:34:27 +02:00
} ;
class FSTPT_ : public TagWithOneArgument < unsigned int >
{
public :
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FSTPT_ ( ) : TagWithOneArgument < unsigned int > : : TagWithOneArgument { Tags : : FSTPT }
2009-12-16 18:13:23 +01:00
{
} ;
2018-10-04 15:17:13 +02:00
inline explicit
2021-02-01 11:10:59 +01:00
FSTPT_ ( unsigned int pos_arg ) : TagWithOneArgument < unsigned int > : : TagWithOneArgument { Tags : : FSTPT , pos_arg }
2009-12-16 18:13:23 +01:00
{
} ;
inline unsigned int
get_pos ( )
{
return arg1 ;
} ;
2009-10-16 18:34:27 +02:00
} ;
class FSTPST_ : public TagWithOneArgument < unsigned int >
{
public :
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FSTPST_ ( ) : TagWithOneArgument < unsigned int > : : TagWithOneArgument { Tags : : FSTPST }
2009-12-16 18:13:23 +01:00
{
} ;
2018-10-04 15:17:13 +02:00
inline explicit
2021-02-01 11:10:59 +01:00
FSTPST_ ( unsigned int pos_arg ) : TagWithOneArgument < unsigned int > : : TagWithOneArgument { Tags : : FSTPST , pos_arg }
2009-12-16 18:13:23 +01:00
{
} ;
inline unsigned int
get_pos ( )
{
return arg1 ;
} ;
2009-10-16 18:34:27 +02:00
} ;
class FSTPR_ : public TagWithOneArgument < unsigned int >
{
public :
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FSTPR_ ( ) : TagWithOneArgument < unsigned int > : : TagWithOneArgument { Tags : : FSTPR }
2009-12-16 18:13:23 +01:00
{
} ;
2018-10-04 15:17:13 +02:00
inline explicit
2021-02-01 11:10:59 +01:00
FSTPR_ ( unsigned int pos_arg ) : TagWithOneArgument < unsigned int > : : TagWithOneArgument { Tags : : FSTPR , pos_arg }
2009-12-16 18:13:23 +01:00
{
} ;
inline unsigned int
get_pos ( )
{
return arg1 ;
} ;
2009-10-16 18:34:27 +02:00
} ;
class FSTPU_ : public TagWithOneArgument < unsigned int >
{
public :
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FSTPU_ ( ) : TagWithOneArgument < unsigned int > : : TagWithOneArgument { Tags : : FSTPU }
2009-12-16 18:13:23 +01:00
{
} ;
2018-10-04 15:17:13 +02:00
inline explicit
2021-02-01 11:10:59 +01:00
FSTPU_ ( unsigned int pos_arg ) : TagWithOneArgument < unsigned int > : : TagWithOneArgument { Tags : : FSTPU , pos_arg }
2009-12-16 18:13:23 +01:00
{
} ;
inline unsigned int
get_pos ( )
{
return arg1 ;
} ;
2009-10-16 18:34:27 +02:00
} ;
class FSTPSU_ : public TagWithOneArgument < unsigned int >
{
public :
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FSTPSU_ ( ) : TagWithOneArgument < unsigned int > : : TagWithOneArgument { Tags : : FSTPSU }
2009-12-16 18:13:23 +01:00
{
} ;
2018-10-04 15:17:13 +02:00
inline explicit
2021-02-01 11:10:59 +01:00
FSTPSU_ ( unsigned int pos_arg ) : TagWithOneArgument < unsigned int > : : TagWithOneArgument { Tags : : FSTPSU , pos_arg }
2009-12-16 18:13:23 +01:00
{
} ;
inline unsigned int
get_pos ( )
{
return arg1 ;
} ;
2009-10-16 18:34:27 +02:00
} ;
class FSTPG_ : public TagWithOneArgument < unsigned int >
{
public :
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FSTPG_ ( ) : TagWithOneArgument < unsigned int > : : TagWithOneArgument { Tags : : FSTPG , 0 }
2009-12-16 18:13:23 +01:00
{
} ;
2018-10-04 15:17:13 +02:00
inline explicit
2021-02-01 11:10:59 +01:00
FSTPG_ ( unsigned int pos_arg ) : TagWithOneArgument < unsigned int > : : TagWithOneArgument { Tags : : FSTPG , pos_arg }
2009-12-16 18:13:23 +01:00
{
} ;
inline unsigned int
get_pos ( )
{
return arg1 ;
} ;
2009-10-16 18:34:27 +02:00
} ;
2010-01-22 11:03:29 +01:00
class FSTPG2_ : public TagWithTwoArguments < unsigned int , unsigned int >
{
public :
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FSTPG2_ ( ) : TagWithTwoArguments < unsigned int , unsigned int > : : TagWithTwoArguments { Tags : : FSTPG2 , 0 , 0 }
2010-01-22 11:03:29 +01:00
{
} ;
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FSTPG2_ ( unsigned int pos_arg1 , unsigned int pos_arg2 ) : TagWithTwoArguments < unsigned int , unsigned int > : : TagWithTwoArguments { Tags : : FSTPG2 , pos_arg1 , pos_arg2 }
2010-01-22 11:03:29 +01:00
{
} ;
inline unsigned int
get_row ( )
{
return arg1 ;
} ;
inline unsigned int
get_col ( )
{
return arg2 ;
} ;
} ;
2010-07-23 11:20:24 +02:00
class FSTPG3_ : public TagWithFourArguments < unsigned int , unsigned int , int , unsigned int >
{
public :
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FSTPG3_ ( ) : TagWithFourArguments < unsigned int , unsigned int , int , unsigned int > : : TagWithFourArguments { Tags : : FSTPG3 , 0 , 0 , 0 , 0 }
2010-07-23 11:20:24 +02:00
{
} ;
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FSTPG3_ ( unsigned int pos_arg1 , unsigned int pos_arg2 , int pos_arg3 , unsigned int pos_arg4 ) : TagWithFourArguments < unsigned int , unsigned int , int , unsigned int > : : TagWithFourArguments { Tags : : FSTPG3 , pos_arg1 , pos_arg2 , pos_arg3 , pos_arg4 }
2010-07-23 11:20:24 +02:00
{
} ;
inline unsigned int
get_row ( )
{
return arg1 ;
} ;
inline unsigned int
get_col ( )
{
return arg2 ;
} ;
inline int
get_lag ( )
{
return arg2 ;
} ;
inline unsigned int
get_col_pos ( )
{
return arg4 ;
} ;
} ;
2010-01-22 11:03:29 +01:00
2009-10-16 18:34:27 +02:00
class FUNARY_ : public TagWithOneArgument < uint8_t >
{
public :
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FUNARY_ ( ) : TagWithOneArgument < uint8_t > : : TagWithOneArgument { Tags : : FUNARY }
2009-12-16 18:13:23 +01:00
{
} ;
2018-10-04 15:17:13 +02:00
inline explicit
2021-02-01 11:10:59 +01:00
FUNARY_ ( uint8_t op_type_arg ) : TagWithOneArgument < uint8_t > : : TagWithOneArgument { Tags : : FUNARY , op_type_arg }
2009-12-16 18:13:23 +01:00
{
} ;
inline uint8_t
get_op_type ( )
{
return arg1 ;
} ;
2009-10-16 18:34:27 +02:00
} ;
class FBINARY_ : public TagWithOneArgument < uint8_t >
{
public :
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FBINARY_ ( ) : TagWithOneArgument < uint8_t > : : TagWithOneArgument { Tags : : FBINARY }
2009-12-16 18:13:23 +01:00
{
} ;
2018-10-04 15:17:13 +02:00
inline explicit
2021-02-01 11:10:59 +01:00
FBINARY_ ( int op_type_arg ) : TagWithOneArgument < uint8_t > : : TagWithOneArgument { Tags : : FBINARY , static_cast < uint8_t > ( op_type_arg ) }
2009-12-16 18:13:23 +01:00
{
} ;
inline uint8_t
get_op_type ( )
{
return arg1 ;
} ;
2009-10-16 18:34:27 +02:00
} ;
2010-04-16 16:54:55 +02:00
class FTRINARY_ : public TagWithOneArgument < uint8_t >
{
public :
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FTRINARY_ ( ) : TagWithOneArgument < uint8_t > : : TagWithOneArgument { Tags : : FTRINARY }
2010-04-16 16:54:55 +02:00
{
} ;
2018-10-04 15:17:13 +02:00
inline explicit
2021-02-01 11:10:59 +01:00
FTRINARY_ ( int op_type_arg ) : TagWithOneArgument < uint8_t > : : TagWithOneArgument { Tags : : FTRINARY , static_cast < uint8_t > ( op_type_arg ) }
2010-04-16 16:54:55 +02:00
{
} ;
inline uint8_t
get_op_type ( )
{
return arg1 ;
} ;
} ;
2009-10-16 18:34:27 +02:00
class FOK_ : public TagWithOneArgument < int >
{
public :
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FOK_ ( ) : TagWithOneArgument < int > : : TagWithOneArgument { Tags : : FOK }
2009-12-16 18:13:23 +01:00
{
} ;
2018-10-04 15:17:13 +02:00
inline explicit
2021-02-01 11:10:59 +01:00
FOK_ ( int arg_arg ) : TagWithOneArgument < int > : : TagWithOneArgument { Tags : : FOK , arg_arg }
2009-12-16 18:13:23 +01:00
{
} ;
inline int
get_arg ( )
{
return arg1 ;
} ;
2009-10-16 18:34:27 +02:00
} ;
2010-07-23 11:20:24 +02:00
class FJMPIFEVAL_ : public TagWithOneArgument < unsigned int >
{
public :
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FJMPIFEVAL_ ( ) : TagWithOneArgument < unsigned int > : : TagWithOneArgument { Tags : : FJMPIFEVAL }
2010-07-23 11:20:24 +02:00
{
} ;
2018-10-04 15:17:13 +02:00
inline explicit
2021-02-01 11:10:59 +01:00
FJMPIFEVAL_ ( unsigned int arg_pos ) : TagWithOneArgument < unsigned int > : : TagWithOneArgument { Tags : : FJMPIFEVAL , arg_pos }
2010-07-23 11:20:24 +02:00
{
} ;
inline unsigned int
get_pos ( )
{
return arg1 ;
}
} ;
class FJMP_ : public TagWithOneArgument < unsigned int >
{
public :
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FJMP_ ( ) : TagWithOneArgument < unsigned int > : : TagWithOneArgument { Tags : : FJMP }
2010-07-23 11:20:24 +02:00
{
} ;
2018-10-04 15:17:13 +02:00
inline explicit
2021-02-01 11:10:59 +01:00
FJMP_ ( unsigned int arg_pos ) : TagWithOneArgument < unsigned int > : : TagWithOneArgument { Tags : : FJMP , arg_pos }
2010-07-23 11:20:24 +02:00
{
} ;
inline unsigned int
get_pos ( )
{
return arg1 ;
}
} ;
2010-12-10 11:50:27 +01:00
class FLDTEF_ : public TagWithOneArgument < unsigned int >
{
public :
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FLDTEF_ ( ) : TagWithOneArgument < unsigned int > : : TagWithOneArgument { Tags : : FLDTEF }
2010-12-10 11:50:27 +01:00
{
} ;
2018-10-04 15:17:13 +02:00
inline explicit
2021-02-01 11:10:59 +01:00
FLDTEF_ ( unsigned int number ) : TagWithOneArgument < unsigned int > : : TagWithOneArgument { Tags : : FLDTEF , number }
2010-12-10 11:50:27 +01:00
{
} ;
inline unsigned int
get_number ( )
{
return arg1 ;
}
} ;
class FSTPTEF_ : public TagWithOneArgument < unsigned int >
{
public :
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FSTPTEF_ ( ) : TagWithOneArgument < unsigned int > : : TagWithOneArgument { Tags : : FSTPTEF }
2010-12-10 11:50:27 +01:00
{
} ;
2018-10-04 15:17:13 +02:00
inline explicit
2021-02-01 11:10:59 +01:00
FSTPTEF_ ( unsigned int number ) : TagWithOneArgument < unsigned int > : : TagWithOneArgument { Tags : : FSTPTEF , number }
2010-12-10 11:50:27 +01:00
{
} ;
inline unsigned int
get_number ( )
{
return arg1 ;
}
} ;
class FLDTEFD_ : public TagWithTwoArguments < unsigned int , unsigned int >
{
public :
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FLDTEFD_ ( ) : TagWithTwoArguments < unsigned int , unsigned int > : : TagWithTwoArguments { Tags : : FLDTEFD }
2010-12-10 11:50:27 +01:00
{
} ;
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FLDTEFD_ ( unsigned int indx , unsigned int row ) : TagWithTwoArguments < unsigned int , unsigned int > : : TagWithTwoArguments { Tags : : FLDTEFD , indx , row }
2010-12-10 11:50:27 +01:00
{
} ;
inline unsigned int
get_indx ( )
{
return arg1 ;
} ;
inline unsigned int
get_row ( )
{
return arg2 ;
} ;
} ;
class FSTPTEFD_ : public TagWithTwoArguments < unsigned int , unsigned int >
{
public :
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FSTPTEFD_ ( ) : TagWithTwoArguments < unsigned int , unsigned int > : : TagWithTwoArguments { Tags : : FSTPTEFD }
2010-12-10 11:50:27 +01:00
{
} ;
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FSTPTEFD_ ( unsigned int indx , unsigned int row ) : TagWithTwoArguments < unsigned int , unsigned int > : : TagWithTwoArguments { Tags : : FSTPTEFD , indx , row }
2010-12-10 11:50:27 +01:00
{
} ;
inline unsigned int
get_indx ( )
{
return arg1 ;
} ;
inline unsigned int
get_row ( )
{
return arg2 ;
} ;
} ;
class FLDTEFDD_ : public TagWithThreeArguments < unsigned int , unsigned int , unsigned int >
{
public :
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FLDTEFDD_ ( ) : TagWithThreeArguments < unsigned int , unsigned int , unsigned int > : : TagWithThreeArguments { Tags : : FLDTEFDD }
2010-12-10 11:50:27 +01:00
{
} ;
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FLDTEFDD_ ( unsigned int indx , unsigned int row , unsigned int col ) : TagWithThreeArguments < unsigned int , unsigned int , unsigned int > : : TagWithThreeArguments { Tags : : FLDTEFDD , indx , row , col }
2010-12-10 11:50:27 +01:00
{
} ;
inline unsigned int
get_indx ( )
{
return arg1 ;
} ;
inline unsigned int
get_row ( )
{
return arg2 ;
} ;
inline unsigned int
get_col ( )
{
return arg3 ;
} ;
} ;
class FSTPTEFDD_ : public TagWithThreeArguments < unsigned int , unsigned int , unsigned int >
{
public :
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FSTPTEFDD_ ( ) : TagWithThreeArguments < unsigned int , unsigned int , unsigned int > : : TagWithThreeArguments { Tags : : FSTPTEFDD }
2010-12-10 11:50:27 +01:00
{
} ;
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FSTPTEFDD_ ( unsigned int indx , unsigned int row , unsigned int col ) : TagWithThreeArguments < unsigned int , unsigned int , unsigned int > : : TagWithThreeArguments { Tags : : FSTPTEF , indx , row , col }
2010-12-10 11:50:27 +01:00
{
} ;
inline unsigned int
get_indx ( )
{
return arg1 ;
} ;
inline unsigned int
get_row ( )
{
return arg2 ;
} ;
inline unsigned int
get_col ( )
{
return arg3 ;
} ;
} ;
2009-10-16 18:34:27 +02:00
class FLDVS_ : public TagWithTwoArguments < uint8_t , unsigned int >
{
public :
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FLDVS_ ( ) : TagWithTwoArguments < uint8_t , unsigned int > : : TagWithTwoArguments { Tags : : FLDVS }
2009-12-16 18:13:23 +01:00
{
} ;
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FLDVS_ ( uint8_t type_arg , unsigned int pos_arg ) : TagWithTwoArguments < uint8_t , unsigned int > : : TagWithTwoArguments { Tags : : FLDVS , type_arg , pos_arg }
2009-12-16 18:13:23 +01:00
{
} ;
inline uint8_t
get_type ( )
{
return arg1 ;
} ;
inline unsigned int
get_pos ( )
{
return arg2 ;
} ;
2009-10-16 18:34:27 +02:00
} ;
class FLDSV_ : public TagWithTwoArguments < uint8_t , unsigned int >
{
public :
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FLDSV_ ( ) : TagWithTwoArguments < uint8_t , unsigned int > : : TagWithTwoArguments { Tags : : FLDSV }
2009-12-16 18:13:23 +01:00
{
} ;
2011-02-04 16:25:38 +01:00
inline
2019-12-16 19:42:59 +01:00
FLDSV_ ( uint8_t type_arg , unsigned int pos_arg ) :
2021-02-01 11:10:59 +01:00
TagWithTwoArguments < uint8_t , unsigned int > : : TagWithTwoArguments { Tags : : FLDSV , type_arg , pos_arg }
2009-12-16 18:13:23 +01:00
{
} ;
inline uint8_t
get_type ( )
{
return arg1 ;
} ;
inline unsigned int
get_pos ( )
{
return arg2 ;
} ;
2009-10-16 18:34:27 +02:00
} ;
class FSTPSV_ : public TagWithTwoArguments < uint8_t , unsigned int >
{
public :
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FSTPSV_ ( ) : TagWithTwoArguments < uint8_t , unsigned int > : : TagWithTwoArguments { Tags : : FSTPSV }
2009-12-16 18:13:23 +01:00
{
} ;
2011-02-04 16:25:38 +01:00
inline
2019-12-16 19:42:59 +01:00
FSTPSV_ ( uint8_t type_arg , unsigned int pos_arg ) :
2021-02-01 11:10:59 +01:00
TagWithTwoArguments < uint8_t , unsigned int > : : TagWithTwoArguments { Tags : : FSTPSV , type_arg , pos_arg }
2009-12-16 18:13:23 +01:00
{
} ;
inline uint8_t
get_type ( )
{
return arg1 ;
} ;
inline unsigned int
get_pos ( )
{
return arg2 ;
} ;
2009-10-16 18:34:27 +02:00
} ;
class FLDV_ : public TagWithThreeArguments < uint8_t , unsigned int , int >
{
public :
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FLDV_ ( ) : TagWithThreeArguments < uint8_t , unsigned int , int > : : TagWithThreeArguments { Tags : : FLDV }
2009-12-16 18:13:23 +01:00
{
} ;
2011-02-04 16:25:38 +01:00
inline
2019-12-16 19:42:59 +01:00
FLDV_ ( int type_arg , unsigned int pos_arg ) :
2021-02-01 11:10:59 +01:00
TagWithThreeArguments < uint8_t , unsigned int , int > : : TagWithThreeArguments { Tags : : FLDV , static_cast < uint8_t > ( type_arg ) , pos_arg , 0 }
2009-12-16 18:13:23 +01:00
{
} ;
2011-02-04 16:25:38 +01:00
inline
2019-12-16 19:42:59 +01:00
FLDV_ ( int type_arg , unsigned int pos_arg , int lead_lag_arg ) :
2021-02-01 11:10:59 +01:00
TagWithThreeArguments < uint8_t , unsigned int , int > : : TagWithThreeArguments { Tags : : FLDV , static_cast < uint8_t > ( type_arg ) , pos_arg , lead_lag_arg }
2009-12-16 18:13:23 +01:00
{
} ;
inline uint8_t
get_type ( )
{
return arg1 ;
} ;
inline unsigned int
get_pos ( )
{
return arg2 ;
} ;
inline int
get_lead_lag ( )
{
return arg3 ;
} ;
2009-10-16 18:34:27 +02:00
} ;
class FSTPV_ : public TagWithThreeArguments < uint8_t , unsigned int , int >
{
public :
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FSTPV_ ( ) : TagWithThreeArguments < uint8_t , unsigned int , int > : : TagWithThreeArguments { Tags : : FSTPV }
2009-12-16 18:13:23 +01:00
{
} ;
2011-02-04 16:25:38 +01:00
inline
2019-12-16 19:42:59 +01:00
FSTPV_ ( int type_arg , unsigned int pos_arg ) :
2021-02-01 11:10:59 +01:00
TagWithThreeArguments < uint8_t , unsigned int , int > : : TagWithThreeArguments { Tags : : FSTPV , static_cast < uint8_t > ( type_arg ) , pos_arg , 0 }
2009-12-16 18:13:23 +01:00
{
} ;
2011-02-04 16:25:38 +01:00
inline
2019-12-16 19:42:59 +01:00
FSTPV_ ( int type_arg , unsigned int pos_arg , int lead_lag_arg ) :
2021-02-01 11:10:59 +01:00
TagWithThreeArguments < uint8_t , unsigned int , int > : : TagWithThreeArguments { Tags : : FSTPV , static_cast < uint8_t > ( type_arg ) , pos_arg , lead_lag_arg }
2009-12-16 18:13:23 +01:00
{
} ;
inline uint8_t
get_type ( )
{
return arg1 ;
} ;
inline unsigned int
get_pos ( )
{
return arg2 ;
} ;
inline int
get_lead_lag ( )
{
return arg3 ;
} ;
2009-10-16 18:34:27 +02:00
} ;
2010-12-10 11:50:27 +01:00
class FCALL_ : public TagWithFourArguments < unsigned int , unsigned int , string , unsigned int >
{
string func_name ;
string arg_func_name ;
2021-02-01 12:44:24 +01:00
unsigned int add_input_arguments { 0 } , row { 0 } , col { 0 } ;
ExternalFunctionType function_type { ExternalFunctionType : : withoutDerivative } ;
2010-12-10 11:50:27 +01:00
public :
2011-02-04 16:25:38 +01:00
inline
2021-02-01 12:44:24 +01:00
FCALL_ ( ) : TagWithFourArguments < unsigned int , unsigned int , string , unsigned int > : : TagWithFourArguments { Tags : : FCALL }
2010-12-10 11:50:27 +01:00
{
} ;
2011-02-04 16:25:38 +01:00
inline
FCALL_ ( unsigned int nb_output_arguments , unsigned int nb_input_arguments , string f_name , unsigned int indx ) :
2021-02-01 11:10:59 +01:00
TagWithFourArguments < unsigned int , unsigned int , string , unsigned int > : : TagWithFourArguments { Tags : : FCALL , nb_output_arguments , nb_input_arguments , f_name , indx } ,
2021-02-01 12:44:24 +01:00
func_name { f_name }
2019-12-16 19:42:59 +01:00
{
2010-12-10 11:50:27 +01:00
} ;
inline string
get_function_name ( )
{
//printf("get_function_name => func_name=%s\n",func_name.c_str());fflush(stdout);
return func_name ;
} ;
inline unsigned int
get_nb_output_arguments ( )
{
return arg1 ;
} ;
inline unsigned int
get_nb_input_arguments ( )
{
return arg2 ;
} ;
inline unsigned int
get_indx ( )
{
return arg4 ;
} ;
inline void
set_arg_func_name ( string arg_arg_func_name )
{
arg_func_name = arg_arg_func_name ;
} ;
inline string
get_arg_func_name ( )
{
return arg_func_name ;
} ;
inline void
set_nb_add_input_arguments ( unsigned int arg_add_input_arguments )
{
add_input_arguments = arg_add_input_arguments ;
} ;
inline unsigned int
get_nb_add_input_arguments ( )
{
return add_input_arguments ;
} ;
inline void
set_row ( unsigned int arg_row )
{
row = arg_row ;
} ;
inline unsigned int
get_row ( )
{
return row ;
}
inline void
set_col ( unsigned int arg_col )
{
col = arg_col ;
} ;
inline unsigned int
get_col ( )
{
return col ;
} ;
inline void
2018-07-18 16:56:55 +02:00
set_function_type ( ExternalFunctionType arg_function_type )
2011-02-04 16:25:38 +01:00
{
function_type = arg_function_type ;
} ;
2018-07-18 16:56:55 +02:00
inline ExternalFunctionType
2010-12-10 11:50:27 +01:00
get_function_type ( )
2011-02-04 16:25:38 +01:00
{
return ( function_type ) ;
}
2010-12-10 11:50:27 +01:00
inline void
write ( ostream & CompileCode , unsigned int & instruction_number )
{
CompileCode . write ( reinterpret_cast < char * > ( & op_code ) , sizeof ( op_code ) ) ;
CompileCode . write ( reinterpret_cast < char * > ( & arg1 ) , sizeof ( arg1 ) ) ;
CompileCode . write ( reinterpret_cast < char * > ( & arg2 ) , sizeof ( arg2 ) ) ;
CompileCode . write ( reinterpret_cast < char * > ( & arg4 ) , sizeof ( arg4 ) ) ;
CompileCode . write ( reinterpret_cast < char * > ( & add_input_arguments ) , sizeof ( add_input_arguments ) ) ;
CompileCode . write ( reinterpret_cast < char * > ( & row ) , sizeof ( row ) ) ;
CompileCode . write ( reinterpret_cast < char * > ( & col ) , sizeof ( col ) ) ;
CompileCode . write ( reinterpret_cast < char * > ( & function_type ) , sizeof ( function_type ) ) ;
2013-03-22 15:48:47 +01:00
size_t size = func_name . size ( ) ;
2010-12-10 11:50:27 +01:00
CompileCode . write ( reinterpret_cast < char * > ( & size ) , sizeof ( int ) ) ;
const char * name = func_name . c_str ( ) ;
CompileCode . write ( reinterpret_cast < const char * > ( name ) , func_name . size ( ) ) ;
size = arg_func_name . size ( ) ;
CompileCode . write ( reinterpret_cast < char * > ( & size ) , sizeof ( int ) ) ;
name = arg_func_name . c_str ( ) ;
CompileCode . write ( reinterpret_cast < const char * > ( name ) , arg_func_name . size ( ) ) ;
instruction_number + + ;
} ;
# ifdef BYTE_CODE
inline uint8_t *
load ( uint8_t * code )
{
2021-02-01 11:10:59 +01:00
op_code = static_cast < uint8_t > ( Tags : : FCALL ) ; code + = sizeof ( op_code ) ;
2010-12-10 11:50:27 +01:00
memcpy ( & arg1 , code , sizeof ( arg1 ) ) ; code + = sizeof ( arg1 ) ;
memcpy ( & arg2 , code , sizeof ( arg2 ) ) ; code + = sizeof ( arg2 ) ;
memcpy ( & arg4 , code , sizeof ( arg4 ) ) ; code + = sizeof ( arg4 ) ;
memcpy ( & add_input_arguments , code , sizeof ( add_input_arguments ) ) ; code + = sizeof ( add_input_arguments ) ;
memcpy ( & row , code , sizeof ( row ) ) ; code + = sizeof ( row ) ;
memcpy ( & col , code , sizeof ( col ) ) ; code + = sizeof ( col ) ;
memcpy ( & function_type , code , sizeof ( function_type ) ) ; code + = sizeof ( function_type ) ;
int size ;
memcpy ( & size , code , sizeof ( size ) ) ; code + = sizeof ( size ) ;
2019-04-23 11:07:32 +02:00
char * name = static_cast < char * > ( mxMalloc ( ( size + 1 ) * sizeof ( char ) ) ) ;
2010-12-10 11:50:27 +01:00
memcpy ( name , code , size ) ; code + = size ;
2011-02-07 12:38:04 +01:00
name [ size ] = 0 ;
2010-12-10 11:50:27 +01:00
func_name = name ;
mxFree ( name ) ;
memcpy ( & size , code , sizeof ( size ) ) ; code + = sizeof ( size ) ;
2019-04-23 11:07:32 +02:00
name = static_cast < char * > ( mxMalloc ( ( size + 1 ) * sizeof ( char ) ) ) ;
2010-12-10 11:50:27 +01:00
memcpy ( name , code , size ) ; code + = size ;
2011-02-07 12:38:04 +01:00
name [ size ] = 0 ;
2010-12-10 11:50:27 +01:00
arg_func_name = name ;
mxFree ( name ) ;
return code ;
}
# endif
} ;
2010-01-22 17:42:08 +01:00
class FNUMEXPR_ : public TagWithOneArgument < ExpressionType >
{
private :
unsigned int equation ;
uint16_t dvariable1 , dvariable2 , dvariable3 ;
int8_t lag1 , lag2 , lag3 ;
public :
2011-02-04 16:25:38 +01:00
inline
2021-02-01 11:10:59 +01:00
FNUMEXPR_ ( ) : TagWithOneArgument < ExpressionType > : : TagWithOneArgument { Tags : : FNUMEXPR }
2010-01-22 17:42:08 +01:00
{
} ;
2011-02-04 16:25:38 +01:00
inline
2018-10-04 17:18:27 +02:00
FNUMEXPR_ ( const ExpressionType expression_type , unsigned int equation_arg ) :
2021-02-01 11:10:59 +01:00
TagWithOneArgument < ExpressionType > : : TagWithOneArgument { Tags : : FNUMEXPR , expression_type } ,
2018-10-04 17:18:27 +02:00
equation { equation_arg } ,
dvariable1 { 0 } , dvariable2 { 0 } , dvariable3 { 0 } ,
lag1 { 0 } , lag2 { 0 } , lag3 { 0 }
2010-01-22 17:42:08 +01:00
{
} ;
2011-02-04 16:25:38 +01:00
inline
2018-10-04 17:18:27 +02:00
FNUMEXPR_ ( const ExpressionType expression_type , unsigned int equation_arg , unsigned int dvariable1_arg ) :
2021-02-01 11:10:59 +01:00
TagWithOneArgument < ExpressionType > : : TagWithOneArgument { Tags : : FNUMEXPR , expression_type } ,
2018-10-04 17:18:27 +02:00
equation { equation_arg } ,
dvariable1 { static_cast < uint16_t > ( dvariable1_arg ) } , dvariable2 { 0 } , dvariable3 { 0 } ,
lag1 { 0 } , lag2 { 0 } , lag3 { 0 }
2010-01-22 17:42:08 +01:00
{
} ;
2011-02-04 16:25:38 +01:00
inline
2018-10-04 17:18:27 +02:00
FNUMEXPR_ ( const ExpressionType expression_type , unsigned int equation_arg , unsigned int dvariable1_arg , int lag1_arg ) :
2021-02-01 11:10:59 +01:00
TagWithOneArgument < ExpressionType > : : TagWithOneArgument { Tags : : FNUMEXPR , expression_type } ,
2018-10-04 17:18:27 +02:00
equation { equation_arg } ,
dvariable1 { static_cast < uint16_t > ( dvariable1_arg ) } , dvariable2 { 0 } , dvariable3 { 0 } ,
lag1 { static_cast < int8_t > ( lag1_arg ) } , lag2 { 0 } , lag3 { 0 }
2010-01-22 17:42:08 +01:00
{
} ;
2011-02-04 16:25:38 +01:00
inline
2018-10-04 17:18:27 +02:00
FNUMEXPR_ ( const ExpressionType expression_type , unsigned int equation_arg , unsigned int dvariable1_arg , unsigned int dvariable2_arg ) :
2021-02-01 11:10:59 +01:00
TagWithOneArgument < ExpressionType > : : TagWithOneArgument { Tags : : FNUMEXPR , expression_type } ,
2018-10-04 17:18:27 +02:00
equation { equation_arg } ,
dvariable1 { static_cast < uint16_t > ( dvariable1_arg ) } ,
dvariable2 { static_cast < uint16_t > ( dvariable2_arg ) } ,
dvariable3 { 0 } ,
lag1 { 0 } , lag2 { 0 } , lag3 { 0 }
2010-01-22 17:42:08 +01:00
{
} ;
2011-02-04 16:25:38 +01:00
inline
2018-10-04 17:18:27 +02:00
FNUMEXPR_ ( const ExpressionType expression_type , unsigned int equation_arg , unsigned int dvariable1_arg , int lag1_arg , unsigned int dvariable2_arg , int lag2_arg ) :
2021-02-01 11:10:59 +01:00
TagWithOneArgument < ExpressionType > : : TagWithOneArgument { Tags : : FNUMEXPR , expression_type } ,
2018-10-04 17:18:27 +02:00
equation { equation_arg } ,
dvariable1 { static_cast < uint16_t > ( dvariable1_arg ) } ,
dvariable2 { static_cast < uint16_t > ( dvariable2_arg ) } ,
dvariable3 { 0 } ,
lag1 { static_cast < int8_t > ( lag1_arg ) } ,
lag2 { static_cast < int8_t > ( lag2_arg ) } ,
lag3 { 0 }
2010-01-22 17:42:08 +01:00
{
} ;
2011-02-04 16:25:38 +01:00
inline
2018-10-04 17:18:27 +02:00
FNUMEXPR_ ( const ExpressionType expression_type , unsigned int equation_arg , unsigned int dvariable1_arg , unsigned int dvariable2_arg , unsigned int dvariable3_arg ) :
2021-02-01 11:10:59 +01:00
TagWithOneArgument < ExpressionType > : : TagWithOneArgument { Tags : : FNUMEXPR , expression_type } ,
2018-10-04 17:18:27 +02:00
equation { equation_arg } ,
dvariable1 { static_cast < uint16_t > ( dvariable1_arg ) } ,
dvariable2 { static_cast < uint16_t > ( dvariable2_arg ) } ,
dvariable3 { static_cast < uint16_t > ( dvariable3_arg ) } ,
lag1 { 0 } , lag2 { 0 } , lag3 { 0 }
2010-01-22 17:42:08 +01:00
{
} ;
2011-02-04 16:25:38 +01:00
inline
2018-10-04 17:18:27 +02:00
FNUMEXPR_ ( const ExpressionType expression_type , unsigned int equation_arg , unsigned int dvariable1_arg , int lag1_arg , unsigned int dvariable2_arg , int lag2_arg , unsigned int dvariable3_arg , int lag3_arg ) :
2021-02-01 11:10:59 +01:00
TagWithOneArgument < ExpressionType > : : TagWithOneArgument { Tags : : FNUMEXPR , expression_type } ,
2018-10-04 17:18:27 +02:00
equation { equation_arg } ,
dvariable1 { static_cast < uint16_t > ( dvariable1_arg ) } ,
dvariable2 { static_cast < uint16_t > ( dvariable2_arg ) } ,
dvariable3 { static_cast < uint16_t > ( dvariable3_arg ) } ,
lag1 { static_cast < int8_t > ( lag1_arg ) } ,
lag2 { static_cast < int8_t > ( lag2_arg ) } ,
lag3 { static_cast < int8_t > ( lag3_arg ) }
2010-01-22 17:42:08 +01:00
{
} ;
inline ExpressionType
get_expression_type ( )
{
return arg1 ;
}
inline unsigned int
get_equation ( )
{
return equation ;
} ;
inline unsigned int
get_dvariable1 ( )
{
return dvariable1 ;
} ;
inline int
get_lag1 ( )
{
return lag1 ;
} ;
inline unsigned int
get_dvariable2 ( )
{
return dvariable2 ;
} ;
inline int
get_lag2 ( )
{
return lag2 ;
} ;
inline unsigned int
get_dvariable3 ( )
{
return dvariable3 ;
} ;
inline int
get_lag3 ( )
{
return lag3 ;
} ;
inline void
2010-07-23 11:20:24 +02:00
write ( ostream & CompileCode , unsigned int & instruction_number )
2010-01-22 17:42:08 +01:00
{
CompileCode . write ( reinterpret_cast < char * > ( this ) , sizeof ( FNUMEXPR_ ) ) ;
2010-07-23 11:20:24 +02:00
instruction_number + + ;
2010-01-22 17:42:08 +01:00
} ;
} ;
2009-10-16 18:34:27 +02:00
class FBEGINBLOCK_
{
private :
2021-02-01 11:10:59 +01:00
uint8_t op_code { static_cast < uint8_t > ( Tags : : FBEGINBLOCK ) } ;
2021-02-01 12:44:24 +01:00
int size { 0 } ;
2009-10-16 18:34:27 +02:00
uint8_t type ;
2009-12-16 14:21:31 +01:00
vector < int > variable ;
vector < int > equation ;
2020-05-06 14:02:58 +02:00
vector < int > other_endogenous ;
vector < int > exogenous ;
vector < int > det_exogenous ;
2021-02-01 12:44:24 +01:00
bool is_linear { false } ;
2009-10-23 13:26:29 +02:00
vector < Block_contain_type > Block_Contain_ ;
2021-02-01 12:44:24 +01:00
int endo_nbr { 0 } ;
int Max_Lag { 0 } ;
int Max_Lead { 0 } ;
int u_count_int { 0 } ;
int nb_col_jacob { 0 } ;
2010-07-23 11:20:24 +02:00
unsigned int det_exo_size , exo_size , other_endo_size ;
2014-12-17 09:37:43 +01:00
unsigned int nb_col_det_exo_jacob , nb_col_exo_jacob , nb_col_other_endo_jacob ;
2009-10-16 18:34:27 +02:00
public :
2011-02-04 16:25:38 +01:00
inline
2021-02-01 12:44:24 +01:00
FBEGINBLOCK_ ( ) : type { static_cast < uint8_t > ( BlockSimulationType : : unknown ) }
2009-12-16 18:13:23 +01:00
{
2018-10-04 17:18:27 +02:00
}
2011-02-04 16:25:38 +01:00
inline
FBEGINBLOCK_ ( unsigned int size_arg , BlockSimulationType type_arg , int unsigned first_element , int unsigned block_size ,
const vector < int > & variable_arg , const vector < int > & equation_arg ,
bool is_linear_arg , int endo_nbr_arg , int Max_Lag_arg , int Max_Lead_arg , int & u_count_int_arg , int nb_col_jacob_arg ,
2014-12-17 09:37:43 +01:00
unsigned int det_exo_size_arg , unsigned int nb_col_det_exo_jacob_arg , unsigned int exo_size_arg , unsigned int nb_col_exo_jacob_arg , unsigned int other_endo_size_arg , unsigned int nb_col_other_endo_jacob_arg ,
2020-05-06 14:02:58 +02:00
vector < int > det_exogenous_arg , vector < int > exogenous_arg , vector < int > other_endogenous_arg ) :
2018-10-04 17:18:27 +02:00
size { static_cast < int > ( size_arg ) } ,
2018-10-11 11:21:58 +02:00
type { static_cast < uint8_t > ( type_arg ) } ,
2018-10-04 17:18:27 +02:00
variable { variable_arg . begin ( ) + first_element , variable_arg . begin ( ) + ( first_element + block_size ) } ,
equation { equation_arg . begin ( ) + first_element , equation_arg . begin ( ) + ( first_element + block_size ) } ,
2020-05-06 14:02:58 +02:00
other_endogenous { move ( other_endogenous_arg ) } ,
exogenous { move ( exogenous_arg ) } ,
det_exogenous { move ( det_exogenous_arg ) } ,
2018-10-04 17:18:27 +02:00
is_linear { is_linear_arg } ,
endo_nbr { endo_nbr_arg } ,
Max_Lag { Max_Lag_arg } ,
Max_Lead { Max_Lead_arg } ,
u_count_int { u_count_int_arg } ,
nb_col_jacob { nb_col_jacob_arg } ,
det_exo_size { det_exo_size_arg } ,
exo_size { exo_size_arg } ,
other_endo_size { other_endo_size_arg } ,
nb_col_det_exo_jacob { nb_col_det_exo_jacob_arg } ,
nb_col_exo_jacob { nb_col_exo_jacob_arg } ,
nb_col_other_endo_jacob { nb_col_other_endo_jacob_arg }
2009-12-16 18:13:23 +01:00
{
2018-10-04 17:18:27 +02:00
}
2011-02-04 16:25:38 +01:00
inline
FBEGINBLOCK_ ( unsigned int size_arg , BlockSimulationType type_arg , int unsigned first_element , int unsigned block_size ,
const vector < int > & variable_arg , const vector < int > & equation_arg ,
2018-10-04 17:18:27 +02:00
bool is_linear_arg , int endo_nbr_arg , int Max_Lag_arg , int Max_Lead_arg , int & u_count_int_arg , int nb_col_jacob_arg ) :
size { static_cast < int > ( size_arg ) } ,
2018-10-11 11:21:58 +02:00
type { static_cast < uint8_t > ( type_arg ) } ,
2018-10-04 17:18:27 +02:00
variable { variable_arg . begin ( ) + first_element , variable_arg . begin ( ) + ( first_element + block_size ) } ,
equation { equation_arg . begin ( ) + first_element , equation_arg . begin ( ) + ( first_element + block_size ) } ,
is_linear { is_linear_arg } ,
endo_nbr { endo_nbr_arg } ,
Max_Lag { Max_Lag_arg } ,
Max_Lead { Max_Lead_arg } ,
u_count_int { u_count_int_arg } ,
nb_col_jacob { nb_col_jacob_arg } ,
det_exo_size { 0 } ,
exo_size { 0 } ,
other_endo_size { 0 } ,
nb_col_det_exo_jacob { 0 } ,
nb_col_exo_jacob { 0 } ,
nb_col_other_endo_jacob { 0 }
{
2010-07-23 11:20:24 +02:00
}
2009-12-16 18:13:23 +01:00
inline unsigned int
get_size ( )
{
return size ;
} ;
inline uint8_t
get_type ( )
{
return type ;
} ;
inline bool
get_is_linear ( )
{
return is_linear ;
} ;
inline int
get_endo_nbr ( )
{
return endo_nbr ;
} ;
inline int
get_Max_Lag ( )
{
return Max_Lag ;
} ;
inline int
get_Max_Lead ( )
{
return Max_Lead ;
} ;
inline int
get_u_count_int ( )
{
return u_count_int ;
} ;
inline vector < Block_contain_type >
get_Block_Contain ( )
{
return Block_Contain_ ;
} ;
2010-07-23 11:20:24 +02:00
inline int
get_nb_col_jacob ( )
{
return nb_col_jacob ;
} ;
inline unsigned int
get_exo_size ( )
{
return exo_size ;
} ;
inline unsigned int
2014-12-17 09:37:43 +01:00
get_nb_col_exo_jacob ( )
{
return nb_col_exo_jacob ;
} ;
inline unsigned int
2010-07-23 11:20:24 +02:00
get_det_exo_size ( )
{
return det_exo_size ;
} ;
inline unsigned int
2014-12-17 09:37:43 +01:00
get_nb_col_det_exo_jacob ( )
{
return nb_col_det_exo_jacob ;
} ;
inline unsigned int
2010-07-23 11:20:24 +02:00
get_other_endo_size ( )
{
return other_endo_size ;
} ;
inline unsigned int
get_nb_col_other_endo_jacob ( )
{
return nb_col_other_endo_jacob ;
} ;
2015-09-22 12:45:27 +02:00
inline vector < int >
get_endogenous ( )
{
return variable ;
}
2020-05-06 14:02:58 +02:00
inline vector < int >
2015-09-22 12:45:27 +02:00
get_exogenous ( )
{
return exogenous ;
}
2009-12-16 18:13:23 +01:00
inline void
2010-07-23 11:20:24 +02:00
write ( ostream & CompileCode , unsigned int & instruction_number )
2009-12-16 18:13:23 +01:00
{
CompileCode . write ( reinterpret_cast < char * > ( & op_code ) , sizeof ( op_code ) ) ;
CompileCode . write ( reinterpret_cast < char * > ( & size ) , sizeof ( size ) ) ;
CompileCode . write ( reinterpret_cast < char * > ( & type ) , sizeof ( type ) ) ;
for ( int i = 0 ; i < size ; i + + )
{
CompileCode . write ( reinterpret_cast < char * > ( & variable [ i ] ) , sizeof ( variable [ 0 ] ) ) ;
CompileCode . write ( reinterpret_cast < char * > ( & equation [ i ] ) , sizeof ( equation [ 0 ] ) ) ;
}
2020-03-20 17:31:14 +01:00
if ( type = = static_cast < uint8_t > ( BlockSimulationType : : solveTwoBoundariesSimple )
| | type = = static_cast < uint8_t > ( BlockSimulationType : : solveTwoBoundariesComplete )
| | type = = static_cast < uint8_t > ( BlockSimulationType : : solveBackwardComplete )
| | type = = static_cast < uint8_t > ( BlockSimulationType : : solveForwardComplete ) )
2009-12-16 18:13:23 +01:00
{
CompileCode . write ( reinterpret_cast < char * > ( & is_linear ) , sizeof ( is_linear ) ) ;
CompileCode . write ( reinterpret_cast < char * > ( & endo_nbr ) , sizeof ( endo_nbr ) ) ;
CompileCode . write ( reinterpret_cast < char * > ( & Max_Lag ) , sizeof ( Max_Lag ) ) ;
CompileCode . write ( reinterpret_cast < char * > ( & Max_Lead ) , sizeof ( Max_Lead ) ) ;
CompileCode . write ( reinterpret_cast < char * > ( & u_count_int ) , sizeof ( u_count_int ) ) ;
}
2010-07-23 11:20:24 +02:00
CompileCode . write ( reinterpret_cast < char * > ( & nb_col_jacob ) , sizeof ( nb_col_jacob ) ) ;
CompileCode . write ( reinterpret_cast < char * > ( & det_exo_size ) , sizeof ( det_exo_size ) ) ;
2014-12-17 09:37:43 +01:00
CompileCode . write ( reinterpret_cast < char * > ( & nb_col_det_exo_jacob ) , sizeof ( nb_col_det_exo_jacob ) ) ;
2010-07-23 11:20:24 +02:00
CompileCode . write ( reinterpret_cast < char * > ( & exo_size ) , sizeof ( exo_size ) ) ;
2014-12-17 09:37:43 +01:00
CompileCode . write ( reinterpret_cast < char * > ( & nb_col_exo_jacob ) , sizeof ( nb_col_exo_jacob ) ) ;
2010-07-23 11:20:24 +02:00
CompileCode . write ( reinterpret_cast < char * > ( & other_endo_size ) , sizeof ( other_endo_size ) ) ;
CompileCode . write ( reinterpret_cast < char * > ( & nb_col_other_endo_jacob ) , sizeof ( nb_col_other_endo_jacob ) ) ;
for ( unsigned int i = 0 ; i < det_exo_size ; i + + )
CompileCode . write ( reinterpret_cast < char * > ( & det_exogenous [ i ] ) , sizeof ( det_exogenous [ 0 ] ) ) ;
for ( unsigned int i = 0 ; i < exo_size ; i + + )
CompileCode . write ( reinterpret_cast < char * > ( & exogenous [ i ] ) , sizeof ( exogenous [ 0 ] ) ) ;
for ( unsigned int i = 0 ; i < other_endo_size ; i + + )
CompileCode . write ( reinterpret_cast < char * > ( & other_endogenous [ i ] ) , sizeof ( other_endogenous [ 0 ] ) ) ;
instruction_number + + ;
2009-12-16 18:13:23 +01:00
} ;
2009-10-16 18:34:27 +02:00
# ifdef BYTE_CODE
2009-12-16 18:13:23 +01:00
inline uint8_t *
load ( uint8_t * code )
{
2021-02-01 11:10:59 +01:00
op_code = static_cast < uint8_t > ( Tags : : FBEGINBLOCK ) ; code + = sizeof ( op_code ) ;
2009-12-16 18:13:23 +01:00
memcpy ( & size , code , sizeof ( size ) ) ; code + = sizeof ( size ) ;
memcpy ( & type , code , sizeof ( type ) ) ; code + = sizeof ( type ) ;
for ( int i = 0 ; i < size ; i + + )
{
Block_contain_type bc ;
memcpy ( & bc . Variable , code , sizeof ( bc . Variable ) ) ; code + = sizeof ( bc . Variable ) ;
memcpy ( & bc . Equation , code , sizeof ( bc . Equation ) ) ; code + = sizeof ( bc . Equation ) ;
Block_Contain_ . push_back ( bc ) ;
}
2020-03-20 17:31:14 +01:00
if ( type = = static_cast < uint8_t > ( BlockSimulationType : : solveTwoBoundariesSimple )
| | type = = static_cast < uint8_t > ( BlockSimulationType : : solveTwoBoundariesComplete )
| | type = = static_cast < uint8_t > ( BlockSimulationType : : solveBackwardComplete )
| | type = = static_cast < uint8_t > ( BlockSimulationType : : solveForwardComplete ) )
2009-12-16 18:13:23 +01:00
{
memcpy ( & is_linear , code , sizeof ( is_linear ) ) ; code + = sizeof ( is_linear ) ;
memcpy ( & endo_nbr , code , sizeof ( endo_nbr ) ) ; code + = sizeof ( endo_nbr ) ;
memcpy ( & Max_Lag , code , sizeof ( Max_Lag ) ) ; code + = sizeof ( Max_Lag ) ;
memcpy ( & Max_Lead , code , sizeof ( Max_Lead ) ) ; code + = sizeof ( Max_Lead ) ;
memcpy ( & u_count_int , code , sizeof ( u_count_int ) ) ; code + = sizeof ( u_count_int ) ;
}
2010-07-23 11:20:24 +02:00
memcpy ( & nb_col_jacob , code , sizeof ( nb_col_jacob ) ) ; code + = sizeof ( nb_col_jacob ) ;
memcpy ( & det_exo_size , code , sizeof ( det_exo_size ) ) ; code + = sizeof ( det_exo_size ) ;
2014-12-17 09:37:43 +01:00
memcpy ( & nb_col_det_exo_jacob , code , sizeof ( nb_col_det_exo_jacob ) ) ; code + = sizeof ( nb_col_det_exo_jacob ) ;
2010-07-23 11:20:24 +02:00
memcpy ( & exo_size , code , sizeof ( exo_size ) ) ; code + = sizeof ( exo_size ) ;
2014-12-17 09:37:43 +01:00
memcpy ( & nb_col_exo_jacob , code , sizeof ( nb_col_exo_jacob ) ) ; code + = sizeof ( nb_col_exo_jacob ) ;
2010-07-23 11:20:24 +02:00
memcpy ( & other_endo_size , code , sizeof ( other_endo_size ) ) ; code + = sizeof ( other_endo_size ) ;
memcpy ( & nb_col_other_endo_jacob , code , sizeof ( nb_col_other_endo_jacob ) ) ; code + = sizeof ( nb_col_other_endo_jacob ) ;
for ( unsigned int i = 0 ; i < det_exo_size ; i + + )
{
2020-05-06 14:02:58 +02:00
int tmp_i ;
2010-07-23 11:20:24 +02:00
memcpy ( & tmp_i , code , sizeof ( tmp_i ) ) ; code + = sizeof ( tmp_i ) ;
det_exogenous . push_back ( tmp_i ) ;
}
for ( unsigned int i = 0 ; i < exo_size ; i + + )
{
2020-05-06 14:02:58 +02:00
int tmp_i ;
2010-07-23 11:20:24 +02:00
memcpy ( & tmp_i , code , sizeof ( tmp_i ) ) ; code + = sizeof ( tmp_i ) ;
exogenous . push_back ( tmp_i ) ;
}
for ( unsigned int i = 0 ; i < other_endo_size ; i + + )
{
2020-05-06 14:02:58 +02:00
int tmp_i ;
2010-07-23 11:20:24 +02:00
memcpy ( & tmp_i , code , sizeof ( tmp_i ) ) ; code + = sizeof ( tmp_i ) ;
other_endogenous . push_back ( tmp_i ) ;
}
2009-12-16 18:13:23 +01:00
return code ;
} ;
2009-10-16 18:34:27 +02:00
# endif
} ;
# ifdef BYTE_CODE
2018-06-04 14:31:26 +02:00
using tags_liste_t = vector < pair < Tags , void * > > ;
2009-10-16 18:34:27 +02:00
class CodeLoad
{
private :
uint8_t * code ;
2010-01-22 17:42:08 +01:00
unsigned int nb_blocks ;
2013-03-22 15:48:47 +01:00
vector < size_t > begin_block ;
2009-10-16 18:34:27 +02:00
public :
2010-01-22 17:42:08 +01:00
inline unsigned int
2021-02-03 18:09:11 +01:00
get_block_number ( ) const
2010-01-22 17:42:08 +01:00
{
return nb_blocks ;
} ;
2010-10-11 19:21:32 +02:00
2013-03-22 15:48:47 +01:00
size_t inline
2021-02-03 18:09:11 +01:00
get_begin_block ( int block ) const
2010-10-11 19:21:32 +02:00
{
return begin_block [ block ] ;
}
2009-12-16 18:13:23 +01:00
inline void *
2021-02-03 18:09:11 +01:00
get_current_code ( ) const
2009-12-16 18:13:23 +01:00
{
return code ;
} ;
2010-09-16 19:00:48 +02:00
inline tags_liste_t
2009-12-16 18:13:23 +01:00
get_op_code ( string file_name )
{
2010-09-16 19:00:48 +02:00
tags_liste_t tags_liste ;
2009-12-16 18:13:23 +01:00
ifstream CompiledCode ;
streamoff Code_Size ;
2018-06-27 15:12:12 +02:00
CompiledCode . open ( file_name + " .cod " , std : : ios : : in | std : : ios : : binary | std : : ios : : ate ) ;
2009-12-16 18:13:23 +01:00
if ( ! CompiledCode . is_open ( ) )
2021-02-03 18:09:11 +01:00
return tags_liste ;
2009-12-16 18:13:23 +01:00
Code_Size = CompiledCode . tellg ( ) ;
CompiledCode . seekg ( std : : ios : : beg ) ;
2019-04-23 11:07:32 +02:00
code = static_cast < uint8_t * > ( mxMalloc ( Code_Size ) ) ;
2009-12-16 18:13:23 +01:00
CompiledCode . seekg ( 0 ) ;
CompiledCode . read ( reinterpret_cast < char * > ( code ) , Code_Size ) ;
CompiledCode . close ( ) ;
2010-01-22 17:42:08 +01:00
nb_blocks = 0 ;
2009-12-16 18:13:23 +01:00
bool done = false ;
2010-07-23 11:20:24 +02:00
int instruction = 0 ;
2009-12-16 18:13:23 +01:00
while ( ! done )
{
2021-02-01 11:10:59 +01:00
switch ( static_cast < Tags > ( * code ) )
2009-12-16 18:13:23 +01:00
{
2021-02-01 11:10:59 +01:00
case Tags : : FLDZ :
2009-12-16 18:13:23 +01:00
# ifdef DEBUGL
2021-02-01 11:10:59 +01:00
mexPrintf ( " FLDZ = %d size = %d \n " , Tags : : FLDZ , sizeof ( FLDZ_ ) ) ;
2009-12-16 18:13:23 +01:00
# endif
2021-02-01 11:10:59 +01:00
tags_liste . emplace_back ( Tags : : FLDZ , code ) ;
2009-12-16 18:13:23 +01:00
code + = sizeof ( FLDZ_ ) ;
break ;
2021-02-01 11:10:59 +01:00
case Tags : : FEND :
2009-12-16 18:13:23 +01:00
# ifdef DEBUGL
mexPrintf ( " FEND \n " ) ;
# endif
2021-02-01 11:10:59 +01:00
tags_liste . emplace_back ( Tags : : FEND , code ) ;
2009-12-16 18:13:23 +01:00
code + = sizeof ( FEND_ ) ;
done = true ;
break ;
2021-02-01 11:10:59 +01:00
case Tags : : FENDBLOCK :
2009-12-16 18:13:23 +01:00
# ifdef DEBUGL
mexPrintf ( " FENDBLOCK \n " ) ;
# endif
2021-02-01 11:10:59 +01:00
tags_liste . emplace_back ( Tags : : FENDBLOCK , code ) ;
2009-12-16 18:13:23 +01:00
code + = sizeof ( FENDBLOCK_ ) ;
break ;
2021-02-01 11:10:59 +01:00
case Tags : : FENDEQU :
2009-12-16 18:13:23 +01:00
# ifdef DEBUGL
mexPrintf ( " FENDEQU \n " ) ;
# endif
2021-02-01 11:10:59 +01:00
tags_liste . emplace_back ( Tags : : FENDEQU , code ) ;
2009-12-16 18:13:23 +01:00
code + = sizeof ( FENDEQU_ ) ;
break ;
2021-02-01 11:10:59 +01:00
case Tags : : FCUML :
2009-12-16 18:13:23 +01:00
# ifdef DEBUGL
mexPrintf ( " FCUML \n " ) ;
# endif
2021-02-01 11:10:59 +01:00
tags_liste . emplace_back ( Tags : : FCUML , code ) ;
2009-12-16 18:13:23 +01:00
code + = sizeof ( FCUML_ ) ;
break ;
2021-02-01 11:10:59 +01:00
case Tags : : FDIMT :
2009-12-16 18:13:23 +01:00
# ifdef DEBUGL
2021-02-01 11:10:59 +01:00
mexPrintf ( " FDIMT = %d size = %d \n " , Tags : : FDIMT , sizeof ( FDIMT_ ) ) ;
2009-12-16 18:13:23 +01:00
# endif
2021-02-01 11:10:59 +01:00
tags_liste . emplace_back ( Tags : : FDIMT , code ) ;
2009-12-16 18:13:23 +01:00
code + = sizeof ( FDIMT_ ) ;
break ;
2021-02-01 11:10:59 +01:00
case Tags : : FDIMST :
2009-12-16 18:13:23 +01:00
# ifdef DEBUGL
mexPrintf ( " FDIMST \n " ) ;
# endif
2021-02-01 11:10:59 +01:00
tags_liste . emplace_back ( Tags : : FDIMST , code ) ;
2009-12-16 18:13:23 +01:00
code + = sizeof ( FDIMST_ ) ;
break ;
2021-02-01 11:10:59 +01:00
case Tags : : FNUMEXPR :
2010-01-22 17:42:08 +01:00
# ifdef DEBUGL
mexPrintf ( " FNUMEXPR \n " ) ;
# endif
2021-02-01 11:10:59 +01:00
tags_liste . emplace_back ( Tags : : FNUMEXPR , code ) ;
2010-01-22 17:42:08 +01:00
code + = sizeof ( FNUMEXPR_ ) ;
break ;
2021-02-01 11:10:59 +01:00
case Tags : : FLDC :
2009-12-16 18:13:23 +01:00
# ifdef DEBUGL
mexPrintf ( " FLDC \n " ) ;
# endif
2021-02-01 11:10:59 +01:00
tags_liste . emplace_back ( Tags : : FLDC , code ) ;
2009-12-16 18:13:23 +01:00
code + = sizeof ( FLDC_ ) ;
break ;
2021-02-01 11:10:59 +01:00
case Tags : : FLDU :
2009-12-16 18:13:23 +01:00
# ifdef DEBUGL
mexPrintf ( " FLDU \n " ) ;
# endif
2021-02-01 11:10:59 +01:00
tags_liste . emplace_back ( Tags : : FLDU , code ) ;
2009-12-16 18:13:23 +01:00
code + = sizeof ( FLDU_ ) ;
break ;
2021-02-01 11:10:59 +01:00
case Tags : : FLDSU :
2009-12-16 18:13:23 +01:00
# ifdef DEBUGL
mexPrintf ( " FLDSU \n " ) ;
# endif
2021-02-01 11:10:59 +01:00
tags_liste . emplace_back ( Tags : : FLDSU , code ) ;
2009-12-16 18:13:23 +01:00
code + = sizeof ( FLDSU_ ) ;
break ;
2021-02-01 11:10:59 +01:00
case Tags : : FLDR :
2009-12-16 18:13:23 +01:00
# ifdef DEBUGL
mexPrintf ( " FLDR \n " ) ;
# endif
2021-02-01 11:10:59 +01:00
tags_liste . emplace_back ( Tags : : FLDR , code ) ;
2009-12-16 18:13:23 +01:00
code + = sizeof ( FLDR_ ) ;
break ;
2021-02-01 11:10:59 +01:00
case Tags : : FLDT :
2009-12-16 18:13:23 +01:00
# ifdef DEBUGL
mexPrintf ( " FLDT \n " ) ;
# endif
2021-02-01 11:10:59 +01:00
tags_liste . emplace_back ( Tags : : FLDT , code ) ;
2009-12-16 18:13:23 +01:00
code + = sizeof ( FLDT_ ) ;
break ;
2021-02-01 11:10:59 +01:00
case Tags : : FLDST :
2009-12-16 18:13:23 +01:00
# ifdef DEBUGL
mexPrintf ( " FLDST \n " ) ;
# endif
2021-02-01 11:10:59 +01:00
tags_liste . emplace_back ( Tags : : FLDST , code ) ;
2009-12-16 18:13:23 +01:00
code + = sizeof ( FLDST_ ) ;
break ;
2021-02-01 11:10:59 +01:00
case Tags : : FSTPT :
2009-12-16 18:13:23 +01:00
# ifdef DEBUGL
2021-02-01 11:10:59 +01:00
mexPrintf ( " FSTPT = %d size = %d \n " , Tags : : FSTPT , sizeof ( FSTPT_ ) ) ;
2009-12-16 18:13:23 +01:00
# endif
2021-02-01 11:10:59 +01:00
tags_liste . emplace_back ( Tags : : FSTPT , code ) ;
2009-12-16 18:13:23 +01:00
code + = sizeof ( FSTPT_ ) ;
break ;
2021-02-01 11:10:59 +01:00
case Tags : : FSTPST :
2009-12-16 18:13:23 +01:00
# ifdef DEBUGL
mexPrintf ( " FSTPST \n " ) ;
# endif
2021-02-01 11:10:59 +01:00
tags_liste . emplace_back ( Tags : : FSTPST , code ) ;
2009-12-16 18:13:23 +01:00
code + = sizeof ( FSTPST_ ) ;
break ;
2021-02-01 11:10:59 +01:00
case Tags : : FSTPR :
2009-12-16 18:13:23 +01:00
# ifdef DEBUGL
mexPrintf ( " FSTPR \n " ) ;
# endif
2021-02-01 11:10:59 +01:00
tags_liste . emplace_back ( Tags : : FSTPR , code ) ;
2009-12-16 18:13:23 +01:00
code + = sizeof ( FSTPR_ ) ;
break ;
2021-02-01 11:10:59 +01:00
case Tags : : FSTPU :
2009-12-16 18:13:23 +01:00
# ifdef DEBUGL
mexPrintf ( " FSTPU \n " ) ;
# endif
2021-02-01 11:10:59 +01:00
tags_liste . emplace_back ( Tags : : FSTPU , code ) ;
2009-12-16 18:13:23 +01:00
code + = sizeof ( FSTPU_ ) ;
break ;
2021-02-01 11:10:59 +01:00
case Tags : : FSTPSU :
2009-12-16 18:13:23 +01:00
# ifdef DEBUGL
mexPrintf ( " FSTPSU \n " ) ;
# endif
2021-02-01 11:10:59 +01:00
tags_liste . emplace_back ( Tags : : FSTPSU , code ) ;
2009-12-16 18:13:23 +01:00
code + = sizeof ( FSTPSU_ ) ;
break ;
2021-02-01 11:10:59 +01:00
case Tags : : FSTPG :
2009-12-16 18:13:23 +01:00
# ifdef DEBUGL
mexPrintf ( " FSTPG \n " ) ;
# endif
2021-02-01 11:10:59 +01:00
tags_liste . emplace_back ( Tags : : FSTPG , code ) ;
2009-12-16 18:13:23 +01:00
code + = sizeof ( FSTPG_ ) ;
break ;
2021-02-01 11:10:59 +01:00
case Tags : : FSTPG2 :
2010-07-23 11:20:24 +02:00
# ifdef DEBUGL
mexPrintf ( " FSTPG2 \n " ) ;
# endif
2021-02-01 11:10:59 +01:00
tags_liste . emplace_back ( Tags : : FSTPG2 , code ) ;
2010-07-23 11:20:24 +02:00
code + = sizeof ( FSTPG2_ ) ;
break ;
2021-02-01 11:10:59 +01:00
case Tags : : FSTPG3 :
2010-07-23 11:20:24 +02:00
# ifdef DEBUGL
mexPrintf ( " FSTPG3 \n " ) ;
# endif
2021-02-01 11:10:59 +01:00
tags_liste . emplace_back ( Tags : : FSTPG3 , code ) ;
2010-07-23 11:20:24 +02:00
code + = sizeof ( FSTPG3_ ) ;
break ;
2021-02-01 11:10:59 +01:00
case Tags : : FUNARY :
2009-12-16 18:13:23 +01:00
# ifdef DEBUGL
mexPrintf ( " FUNARY \n " ) ;
# endif
2021-02-01 11:10:59 +01:00
tags_liste . emplace_back ( Tags : : FUNARY , code ) ;
2009-12-16 18:13:23 +01:00
code + = sizeof ( FUNARY_ ) ;
break ;
2021-02-01 11:10:59 +01:00
case Tags : : FBINARY :
2009-12-16 18:13:23 +01:00
# ifdef DEBUGL
mexPrintf ( " FBINARY \n " ) ;
# endif
2021-02-01 11:10:59 +01:00
tags_liste . emplace_back ( Tags : : FBINARY , code ) ;
2009-12-16 18:13:23 +01:00
code + = sizeof ( FBINARY_ ) ;
break ;
2021-02-01 11:10:59 +01:00
case Tags : : FTRINARY :
2010-04-16 16:54:55 +02:00
# ifdef DEBUGL
mexPrintf ( " FTRINARY \n " ) ;
# endif
2021-02-01 11:10:59 +01:00
tags_liste . emplace_back ( Tags : : FTRINARY , code ) ;
2010-04-16 16:54:55 +02:00
code + = sizeof ( FTRINARY_ ) ;
break ;
2021-02-01 11:10:59 +01:00
case Tags : : FOK :
2009-12-16 18:13:23 +01:00
# ifdef DEBUGL
mexPrintf ( " FOK \n " ) ;
# endif
2021-02-01 11:10:59 +01:00
tags_liste . emplace_back ( Tags : : FOK , code ) ;
2009-12-16 18:13:23 +01:00
code + = sizeof ( FOK_ ) ;
break ;
2021-02-01 11:10:59 +01:00
case Tags : : FLDVS :
2009-12-16 18:13:23 +01:00
# ifdef DEBUGL
mexPrintf ( " FLDVS \n " ) ;
# endif
2021-02-01 11:10:59 +01:00
tags_liste . emplace_back ( Tags : : FLDVS , code ) ;
2009-12-16 18:13:23 +01:00
code + = sizeof ( FLDVS_ ) ;
break ;
2021-02-01 11:10:59 +01:00
case Tags : : FLDSV :
2009-12-16 18:13:23 +01:00
# ifdef DEBUGL
mexPrintf ( " FLDSV \n " ) ;
# endif
2021-02-01 11:10:59 +01:00
tags_liste . emplace_back ( Tags : : FLDSV , code ) ;
2009-12-16 18:13:23 +01:00
code + = sizeof ( FLDSV_ ) ;
break ;
2021-02-01 11:10:59 +01:00
case Tags : : FSTPSV :
2009-12-16 18:13:23 +01:00
# ifdef DEBUGL
mexPrintf ( " FSTPSV \n " ) ;
# endif
2021-02-01 11:10:59 +01:00
tags_liste . emplace_back ( Tags : : FSTPSV , code ) ;
2009-12-16 18:13:23 +01:00
code + = sizeof ( FSTPSV_ ) ;
break ;
2021-02-01 11:10:59 +01:00
case Tags : : FLDV :
2009-12-16 18:13:23 +01:00
# ifdef DEBUGL
mexPrintf ( " FLDV \n " ) ;
# endif
2021-02-01 11:10:59 +01:00
tags_liste . emplace_back ( Tags : : FLDV , code ) ;
2009-12-16 18:13:23 +01:00
code + = sizeof ( FLDV_ ) ;
break ;
2021-02-01 11:10:59 +01:00
case Tags : : FSTPV :
2009-12-16 18:13:23 +01:00
# ifdef DEBUGL
mexPrintf ( " FSTPV \n " ) ;
# endif
2021-02-01 11:10:59 +01:00
tags_liste . emplace_back ( Tags : : FSTPV , code ) ;
2009-12-16 18:13:23 +01:00
code + = sizeof ( FSTPV_ ) ;
break ;
2021-02-01 11:10:59 +01:00
case Tags : : FBEGINBLOCK :
2009-12-16 18:13:23 +01:00
# ifdef DEBUGL
mexPrintf ( " FBEGINBLOCK \n " ) ;
# endif
{
2021-02-01 12:42:59 +01:00
auto * fbegin_block = new FBEGINBLOCK_ ;
2009-12-16 18:13:23 +01:00
code = fbegin_block - > load ( code ) ;
2010-10-11 19:21:32 +02:00
begin_block . push_back ( tags_liste . size ( ) ) ;
2021-02-01 11:10:59 +01:00
tags_liste . emplace_back ( Tags : : FBEGINBLOCK , fbegin_block ) ;
2010-01-22 17:42:08 +01:00
nb_blocks + + ;
2009-12-16 18:13:23 +01:00
}
break ;
2021-02-01 11:10:59 +01:00
case Tags : : FJMPIFEVAL :
2010-07-23 11:20:24 +02:00
# ifdef DEBUGL
mexPrintf ( " FJMPIFEVAL \n " ) ;
# endif
2021-02-01 11:10:59 +01:00
tags_liste . emplace_back ( Tags : : FJMPIFEVAL , code ) ;
2010-07-23 11:20:24 +02:00
code + = sizeof ( FJMPIFEVAL_ ) ;
break ;
2021-02-01 11:10:59 +01:00
case Tags : : FJMP :
2010-07-23 11:20:24 +02:00
# ifdef DEBUGL
mexPrintf ( " FJMP \n " ) ;
# endif
2021-02-01 11:10:59 +01:00
tags_liste . emplace_back ( Tags : : FJMP , code ) ;
2010-07-23 11:20:24 +02:00
code + = sizeof ( FJMP_ ) ;
break ;
2021-02-01 11:10:59 +01:00
case Tags : : FCALL :
2010-12-10 11:50:27 +01:00
{
# ifdef DEBUGL
mexPrintf ( " FCALL \n " ) ;
# endif
2021-02-01 12:42:59 +01:00
auto * fcall = new FCALL_ ;
2010-12-10 11:50:27 +01:00
code = fcall - > load ( code ) ;
2021-02-01 11:10:59 +01:00
tags_liste . emplace_back ( Tags : : FCALL , fcall ) ;
2010-12-10 11:50:27 +01:00
# ifdef DEBUGL
2011-02-04 16:25:38 +01:00
mexPrintf ( " FCALL finish \n " ) ; mexEvalString ( " drawnow; " ) ;
mexPrintf ( " -- *code=%d \n " , * code ) ; mexEvalString ( " drawnow; " ) ;
2010-12-10 11:50:27 +01:00
# endif
}
break ;
2021-02-01 11:10:59 +01:00
case Tags : : FPUSH :
2010-12-10 11:50:27 +01:00
# ifdef DEBUGL
mexPrintf ( " FPUSH \n " ) ;
# endif
2021-02-01 11:10:59 +01:00
tags_liste . emplace_back ( Tags : : FPUSH , code ) ;
2010-12-10 11:50:27 +01:00
code + = sizeof ( FPUSH_ ) ;
break ;
2021-02-01 11:10:59 +01:00
case Tags : : FPOP :
2010-12-10 11:50:27 +01:00
# ifdef DEBUGL
mexPrintf ( " FPOP \n " ) ;
# endif
2021-02-01 11:10:59 +01:00
tags_liste . emplace_back ( Tags : : FPOP , code ) ;
2010-12-10 11:50:27 +01:00
code + = sizeof ( FPOP_ ) ;
break ;
2021-02-01 11:10:59 +01:00
case Tags : : FLDTEF :
2010-12-10 11:50:27 +01:00
# ifdef DEBUGL
mexPrintf ( " FLDTEF \n " ) ;
# endif
2021-02-01 11:10:59 +01:00
tags_liste . emplace_back ( Tags : : FLDTEF , code ) ;
2010-12-10 11:50:27 +01:00
code + = sizeof ( FLDTEF_ ) ;
break ;
2021-02-01 11:10:59 +01:00
case Tags : : FSTPTEF :
2010-12-10 11:50:27 +01:00
# ifdef DEBUGL
mexPrintf ( " FSTPTEF \n " ) ;
# endif
2021-02-01 11:10:59 +01:00
tags_liste . emplace_back ( Tags : : FSTPTEF , code ) ;
2010-12-10 11:50:27 +01:00
code + = sizeof ( FSTPTEF_ ) ;
break ;
2021-02-01 11:10:59 +01:00
case Tags : : FLDTEFD :
2010-12-10 11:50:27 +01:00
# ifdef DEBUGL
mexPrintf ( " FLDTEFD \n " ) ;
# endif
2021-02-01 11:10:59 +01:00
tags_liste . emplace_back ( Tags : : FLDTEFD , code ) ;
2010-12-10 11:50:27 +01:00
code + = sizeof ( FLDTEFD_ ) ;
break ;
2021-02-01 11:10:59 +01:00
case Tags : : FSTPTEFD :
2010-12-10 11:50:27 +01:00
# ifdef DEBUGL
mexPrintf ( " FSTPTEFD \n " ) ;
# endif
2021-02-01 11:10:59 +01:00
tags_liste . emplace_back ( Tags : : FSTPTEFD , code ) ;
2010-12-10 11:50:27 +01:00
code + = sizeof ( FSTPTEFD_ ) ;
break ;
2021-02-01 11:10:59 +01:00
case Tags : : FLDTEFDD :
2010-12-10 11:50:27 +01:00
# ifdef DEBUGL
mexPrintf ( " FLDTEFDD \n " ) ;
# endif
2021-02-01 11:10:59 +01:00
tags_liste . emplace_back ( Tags : : FLDTEFDD , code ) ;
2010-12-10 11:50:27 +01:00
code + = sizeof ( FLDTEFDD_ ) ;
break ;
2021-02-01 11:10:59 +01:00
case Tags : : FSTPTEFDD :
2010-12-10 11:50:27 +01:00
# ifdef DEBUGL
mexPrintf ( " FSTPTEFDD \n " ) ;
# endif
2021-02-01 11:10:59 +01:00
tags_liste . emplace_back ( Tags : : FSTPTEFDD , code ) ;
2010-12-10 11:50:27 +01:00
code + = sizeof ( FSTPTEFDD_ ) ;
break ;
2009-12-16 18:13:23 +01:00
default :
mexPrintf ( " Unknown Tag value=%d code=%x \n " , * code , code ) ;
done = true ;
}
2010-07-23 11:20:24 +02:00
instruction + + ;
2009-12-16 18:13:23 +01:00
}
return tags_liste ;
} ;
2009-10-16 18:34:27 +02:00
} ;
# endif
# pragma pack(pop)
# endif