English
Language : 

DS693 Datasheet, PDF (8/13 Pages) Xilinx, Inc – Integrated into Xilinx Embedded Development Kit
LogiCORE IP Virtex-5 APU Floating-Point Unit (v1.01a)
• Imprecise Non-Recoverable mode has a reduced issue rate but still supports the pipelining of instructions.
Exceptional conditions will cause a program interrupt to occur, but the instruction at which the interrupt is
taken will not necessarily be the instruction that caused the exception. Furthermore, there is no way to tell
which instruction did cause the exception.
• Imprecise Recoverable mode is treated the same as Precise mode.
• Precise mode disables instruction pipelining; each instruction is completed before the following instruction is
started. This reduces performance substantially, but guarantees that any interrupt arising will be taken at
precisely the instruction that caused the exceptional condition. This may be useful for debugging purposes.
Software Support
The EDK compiler system, based on the GNU Compiler Collection (GCC), provides support for the APU
Floating-Point Unit. It generates code that is compliant with the standard PowerPC Processor Embedded
Applications Binary Interface (EABI). Within the EDK framework, compiler flags are automatically added to the
GCC command line based on the type of FPU present in the system. The ANSI C data types float and double are
recognized and interpreted as specified in Table 2.
Table 2: Compiler Flags for Floating-Point Unit Support
FPU Variant
Compiler Flag
Single precision
Double precision
-mfpu=sp_full
-mfpu=dp_full
Floating-point Representation
float
double
32-bit
64-bit (SW)
32-bit
64-bit
For the single-precision FPU, all double-precision operations are emulated in software. For the double-precision
FPU, all single-precision operations are carried out using the hardware’s double-precision operators, as described
above in Floating-Point Status and Control Register, page 7.
Also, be aware that the xil_printf() function does not support floating-point output. The standard C library
printf() and related functions do support floating-point output, but are large (sometimes too large for a
small-footprint embedded system).
Libraries and Binary Compatibility
There are some subtleties surrounding the linking of object code compiled with the various flags described above.
These can be summed up by the following observations:
Figure Top x-ref 1If two object files were compiled with different FPU compiler flags, the object code resulting from linking the two together may contain any floating-point instruction permitted by either flag.
• If hardware floating-point support for a particular precision is not available, the compiler will ensure that
values of that type are passed to emulation routines on the stack.
• Otherwise, if support is present, these values will be passed in floating-point registers.
When compiling a monolithic application, there are no issues since the same compiler flags are used for every file.
However, when performing separate compilation, or linking against pre-compiled libraries, these object-code
differences can cause problems. A mismatch in parameter-passing semantics can cause functions to receive
incorrect values. Issuing unsupported instructions, or issuing any floating-point instructions when the APU
interface is not enabled, causes undefined behavior. In general, it is not possible to detect these problems until
run-time.
The modified GNU C compiler framework supplied with the FPU includes multiple pre-compiled versions of the
C runtime libraries (libxil and others). The linker will choose the appropriate library to link against according to the
FPU compiler flag used to build the top-level application. No user intervention is required. For all other cases where
DS693 March 1, 2011
www.xilinx.com
8
Product Specification