EasyManua.ls Logo

Intel i960 - Specialized-Instruction Selection

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...
i960 Processor Compiler User's Guide
11-20
11
Specialized-instruction Selection
A number of i960 processor instructions can help optimize code in special
situations. The special code sequences recognized by the compiler, and
the replacements used are as follows:
A bitwise
or instruction for which one of the operands is a constant
with value 2
n
, for some
n
, can become setbit.
A bitwise
and instruction for which one of the operands is a constant
with value ~(2
n
), for some
n
, can become clrbit.
The i960 processor has a complete set of bitwise-boolean instructions.
The compiler takes advantage of this in translating expressions involving
bitwise-boolean operations in which the operands or the results are
negated. For example, the operations in the expression
~(a & b) become a
single
nand instruction. Similarly, (a | ~b) can use an ornot instruction.
Multiplication of an integer or unsigned integer by a constant power of 2
becomes a left-shift operation. Similarly, division of an integer or
unsigned integer by a constant that is a power of 2 becomes a right-shift
operation.
Program-level Optimization
After program development is complete, it is possible to use the compiler's
profile-driven optimizations to achieve the highest level of program
optimization, based on the program's execution-time profile.
Inter-module Function Inlining
Given program profile data describing the typical behavior of the program,
the compiler knows what functions the program calls, from which call
sites, and how many times calls are made. Intelligent decisions can be
made about which functions to inline at which specific call sites. If a

Table of Contents

Related product manuals