Forum Discussion
Altera_Forum
Honored Contributor
12 years agousing the FPU on Cortex A9
Hello, I'm trying to use the FPU in my baremetal project. I use the ARM DS-5 (altera edition) with the DS5-GCC. I try to compile a simple project with the following options: -mf...
Altera_Forum
Honored Contributor
12 years agoI found Bare metal example in altera\13.1\embedded\ds-5\examples\bare-metal_boards_examples.zip and when I added simple code to test how compiler interprets operations on doubles:
double a = 5.211312;
double b = 12.2131;
b = b + 1232.21321;
Disassembly looks like this: S:0xFFFF00D4 : VMOV.F64 d9,d0
S:0xFFFF00D8 : VLDR d0,
S:0xFFFF00DC : VMOV.F64 d8,d0
S:0xFFFF00E0 : VLDR d0,
S:0xFFFF00E4 : VADD.F64 d0,d8,d0
S:0xFFFF00E8 : VMOV.F64 d8,d0
S:0xFFFF00EC : VMUL.F64 d1,d9,d8
S:0xFFFF00F0 : VMOV.F64 d0,d1
S:0xFFFF00F4 : VMOV r2,r3,d0
You can see that complier uses FPU instructions. If you want to test it on your code, compiler has following settings: armcc --c99 -O0 --cpu=Cortex-A9 -g -c -o"hello.o" "../hello.c"