Accelerator Manual (G06.24+, H06.03+)

Accelerator Performance Issues
Accelerator Manual527303-002
6-14
SETE Instructions
table and the next state. The SETP instruction transfers control to the dynamically
fetched location.
?SYMBOLS
CODE ( SETP );
RETURN;
! No static flow control is visible below
! this point without the symbols region
! The "action" routines
action 1: ...;
action 2: ...;
action 3: ...;
! The state table
States:
! ActionStmt NextState
St0: CODE ( CON @action1; CON @St2 );
St1: CODE ( CON @action2; CON @St0 );
St2: CODE ( CON @action3; CON @St1 );
This SETP state machine stays in accelerated code because each “action” statement
starts with a label found in the Inspect symbols region, and the register stack is empty
(RP=7) at those points. The Accelerator marks the labeled locations as register-exact
points for the SETP instruction to resume execution.
The P-relative state table’s CODE (CON @label) statements do not help the
Accelerator to find action statements in this example. Typically, the addresses of the
CON @label statements are computed dynamically in the CODE statements before the
SETP, and the results of dynamic computations are not visible to the Accelerator.
Jumps to labeled targets should not compute dynamically the address of the targeted
TNS instruction (“action1,” “action2,” “action3” in the example above) in programs
without an Inspect symbols region. The following example computes the destination of
the SETP dynamically rather than denoting it with a simple label, so the SETP causes
a transition into TNS code.
STACK rel^to^absolute^P (@state + nextstate*8);
CODE (SETP);
SETE Instructions
Dynamically changing RP (the register stack pointer) with the SETE instruction (Set
Environment instruction) might cause a transition into TNS code. A program makes a
transition into TNS code if a SETE instruction changes the value of RP to a value
different from the value statically predicted by the Accelerator. Programs rarely use
SETE instructions to change the RP field dynamically. Most compiler-generated SETE
instructions do not cause transitions into TNS code.