view · edit · print · history

What is the difference between a "soft-float" and "hard-float" compiler?

"float" refers to a floating point unit (FPU) in a CPU to do floating point math calculations. Some CPUs don't have a built in FPU but a lot of software requires the use of one. To achieve this on a platform without a FPU you can use an emulator. There are two types of emulation, one where the kernel will trap all the opcodes related to the FPU and then perform the calculations itself or one where you put the emulator into the application binary itself and it does it all internally.

The FPU emulators are architecture specific and the kernel based one for the ARM architecture is NWFPE (NetWinder Floating Point Emulator) which was written by NetWinder for their series of ARM based devices.

The user space emulation system is more efficient than the kernel space one due to not requiring the need to trap illegal instruction errors and then performing the requested calculation. Each time you issue a FP opcode, there will be a context switch which is expensive in terms of time and speed. Building the necessary code into the application binary itself however means it just calculates it directly without the need for the traps. The disadvantage however is that the FP code is built into each application and any non compliant applications won't be supported.

It is possible to use a kernel with NWFPE built in for all non softfloat binaries and have softfloat for everything else.

Example: Now you should understand better the following string when you compile codes for nslu2:


See this URL for futher details: http://linux-7110.sourceforge.net/howtos/netbook_new/x1109.htm

view · edit · print · history · Last edited by Ramiro.
Originally by tman.
Page last modified on June 14, 2006, at 11:50 AM