From: Pete L. <pet...@st...> - 2002-04-03 15:21:54
|
Hi All, Hopefully a quick question. I'm compiling two files, one a C file and one a CPP file. There is a single function in both files, see below for the compilation flags and resulting assembly. It looks like the g++ compiler (3.0.3) ignores the -nofpu flag, is this the expected behavior of the g++ compiler? thanks for your time - pete void CFileUsingFloat(void) { union{float f; int i;}tmpFloat; tmpFloat.f = sqrt(4.0); } sh4-linux-gcc -O2 -fno-rtti -fno-exceptions -fno-gnu-linker -Wstrict-prototy pes -fomit-frame-pointer -fno-strict-aliasing -pipe -fno-strength-reduce -D__KERNEL__ -DLINUX -D_LINU X_COMP_ -D_PCI_DRIVER -ml -m4-nofpu -mno-implicit-fp -DCPU=sh4 -DMODULE -c - o fp_testc.o fp_testc.c 000000e0 <CFileUsingFloat>: e0: 03 d1 mov.l f0 <CFileUsingFloat+0x10>,r1 ! 0x0 e2: 04 d5 mov.l f4 <CFileUsingFloat+0x14>,r5 ! 0x40100000 e4: 22 4f sts.l pr,@-r15 e6: 0b 41 jsr @r1 e8: 00 e4 mov #0,r4 ea: 26 4f lds.l @r15+,pr ec: 0b 00 rts ee: 09 00 nop f0: 00 00 .word 0x0000 f2: 00 00 .word 0x0000 f4: 00 00 .word 0x0000 f6: 10 40 dt r0 f8: 09 00 nop fa: 09 00 nop fc: 09 00 nop fe: 09 00 nop void CPPFileUsingFloat(void) { union{float f; int i;}tmpFloat; tmpFloat.f = sqrt(4.0); } sh4-linux-g++ -O2 -fno-rtti -fno-exceptions -fno-gnu-linker -Wstrict-prototy pes -fomit-frame-pointer -fno-strict-aliasing -pipe -fno-strength-reduce -D_ _KERNEL__ -DLINUX -D_LINUX_COMP_ -D_PCI_DRIVER -ml -m4-nofpu -mno-implicit-f p -DCPU=sh4 -c -o fp_testcpp.o fp_testcpp.cpp 000001c0 <CPPFileUsingFloat>: 1c0: 04 d1 mov.l 1d4 <CPPFileUsingFloat+0x14>,r1 ! 0x0 1c2: 22 4f sts.l pr,@-r15 1c4: 04 c7 mova 1d8 <CPPFileUsingFloat+0x18>,r0 1c6: 09 f5 fmov @r0+,fr5 1c8: 0b 41 jsr @r1 1ca: 09 f4 fmov @r0+,fr4 1cc: 26 4f lds.l @r15+,pr 1ce: 0b 00 rts 1d0: 09 00 nop 1d2: 09 00 nop ... 1dc: 00 00 .word 0x0000 1de: 10 40 dt r0 |