I am currently working with the ARM GNU toolchain V 3.-1 provided by logicpd. I have encountered the following problems
1) The compiler does not accept the option -mfpu=vfp. What option do I need for the compiler to use vfp?
2)I tried compiling my code with the compiler option --msoft-float but looking at the disassembled code, the floating point functions do not seem to be called. Below are the options passed to gcc and part of the disassembled code. Any ideas on this?
---- gcc command ----------------
arm-elf-cpp -P -D_ASM_ -DBASE_ADDRESS=0x80000000+0x00100000 -DMEMAP_BASE_SDRAM=0x80000000 -DBOOTFLASH_PHYS_BASE=0xA0000000 -DLOGIC_CARDENGINE_IMX31_10 -DCONFIG_IN_FLASH=0 api.lds.S > api.lds
arm-elf-gcc -mcpu=arm1136jfs -mlittle-endian -fno-omit-frame-pointer -msoft-float -fno-builtin -O3 -Wall -g -ggdb -DBASE_ADDRESS=0x80000000+0x00100000 -DMEMAP_BASE_SDRAM=0x80000000 -DBOOTFLASH_PHYS_BASE=0xA0000000 -DLOGIC_CARDENGINE_IMX31_10 -DCONFIG_IN_FLASH=0 -fno-builtin -nostdlib -N -o speedtest.elf -T api.lds src/main.o src/utilities.o -lm -lc -lgcc
mv speedtest.elf speedtest_debug.elf
cp speedtest_debug.elf speedtest_strip.elf
arm-elf-strip speedtest_strip.elf
arm-elf-objcopy -O binary speedtest_strip.elf speedtest_strip.raw
-- dissassemble dump ---------
8010035c <__ieee754_sqrt>:
8010035c: e3c02102 bic r2, r0, #-2147483648 ; 0x80000000
80100360: e1a02a22 mov r2, r2, lsr #20
80100364: e3a0347f mov r3, #2130706432 ; 0x7f000000
80100368: e1a0c00d mov ip, sp
8010036c: e283360f add r3, r3, #15728640 ; 0xf00000
80100370: e1a02a02 mov r2, r2, lsl #20
80100374: e92ddff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, ip, lr, pc}
..........
801003a0: 0a000050 beq 801004e8 <__ieee754_sqrt+0x18c>
801003a4: e3500000 cmp r0, #0 ; 0x0
801003a8: da000067 ble 8010054c <__ieee754_sqrt+0x1f0>
801003ac: e1b04a4c movs r4, ip, asr #20
801003b0: 0a000038 beq 80100498 <__ieee754_sqrt+0x13c>
801003b4: e3cc34ff bic r3, ip, #-16777216 ; 0xff000000
801003b8: e2444fff sub r4, r4, #1020 ; 0x3fc
801003bc: e3c3360f bic r3, r3, #15728640 ; 0xf00000
801003c0: e2444003 sub r4, r4, #3 ; 0x3
801003c4: e3140001 tst r4, #1 ; 0x1
801003c8: e383c601 orr ip, r3, #1048576 ; 0x100000
801003cc: 108c3fae addne r3, ip, lr, lsr #31
..........
80100420: 1afffff5 bne 801003fc <__ieee754_sqrt+0xa0>
80100424: e3a02102 mov r2, #-2147483648 ; 0x80000000
80100428: ea000007 b 8010044c <__ieee754_sqrt+0xf0>
.........
801004e8: e1a03001 mov r3, r1
801004ec: e1a02000 mov r2, r0
801004f0: eb000112 bl 80100940 <__muldf3>
801004f4: e1a03007 mov r3, r7
801004f8: e1a02006 mov r2, r6
801004fc: eb00002e bl 801005bc <__adddf3>
..........
80100554: 1a000000 bne 8010055c <__ieee754_sqrt+0x200>
80100558: e89daff0 ldmia sp, {r4, r5, r6, r7, r8, r9, sl, fp, sp, pc}
8010055c: e3500000 cmp r0, #0 ; 0x0
80100560: aaffff91 bge 801003ac <__ieee754_sqrt+0x50>
80100564: e1a03001 mov r3, r1
80100568: e1a02000 mov r2, r0
8010056c: eb000011 bl 801005b8 <__subdf3>
80100570: e1a03001 mov r3, r1
80100574: e1a02000 mov r2, r0
80100578: eb0001b5 bl 80100c54 <__divdf3>
8010057c: e89daff0 ldmia sp, {r4, r5, r6, r7, r8, r9, sl, fp, sp, pc}
|