Specifications
SPE, but there are no special FP registers available as on a normal FPU, so General Purpose Registers
must be used for passing of FP operands. While this is still much faster than pure soft-float emulation,
it is missing the advantages and the speed of a full-blown, separate standard FPU with a full FP
register set.
Also, your tool chain needs to be aware of this feature, and must contain support for it. Eventually
special compiler options are needed - check your documentation.
With the ELDK, the needed settings are automatically pre-set when you just chose the correct target
architecture packages, cf. 3.4. Supported Target Architectures
To test what your tool chain is doing, you best compile a smal test program and check the generated
code. The following examples were done with ELDK 4.2 for Power Architecture® targets:
Test Program:
$ cat fp_test.c
double foo (double x, double y)
{
double z;
z = (x + y) / (x * y);
return z;
}
1.
Build for normal FPU support (using the ppc_6xx target architecture):
$ export CROSS_COMPILE=ppc_6xx-
$ ppc_6xx-gcc -S -O fp_test.c
Check results:
$ cat fp_test.s
.file "fp_test.c"
.section ".text"
.align 2
.globl foo
.type foo, @function
foo:
fadd 0,1,2
fmul 1,1,2
fdiv 1,0,1
blr
.size foo, .-foo
.ident "GCC: (GNU) 4.2.2"
.section .note.GNU-stack,"",@progbits
The use of floating point machine instructions ("fadd", "fmul", "fdiv") and the fact that no
additional register use is needed is a clear indication that full support for the hardware FPU is
available in this configuration.
2.
Build for soft-float emulation (using the ppc_8xx target architecure):
$ export CROSS_COMPILE=ppc_8xx-
$ ppc_8xx-gcc -S -O fp_test.c
$ cat fp_test.s
.file "fp_test.c"
.globl __adddf3
.globl __muldf3
.globl __divdf3
.section ".text"
.align 2
3.
14.1.9. How can I check if Floating Point support is working? 156