Accelerator Manual (G06.24+, H06.03+)
Accelerator Performance Issues
Accelerator Manual—527303-002
6-15
Minimizing Compatibility Traps
Detection Guideline
•
The Accelerator issues Note 7 for each SETE instruction it detects.
Note 7: SETE instructions appear in the following
procedure(s): '<proc name>' at offset(s): <address>
Examine each SETE instruction to see if it changes the RP field of the ENV
register.
Suggested Changes
•
Compiler-generated SETE instructions rarely cause transitions into TNS code.
•
Eliminate SETE instructions in TAL CODE statements that change the RP field.
Example
•
This code fragment disables overflow traps. The program does not make a
transition into TNS code because the SETE instruction does not change the RP
value.
CODE (RDE; ANRI %577; SETE); ! No transition into TNS code
Minimizing Compatibility Traps
Compatibility trap handlers are invisible system exception handlers that adjust the
results of certain otherwise incompatible TNS operations.
In nearly all cases, compatibility trap handlers do not significantly affect the
performance of accelerated programs. Accelerated code normally generates
compatibility traps on certain operations. (TNS object code executed on a TNS/R
system encounters the same compatibility traps.) These traps are expected, and often
require significant program revisions to be removed. Try to reduce the number of
compatibility traps for only the most performance-critical programs.
Odd-Byte References Traps
Odd-byte references to 2-byte words result in compatibility traps on TNS/R systems.
Odd-byte reference are made when the least significant bit (bit 31) of an extended
pointer is set and the pointer is used to access a variable or field larger than a byte.
TNS systems ignore bit 31 of an extended pointer and fetch data starting from the byte
prior to the addressed byte to ensure that the address is on a word boundary. On
TNS/R systems, a compatibility trap simulates this behavior, but only for 2-byte items.
The compatibility trap for this instruction simulation is about 90 times more expensive
than the well-aligned operation.
In TAL, data types stored as 2-byte words include INT and UNSIGNED(16). In C, data
types stored as 2-byte words include int, short, unsigned int, and unsigned short.