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

Accelerator Performance Issues
Accelerator Manual527303-002
6-8
Recoding to Eliminate Transitions
Recoding to Eliminate Transitions
To eliminate these transitions into TNS code, you must recode your programs. These
transitions occur because of program constructs for which the Accelerator cannot
determine the value of the register pointer, RP, or the destination of a jump.
Far Jumps
Far jumps are jumps that modify the subroutine stack marker to return to a location
other than the call. Far jumps to ancestor routines are typically used in TAL and C
programs to specify where to go on an error condition. A program makes a transition
into TNS code when the target of a far jump is not a register-exact point.
FORTRAN programs can pass a label as a formal parameter. The Accelerator cannot
locate FORTRAN labels, so it cannot make them register-exact points for far jump
destinations. In FORTRAN programs, a control transfer to a label passed as a
parameter causes a transition into TNS object code.
The following examples illustrate the proper method to code far jumps in your
programs to avoid transitions into TNS code.
Examples
In the following TAL example, the Accelerator recognizes ErrorL as a register-exact
point for the return from the far jump because the Accelerator sees the reference
@ErrorL formed when calling the procedure setjump, and predicts that the register
stack is empty (RP=7) at label ErrorL.
STRUCT error^marker;
BEGIN
INT P, E, L;
END;
PROC setjump (where);
INT where;
BEGIN
INT my^PEL = 'L' - 2;
error^marker.P := where;
error^marker.E ':=' my^PEL[1] for 2 words;
END;
PROC longjump;
BEGIN
INT my^marker = 'L' - 2;
my^marker ':=' error^marker.P for 3 words;
RETURN;
END;
PROC driver MAIN;
BEGIN
INT x, y, x;
! Initialize ErrorL as a recovery point
CALL setjump ( @ErrorL );
! Lots of code
ErrorL: ! This is a register-exact point because