Accelerator Manual (G06.24+, H06.03+)
Accelerator Performance Issues
Accelerator Manual—527303-002
6-12
SETP State Machines
The following procedure causes a transition into TNS code because it delays storing
the function’s return result value:
INT PROC driver;
BEGIN
STACK Table_drive; ! Table_drive returns an INT value
CODE (DPCL);
?RP = 0 ! Transition into TNS object code
... ! Do some work
RETURN; ! The result from DPCL Table_Drive
END;
The procedure Driver returns a value left untouched in the register stack from the
dynamically called procedure. The TAL ?RP=0 directive does not emit an instruction,
so it is not seen by the Accelerator. This instruction does not store or manipulate the
returned value on the register stack. To ensure that this code fragment does not cause
a transition into TNS code, you must recode.
You do not need to change this type of code for performance reasons if:
•
There are few instructions between the CODE and RETURN statements.
•
The Accelerator does not issue messages stating that it cannot correctly determine
the value of RP for the procedure.
This program is the same as the previous example, except that the program code has
been changed to return in accelerated code even though it still delays storing the
function return result value:
INT PROC driver;
BEGIN
STACK Table_drive;
CODE (DPCL);
CODE (STRP 0); ! Return in accelerated code
... ! Do some work
RETURN; ! The result from DPCL Table_Drive
END;
This DPCL returns in accelerated code because the Accelerator statically predicts the
return RP value of zero from the STRP 0 instruction.
SETP State Machines
State machines implemented with a SETP instruction in TAL CODE statements can
cause transitions into TNS code unless the program meets both of the following
conditions:
•
The Inspect symbols region is present.
•
The “action” statements are marked by user-defined labels in the source code and
the register stack is empty at execution time (RP=7).