ARM Linux uses software floating-point linkage, where floating-point arguments are passed in integer registers even if functions themselves perform operations in hardware VFP registers.
When building ARM Linux applications with the --arm_linux
or --arm_linux_paths
compiler command-line options, the default is always software floating-point linkage even if you specify a CPU that implies an FPU.
For example, if you specify a --cpu
that implies an FPU, such as ARM1136JF-S or Cortex-A9, the compiler defaults to --fpu=softvfp+vfp
rather than --fpu=vfp
. --fpu=softvfp+vfp
is equivalent to the GCC -mfloat-abi=softfp
command-line option.
If you specify a --cpu
that does not imply an FPU, you must explicitly specify --fpu=softvfp+vfp
to use VFP.
You can override these explicitly to use hardware or software floating point variants of the Procedure Call Standard by specifying --apcs=/hardfp
or --apcs=/softfp
respectively. If using GCC emulation, the corresponding options are:
-mfloat-abi=hard
, to compile for hardware FPU with hardware linkage
-mfloat-abi=softfp
, to compile for hardware FPU but with software linkage
-mfloat-abi=soft
, to compile without hardware FPU instructions being used.
Compiler Reference:
--apcs=qualifer...qualifier
--arm_linux
--arm_linux_paths
--fpu=name.
Assembler Reference:
--apcs=qualifier…qualifier
--fpu=name.