Object Code Accelerator Manual

Preparing Programs for Acceleration
Object Code Accelerator Manual528144-003
3-2
C Function Prototypes
C Function Prototypes
The C/C++ compiler uses function prototypes to determine the return value size for
calls to routines declared in separate modules or to routines declared later in the same
module. If you do not specify a function protoype, the C/C++ compiler assumes the
function returns an INT value. On the TNS architecture, the object code runs correctly
if either the function returns an INT value or no value. OCA generates code that
assumes that the function returns an INT value. In most cases, OCA can process
object files compiled without C/C++ function prototypes, but the resulting accelerated
object code is often inefficient and makes numerous transitions into executing TNS
code. If possible, use C/C++ function prototypes for all of your C/C++ routines.
Binder and Inspect Symbols Regions
OCA uses information from the Binder region and the Inspect symbols region of an
object file to help perform control-flow analysis and optimizations. It can process most
files without this information, but the resulting accelerated object code is often
inefficient and makes numerous transitions into executing TNS code. If possible,
accelerate object files that contain the Binder and Inspect symbols regions. After
accelerating a program, you can strip the symbols region from it without impacting
performance.
Variances in Accelerated Code
This section describes the variances between TNS and TNS/E systems that apply to
accelerated object code. Check your programs for variances in:
Trap handlers that use the ENV register
Passing parameters in registers
The arithmetic left-shift sign bit
Non-standard procedure call or return RP values
The relationship between the global and local data blocks
Procedure name conflicts
Trap Handlers Using the ENV Registers
The value of ENV.RP is undefined for accelerated programs. For compatibility with
TNS processors, your trap handlers must set ENV.RP to 7 if they resume execution
from a trap to a global restart point.
The condition codes N, Z, and K are undefined for traps that occur when executing
accelerated object code. Do not write trap handlers that:
Base their decisions on these register values
Resume to points that expect these register values to be valid