Hello,
Just to introduce the problem, here is a summary of what I have done.
I work on an Linux port on an ARM based hardware without hw floating point support
with the GNU toolchain.
I *finally* managed to compile the glibc 2.2.4 for an arm-linux configuration for
2.2.4 Kernel on a Linux host (2.2.14-5.0smp). I used binutils 2.11.2 and gcc 2.95.3.
The parameters I have used for configuration were the following:
configure \
arm-linux \
--build=i686-linux \
--prefix=$PREFIX/arm-linux \
--program-prefix=$PROGRAMDIR \
--enable-add-ons \
--enable-kernel=2.4.2 \
--with-headers=$KERNELINCLUDES \
--without-fp \
-v 2>&1 | tee configure.out
I first generated a glibc (just typing make, with the default Makefiles).
First problem, it seems that the --without-fp has not the expected effects, has the
generated libraries contained a lot of floating point instructions (it can be checked
by typing arm-linux-objdump -d)...
Then, I tried to pass explicitly -msoft-float to gcc as an argument, to ensure that no
fp instruction is used in the code generation. So I finally edited the Makeconfig file
to change the default arguments given to gcc (adding -msoft-float). I finally
managed to build the glibc (this noon).
Even if the process dramatically reduced the number of floating points instructions,
there are still a few ones...where they should not be (AFAIK)!!!
For example, in the library libm.a, there are 3 stf instructions.
arm-linux/lib/libm.a
290: adad51ec stfges f5, [sp, #944]!
308: bd241146 stflts f1, [r4, -#280]!
470: bd241146 stflts f1, [r4, -#280]!
I am quite confused !
I am wondering if I should have had generated gcc itsel with some kind of -msoft-float
option (it was generated with -nfp in the configuration script).
Maybe is it a gcc configuration bug ?
Has anyone information about this problem ?
Does anyone know where could I find a set of floating-point instructions library ?
Just for precision: actually, those instructions come from C code statements (return
calling a)
Example :
s_cbrt.o: file format elf32-littlearm
Disassembly of section .text:
00000000 <__cbrt>:
0: e1a0c00d mov ip, sp
4: e92ddbf0 stmdb sp!, {r4, r5, r6, r7, r8, r9, fp, ip, lr, pc}
8: e24cb004 sub fp, ip, #4 ; 0x4
double
__cbrt (double x)
{
...
...
return __ldexp (x > 0.0 ? ym : -ym, xe / 3);
generates the following code
220: e28f2088 add r2, pc, #136 ; 0x88
224: e892000c ldmia r2, {r2, r3}
228: e24bc030 sub ip, fp, #48 ; 0x30
22c: e89c0003 ldmia ip, {r0, r1}
230: ebfffffe bl 0 <__cbrt>
234: e3500000 cmp r0, #0 ; 0x0
238: e51b6028 ldr r6, [fp, -#40]
23c: ca000093 bgt 254 <__cbrt+0x254>
240: e1a01005 mov r1, r5
244: e1a00004 mov r0, r4
248: ebfffffe bl 0 <__cbrt>
24c: e1a05001 mov r5, r1
250: e1a04000 mov r4, r0
254: e1a00006 mov r0, r6
258: e3a01003 mov r1, #3 ; 0x3
25c: ebfffffe bl 0 <__cbrt>
260: e1a02000 mov r2, r0
264: e1a01005 mov r1, r5
268: e1a00004 mov r0, r4
26c: ebfffffe bl 0 <__cbrt>
270: ea0000ac b 2b8 <__cbrt+0x2b8>
274: 3fc29801 swicc 0x00c29801
278: e893366d ldmia r3, {r0, r2, r3, r5, r6, r9, sl, ip, sp}
27c: 3fe91e2a swicc 0x00e91e2a
280: 6fe7e984 swivs 0x00e7e984
284: bffd5ae6 swilt 0x00fd5ae6
288: cfa20f0c swigt 0x00a20f0c
28c: 40039350 andmi r9, r3, r0, asr r3
290: adad51ec stfges f5, [sp, #944]!
294: c000eb82 andgt lr, r0, r2, lsl #23
298: 77cd8d5d undefined
29c: 3ff8218d swicc 0x00f8218d
2a0: de9028b4 mrcle 8, 4, r2, cr0, cr4, {5}
2a4: 3fd6b69c swicc 0x00d6b69c
2a8: ba168ff2 blt 5a4278 <__cbrt+0x5a4278>
...
But the return statement contains a call (ldexp) which might be a macro calling a
macro calling a macro... that is maybe using assembler statement (???).
I'am still investigating...
Anyway, I don't think such statements should be allowed in a non floating point mode.
Thanks and regards,
Cyril Germond
Competence Center Platforms
PHILIPS Semiconductors Sophia
505, route des Lucioles
Sophia Antipolis - 06560 Valbonne - France
Tel +33 (0)4 92 96 83 63
Fax +33 (0)4 92 96 12 66
E-mail : [EMAIL PROTECTED]
_______________________________________________
http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
Please visit the above address for information on this list.