An instruction class sequence is a special kind of instruction class. An instruction class sequence consists of two or more previously registered individual instruction classes. The number of outcomes of an instruction class sequence is equal to the number of outcomes of its last instruction class.
You can register an instruction class sequence by the function qsmm_reg_instr_class_seq described below.
The node assembler uses that function to automatically register instruction class sequences found in an assembler program.
See Loading a Parsed Program into a Node, for a description of qsmm_node_asm function implementing the node assembler.
int qsmm_reg_instr_class_seq (qsmm_t model, const char *instr_class_set_name, int rez1, const qsmm_sig_t *elm_p, size_t n_elm, qsmm_sig_t *instr_class_p) ¶This function registers an instruction class sequence as an element of instr_class_set_name instruction class set in a multinode model. An array of instruction class indices elm_p containing n_elm elements specifies the instruction class sequence. The argument rez1 is for future use and must be equal to 0.
On success, the function returns a non-negative value and sets *instr_class_p to an instruction class index identifying a registered instruction class sequence if instr_class_p is not NULL.
On failure, the function returns a negative error code.
Currently, the function can return the following error codes.
QSMM_ERR_INVALThe argument n_elm is less than 2, or an element of elm_p array is greater than or equal to the number of instruction classes in the instruction class set instr_class_set_name.
QSMM_ERR_NOTFOUNDThe instruction class set instr_class_set_name does not exist.
QSMM_ERR_TYPEAn entity named instr_class_set_name is not an instruction class set—the entity is an instruction meta-class, or an element of elm_p array is the index of an instruction class sequence rather than an individual instruction class.
QSMM_ERR_EXISTThe instruction class set instr_class_set_name already contains the instruction class sequence.
QSMM_ERR_UNTIMELYRegistering an instruction class sequence requires increasing the number of output signals of an existing instruction emitting engine represented by a large actor, and it has created a default output signal choice tree. See Number of Output Signals, for cases when a large actor creates a default output signal choice tree.
QSMM_ERR_ILSEQUnable to convert a multibyte string to a wide string or vice versa according to a current locale.
QSMM_ERR_NOMEMThere was not enough memory to perform the operation.
Use the following function to get a list of individual instruction classes comprising an instruction class sequence.
int qsmm_get_instr_class_seq (qsmm_t model, const char *instr_class_set_name, unsigned int flags, qsmm_sig_t instr_class, const qsmm_sig_t **elm_pp, size_t *n_elm_p) ¶This function retrieves a list of individual instruction classes comprising an instruction class sequence in an instruction class set instr_class_set_name in a multinode model. An instruction class index instr_class identifies the instruction class sequence in the instruction class set.
The function sets *elm_pp to address an array of indices of individual instruction classes comprising the instruction class sequence and sets *n_elm_p to the number of elements in the array.
If flags do not contain bitmask QSMM_EXCEPT_TYPE, and instr_class is the index of an individual instruction class rather than an instruction class sequence, the function sets *elm_pp to NULL and *n_elm_p to 0 and reports success.
If elm_pp or n_elm_p is NULL, the function does not set *elm_pp or *n_elm_p respectively.
If flags contain bitmask QSMM_EXCEPT_TYPE, and instr_class is the index of an individual instruction class rather than an instruction class sequence, the function reports QSMM_ERR_TYPE.
The function returns a non-negative value on success or a negative error code on failure. Currently, the function can return the following error codes.
QSMM_ERR_INVALThe argument instr_class is greater than or equal to the number of instruction classes in the instruction class set instr_class_set_name.
QSMM_ERR_NOTFOUNDThe instruction class set instr_class_set_name does not exist.
QSMM_ERR_TYPEAn entity named instr_class_set_name is not an instruction class set—the entity is an instruction meta-class, or flags contain bitmask QSMM_EXCEPT_TYPE, and instr_class is the index of an individual instruction class rather than an instruction class sequence.
Use the following function to find the index of an already registered instruction class sequence by a list of individual instruction classes it contains.
int qsmm_find_instr_class_seq_in_set (qsmm_t model, const char *instr_class_set_name, unsigned int flags, const qsmm_sig_t *elm_p, size_t n_elm, qsmm_sig_t *instr_class_p) ¶This function finds an instruction class sequence in an instruction class set instr_class_set_name in a multinode model by an array of indices of individual instruction classes comprising the instruction class sequence. The arguments elm_p and n_elm specify the address of the array and the number of elements in it respectively.
If flags contain bitmask QSMM_EXCEPT_NOTFOUND, and the instruction class sequence not found in the instruction class set, the function reports QSMM_ERR_NOTFOUND.
On success, the function returns a non-negative value and sets *instr_class_p if instr_class_p is not NULL.
If the instruction class sequence found in the instruction class set, the function sets *instr_class_p to an instruction class index identifying the sequence.
If the instruction class set exists, but the instruction class sequence not found in it, and flags do not contain QSMM_EXCEPT_NOTFOUND, the function sets *instr_class_p to QSMM_SIG_INVALID.
On failure, the function returns a negative error code. Currently, the function can return the following error codes.
QSMM_ERR_INVALThe argument n_elm is less than 2, or an element of elm_p array is greater than or equal to the number of instruction classes in the instruction class set instr_class_set_name.
QSMM_ERR_NOTFOUNDThe instruction class set instr_class_set_name does not exist, or the instruction class sequence not found in the instruction class set.
In the latter case, the function reports this error if flags include bitmask QSMM_EXCEPT_NOTFOUND;
otherwise, the function sets *instr_class_p to QSMM_SIG_INVALID (if instr_class_p is not NULL) and returns a non-negative value.
QSMM_ERR_TYPEAn entity named instr_class_set_name is not an instruction class set—the entity is an instruction meta-class, or an element of elm_p array is the index of an instruction class sequence rather than an individual instruction class.
QSMM_ERR_ILSEQUnable to convert a multibyte string to a wide string or vice versa according to a current locale.
QSMM_ERR_NOMEMThere was not enough memory to perform the operation.