problem with crosstool 0.28-pre28 supplied patch for gcc 3.3.[23] softfloat on ARM
Lennert Buytenhek
buytenh@wantstofly.org
Mon Aug 16 03:55:00 GMT 2004
On Mon, Aug 16, 2004 at 02:23:54AM +0200, Dimitry Andric wrote:
> I suppose this is what crosstool's patches/glibc-2.3.2/glibc-vfp.patch
> should fix. Are you sure it is applied correctly? It seems that
> glibc interprets the float endianness incorrectly, thus printing
> garbage.
OK, I think the kernel does it okay, at least for multiplies, because
I see this:
% cat x.c /tmp
#include <stdio.h>
#include <stdlib.h>
void dumpfloat(float x)
{
printf("%.8x\n", *((unsigned int *)&x));
}
int main()
{
volatile float x;
x = 6.66;
dumpfloat(x * x);
dumpfloat(6.66 * 6.66);
return 0;
}
Source snippet:
main:
@ args = 0, pretend = 0, frame = 4
@ frame_needed = 1, uses_anonymous_args = 0
mov ip, sp
stmfd sp!, {fp, ip, lr, pc}
sub fp, ip, #4
sub sp, sp, #4
ldr r3, .L5 @ float
str r3, [fp, #-16] @ float
ldfs f1, [fp, #-16]
ldfs f0, [fp, #-16]
fmls f0, f1, f0
stfs f0, [sp, #-4]!
ldr r0, [sp], #4
bl dumpfloat
ldr r0, .L5+4
bl printf
ldr r0, .L5+8 @ float
bl dumpfloat
ldr r0, .L5+4
bl printf
mov r3, #0
mov r0, r3
ldmfd sp, {r3, fp, sp, pc}
.L6:
.align 2
.L5:
.word 1087708856
.word .LC1
.word 1110535202
.size main, .-main
.ident "GCC: (GNU) 3.4.1"
Output on target:
[root@enp2611 tmp]# ./x
42316c22
42316c22
[root@enp2611 tmp]#
cheers,
Lennert
------
Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com
More information about the crossgcc
mailing list