Skip to content
Snippets Groups Projects
Verified Commit 4cfba74f authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Bytecode: streamline description of opcodes

An “FLD…” opcode loads onto the stack, an “FST…” opcode stores from the stack.

Also remove useless numerical values (which may change).
parent 5a0c6ad2
Branches
No related tags found
No related merge requests found
...@@ -35,63 +35,62 @@ using namespace std; ...@@ -35,63 +35,62 @@ using namespace std;
// The different opcodes of bytecode // The different opcodes of bytecode
enum class Tags enum class Tags
{ {
FLDZ, //!< Stores zero in the stack - 0 (0) FLDZ, // Loads a zero onto the stack
FLDC, //!< Stores a constant term in the stack - 1 (1) FLDC, // Loads a constant term onto the stack
FDIMT, //!< Defines the number of temporary terms - dynamic context (the period has to be indicated) - 2 (2) FDIMT, // Defines the number of temporary terms - dynamic context (the period has to be indicated)
FDIMST, //!< Defines the number of temporary terms - static context (the period hasn't to be indicated) - 3 (3) FDIMST, // Defines the number of temporary terms - static context (the period hasn’t to be indicated)
FLDT, //!< Stores a temporary term in the stack - dynamic context (the period has to be indicated) - 4 (4) FLDT, // Loads a temporary term onto the stack - dynamic context (the period has to be indicated)
FLDST, //!< Stores a temporary term in the stack - static context (the period hasn't to be indicated) - 5 (5) FLDST, // Loads a temporary term onto the stack - static context (the period hasn’t to be indicated)
FSTPT, //!< Loads a temporary term from the stack - dynamic context (the period has to be indicated) - 6 (6) FSTPT, // Stores a temporary term from the stack - dynamic context (the period has to be indicated)
FSTPST, //!< Loads a temporary term from the stack - static context (the period hasn't to be indicated) - 7 (7) FSTPST, // Stores a temporary term from the stack - static context (the period hasn’t to be indicated)
FLDU, //!< Stores an element of the vector U in the stack - dynamic context (the period has to be indicated) - 8 (8) FLDU, // Loads an element of the vector U onto the stack - dynamic context (the period has to be indicated)
FLDSU, //!< Stores an element of the vector U in the stack - static context (the period hasn't to be indicated) - 9 (9) FLDSU, // Loads an element of the vector U onto the stack - static context (the period hasn’t to be indicated)
FSTPU, //!< Loads an element of the vector U from the stack - dynamic context (the period has to be indicated) - A (10) FSTPU, // Stores an element of the vector U from the stack - dynamic context (the period has to be indicated)
FSTPSU, //!< Loads an element of the vector U from the stack - static context (the period hasn't to be indicated) - B (11) FSTPSU, // Stores an element of the vector U from the stack - static context (the period hasn’t to be indicated)
FLDV, //!< Stores a variable (described in SymbolType) in the stack - dynamic context (the period has to be indicated) - C (12) FLDV, // Loads a variable (described in SymbolType) onto the stack - dynamic context (the period has to be indicated)
FLDSV, //!< Stores a variable (described in SymbolType) in the stack - static context (the period hasn't to be indicated) - D (13) FLDSV, // Loads a variable (described in SymbolType) onto the stack - static context (the period hasn’t to be indicated)
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) FLDVS, // Loads a variable (described in SymbolType) onto the stack - dynamic context but inside the STEADY_STATE operator (the period hasn’t to be indicated)
FSTPV, //!< Loads a variable (described in SymbolType) from the stack - dynamic context (the period has to be indicated) - F (15) FSTPV, // Stores a variable (described in SymbolType) from the stack - dynamic context (the period has to be indicated)
FSTPSV, //!< Loads a variable (described in SymbolType) from the stack - static context (the period hasn't to be indicated) - 10 (16) FSTPSV, // Stores a variable (described in SymbolType) from the stack - static context (the period hasn’t to be indicated)
FLDR, //!< Stores a residual in the stack - 11 (17) FLDR, // Loads a residual onto the stack
FSTPR, //!< Loads a residual from the stack - 12 (18) FSTPR, // Stores a residual from the stack
FSTPG, //!< Loads a derivative from the stack - 13 (19) FSTPG, // Stores a derivative from the stack
FSTPG2, //!< Loads a derivative matrix for static model from the stack - 14 (20) FSTPG2, // Stores a derivative matrix for a static model from the stack
FSTPG3, //!< Loads a derivative matrix for a dynamic model from the stack - 15 (21) FSTPG3, // Stores a derivative matrix for a dynamic model from the stack
FSTPG4, //!< Loads a second order derivative matrix for a dynamic model from the stack - 16 (22) FSTPG4, // Stores a second order derivative matrix for a dynamic model from the stack
FUNARY, //!< A Unary operator - 17 (23) FUNARY, // A unary operator
FBINARY, //!< A binary operator - 18 (24) FBINARY, // A binary operator
FTRINARY, //!< A trinary operator - 19 (25) FTRINARY, // A trinary operator
FCUML, //!< Cumulates the result - 1A (26) FCUML, // Cumulates the result
FJMPIFEVAL, //!< Jump if evaluate = true - 1B (27) FJMPIFEVAL, // Jump if evaluate = true
FJMP, //!< Jump - 1C (28) FJMP, // Jump
FBEGINBLOCK, //!< Defines the begining of a model block - 1D (29) FBEGINBLOCK, // Marks the beginning of a model block
FENDBLOCK, //!< Defines the end of a model block - 1E (30) FENDBLOCK, // Marks the end of a model block
FENDEQU, //!< Defines the last equation of the block. For block that has to be solved, the derivatives appear just after this flag - 1F (31) FENDEQU, // Marks the last equation of the block; for a block that has to be solved, the derivatives appear just after this flag
FEND, //!< Defines the end of the model code - 20 (32) FEND, // Marks the end of the model code
FOK, //!< Used for debugging purpose - 21 (33) FOK, // Used for debugging purpose
FNUMEXPR, //!< Store the expression type and references - 22 (34) FNUMEXPR, // Stores the expression type and references
FCALL, //!< Call an external function - 23 (35) FCALL, // Call an external function
FPUSH, //!< Push a double in the stack - 24 (36) FPUSH, // Push a double onto the stack
FPOP, //!< Pop a double from the stack - 25 (37) FPOP, // Pop a double from the stack
FLDTEF, //!< Stores the result of an external function in the stack - 26 (38) FLDTEF, // Loads the result of an external function onto the stack
FSTPTEF, //!< Loads the result of an external function from the stack- 27 (39) FSTPTEF, // Stores the result of an external function from the stack
FLDTEFD, //!< Stores the result of the 1st derivative of an external function in the stack - 28 (40) FLDTEFD, // Loads the result of the 1st derivative of an external function onto the stack
FSTPTEFD, //!< Loads the result of the 1st derivative of an external function from the stack- 29 (41) FSTPTEFD, // Stores the result of the 1st derivative of an external function from the stack
FLDTEFDD, //!< Stores the result of the 2nd derivative of an external function in the stack - 28 (42) FLDTEFDD, // Loads the result of the 2nd derivative of an external function onto the stack
FSTPTEFDD //!< Loads the result of the 2nd derivative of an external function from the stack- 29 (43) FSTPTEFDD // Stores the result of the 2nd derivative of an external function from the stack
}; };
enum class ExpressionType enum class ExpressionType
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment