GR740-UM-DS, Nov 2017, Version 1.7
80
www.cobham.com/gaisler
GR740
7
Floating-point Control Unit
The GRFPU Control Unit (GRFPC) is used to attach the GRFPU to the LEON integer unit (IU).
GRFPC performs scheduling, decoding and dispatching of the FP operations to the GRFPU as well as
managing the floating-point register file, the floating-point state register (FSR) and the floating-point
deferred-trap queue (FQ). Floating-point operations are executed in parallel with other integer instruc-
tions, the LEON integer pipeline is only stalled in case of operand or resource conflicts.
Each of the four LEON4 processor cores in the system integrates a GRFPU control unit that connects
to one GRFPU unit per processor. Each processor has its own dedicated FPU.
7.1
Floating-Point register file
The GRFPU floating-point register file contains 32 32-bit floating-point registers (%f0-%f31). The
register file is accessed by floating-point load and store instructions (LDF, LDDF, STD, STDF) and
floating-point operate instructions (FPop).
7.2
Floating-Point State Register (FSR)
The GRFPC manages the floating-point state register (FSR) containing FPU mode and status infor-
mation. All fields of the FSR register as defined in SPARC V8 specification are implemented and
managed by the GRFPU conforming to the SPARC V8 specification and the IEEE-754 standard.
Implementation-specific parts of the FSR managing are the NS (non-standard) bit and
ftt
field.
If the NS (non-standard) bit of the FSR register is set, all floating-point operations will be performed
in non-standard mode as described in section 8.2.6. When the NS bit is cleared all operations are per-
formed in standard IEEE-compliant mode.
Following floating-point trap types never occur and are therefore never set in the ftt field:
- unimplemented_FPop: all FPop operations are implemented
- hardware_error: non-resumable hardware error
- invalid_fp_register: no check that double-precision register is 0 mod 2 is performed
GRFPU implements the
qne
bit of the FSR register which reads 0 if the floating-point deferred-queue
(FQ) is empty and 1 otherwise.
The FSR is accessed using LDFSR and STFSR instructions.
7.3
Floating-Point Exceptions and Floating-Point Deferred-Queue
GRFPU implements the SPARC deferred trap model for floating-point exceptions (fp_exception). A
floating-point exception is caused by a floating-point instruction performing an operation resulting in
one of following conditions:
•
an operation raises IEEE floating-point exception (ftt = IEEE_754_exception) e.g. executing
invalid operation such as 0/0 while the NVM bit of the TEM field id set (invalid exception
enabled).
•
an operation on denormalized floating-point numbers (in standard IEEE-mode) raises unfin-
ished_FPop floating-point exception
•
sequence error: abnormal error condition in the FPU due to the erroneous use of the floating-
point instructions in the supervisor software.
The trap is deferred to one of the floating-point instructions (FPop, FP load/store, FP branch) follow-
ing the trap-inducing instruction (note that this may not be next floating-point instruction in the pro-
gram order due to exception-detecting mechanism and out-of-order instruction execution in the
GRFPC). When the trap is taken the floating-point deferred-queue (FQ) contains the trap-inducing
instruction and up to seven FPop instructions that were dispatched in the GRFPC but did not com-
plete.