Skip to main content.
Navigation:
DENX
>
PPCEmbedded
>
FloatingPoint
Translations:
Edit
|
Attach
|
Raw
|
Ref-By
|
Printable
|
More
PPCEmbedded
Sections of this site:
DENX Home
|
DULG
|
ELDK-5
|
Know
|
Training
|
U-Boot
|
U-Bootdoc
Topics
PPCEmbedded Home
Changes
Index
Search
Go
List of pages in PPCEmbedded
Search
%SECTION0{name=FloatingPoint}% Floating Point Some of the embedded PowerPC processors do not have a floating point unit(FPU), and so must perform all floating point operations in software. Others do have a hardware FPU unit and may perform operations in hardware. %SECTION1{name=Software}% Software If your application has very intensive floating point requirements, you may need to switch to fixed point or choose a target processor which does have an FPU. Floating point can be performed either by instruction emulation in the kernel, or by compiling _everything_ with =-msoft-float=. In particular, it's important that all the libraries, whether dynamically or statically linked are compiled with the same options as the binaries that use them. Unless you're using a toolkit where this has already been done for you, this will generally mean that if you wish to use =-msoft-float= to gain maximum performance, you need to (re)compile _everything_, including: * All static and shared libraries * The compiler's internal libraries, such as :libgcc.a: * All executables You will almost certainly not get this right first time. The primary symptom is that *printf* gives bogus numbers for simple floating point values.However, if you succeed, you can save space by configuring the kernel without floating point emulation. See [[http://lists.linuxppc.org/listarcs/linuxppc-embedded/199911/msg00056.html]] To add kernel math emulation to the 2.2.13 kernel, see [[http://lists.linuxppc.org/listarcs/linuxppc-embedded/199912/msg00017.html]] The "paranoia" test should give no complaints if everything is working correctly. See [[http://www.enseeiht.fr/NetLib/paranoia/index.html]] %SECTION1{name=Hardware}% Hardware If your =CPU= has an =FPU=, you'll want to use it. Make sure that everything is consistently compiled for hardware floating point, especially if you've assembled your toolkit yourself, or are using an 8xx toolkit to compile for the 8260. Programs compiled for hardware floating point can still run on a =CPU= without an =FPU=, provided the kernel is built with the floating point instruction emulator. This incurs a further performance penalty on =CPUs= lacking an =FPU=. %SECTION1{name=Mixed}% Mixed If you are using a single set of shared libraries, you cannot mix the two techniques in the one system. If you link statically or try _really_ hard by creating two sets of shared libraries, the two can co-exist since programs compiled with =-msoft-float= never generate floating point instructions requiring kernel emulation. In general, you're better off choosing one or the other, and choosing hardware floating point with kernel instruction emulation is much easier to get working correctly.
13. Root Filesystem
1. Introduction
15. Realtime Response
Prev
Home
Next