Download report here - School of Computing Science

Transcript
which the Emotion Engine does not – then the odd register would be used for the lower half
of the double precision number, and the even register for the upper half. Since double
precision numbers are not supported in the Emotion Engine, the odd registers are never used,
and the compiler on the Playstation 2 will actually give an error if any attempts are made to
use these registers. The temporary registers behave in the same way as the MIPS temporary
registers, with respect to whether the calling or called procedure are responsible for saving the
registers value. Usage of the result and argument registers will be covered later in the section
on procedure call mechanisms.
In addition to the 32 general purpose registers, the FPU also has a single accumulator. This is
a special register, in that it only has a latency of one cycle, while other floating point
instructions have a latency of four cycles [11]. The latency of an instruction is the number of
cycles the processor must wait before using the result of an instruction. This means that a
sequence of say two floating point additions where the second addition needs the result of the
first will cause the floating point unit to wait for four cycles after the first instruction before
executing the second addition. The same sequence could be encoded using the accumulator
instead, and due to its low latency, the floating point unit would not have to wait after the first
instruction before executing the second [12]. It may be possible to include the accumulator in
the Playstation 2 machine specification and so long as the Vector Pascal Compilers optimiser
can keep the data in the accumulator after each operation, and not save it back to memory, as
it would without any optimisations, significant speedups in the code execution could be
possible.
Floating point control registers
The FPU can support up to 32 control registers, although only the first and last have been
implemented on the Playstation 2. All of the control registers are 32-bits wide. The first
control register is called the Implementation and Revision Register.
This holds the
implementation and revision numbers which can be queried to determine the capabilities of
the FPU, for example, there will be a bit to tell the programmer whether double precision
floating point numbers are supported or not. These are typically only used in diagnostic
software and will not be used in this project.
The last control register is called the Control/Status register. It contains a number of status
bits which can be used to determine the outcome of the last executed instruction. These bits
are separated into the cause flags and the sticky flags. The cause flags are:
- 22 -