EasyManua.ls Logo

Intel i960 - Local Variable Promotion

Intel i960
347 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Optimization
11-17
11
Local Variable Promotion
The compiler promotes a local variable to a register location when the
variable's address is not taken and its storage class is
auto or register.
Local variables stay in their register location through the life of the
function. Optimization level
0 suppresses local variable promotion and
assigns all variables with
auto storage class to stack locations.
Register Management
The register allocator phase of the compiler assigns all register operands to
the physical registers. For the KB/SB processors, the physical registers
available for assignment include the four floating-point registers. For all
i960 processors, the physical general-purpose registers available for
assignment include
r3 through r15, g0 through g11, and g13. You must
specify the compiler option for position-independent data (gcc960’s
mpid
or mpid-safe option or ic960’s Gpd or Gpr option) to make g12
unavailable for assignment. Due to the standard calling conventions, g14
is not available for register-operand assignment.
Register Spilling
Portions of the compiler that run before register allocation can produce
code that needs more physical registers than are available in the processor.
The register allocator must fit each function's arbitrarily large burden of
register demands into the physical registers implemented in the hardware.
To allocate available registers, the compiler must reuse each physical
register many times.
When the physical registers cannot meet the demands of a particular
function, the register allocator must insert a sequence of instructions,
known as spill code, to transfer long-lived values from some of the
registers in order to free the registers for more immediate demands.

Table of Contents

Related product manuals