Next: , Previous: , Up: Assembler Instructions   [Contents][Index]


5.3.7 nop and nop1 Instructions

Mixed type instruction nop must have the corresponding instruction meta-class explicitly defined in the application program. The instruction is supposed to do nothing and not to change the outcome of the previous instruction invoked by a node. The instruction meta-class can be defined using the following block of code:

static QSMM_INSTR_META_CLASS(nop) {
    switch (qsmm_evt) {
        case QSMM_EVT_INSTR_CLASS_INIT:
            qsmm_set_eh_noutcome(qsmm,0);
            break;
    }
    return 0;
}

The instruction can be explicitly inserted into an assembler program after stt instructions where needed. The instruction can also be generated implicitly while assembling the program, in which case the corresponding warning will be produced.

Ideally, there should be no implicitly generated nop instructions in your assembler program. You have to analyze warnings produced while assembling and remove instructions, which do nothing useful, or insert stt instructions where needed, rearranging your program if necessary, or insert nop instructions into appropriate places explicitly.

Mixed type instruction nop1 is supposed to have a single outcome and do nothing. The instruction meta-class can be defined using the following block of code:

static QSMM_INSTR_META_CLASS(nop1) {
    return 0;
}

This instruction (instead of a nop instruction) can be explicitly inserted after an stt instruction when there is no need to preserve the outcome of the previous instruction invoked by a node and the outcome should be reset to 0. The use of the nop1 instruction instead of the nop instruction reduces the number of profile probabilities written to the state transition matrix, making it simpler and decreasing the amount of memory needed to store the matrix (if map storage is used). This instruction can be generated by the disassembler at the beginning of an assembler program.


Next: , Previous: , Up: Assembler Instructions   [Contents][Index]