[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] double and long double



Alan Hourihane wrote:
Notice the line that starts 0000060, which is the part I'm interested
in, in how the compiler shows "long doubles". It's obviously different,
and I'm not sure what format our m68k target is storing "long doubles"
in, but the coldfire it seems it's IEEE double, big endian.

$ m68k-atari-mint-gcc --version
m68k-atari-mint-gcc (GCC) 4.5.3 (MiNT 20110429)

$ cat td.c
float f;
double d;
long double ld;

$ m68k-atari-mint-gcc -S -o - tf.c -m68000
#NO_APP
.comm _f,4
.comm _d,8
.comm _ld,12

$ m68k-atari-mint-gcc -S -o - tf.c -mcpu=5475
#NO_APP
.comm _f,4
.comm _d,8
.comm _ld,8

Damn, you're right.

This is an incompatibility between the object files compiled for 68000 or ColdFire (anyway, they are incompatible). But the this time the differences produces incompatible data structures, this is annoying. Fortunately, the long double type is rarely used.

I think MiKRO is right.
The 68881 can handle 32, 64 or 96 bit floats.
The ColdFire FPU has only 32 and 64 bit.
I hope the encoding scheme for 32 and 64 bit for both processors are standard IEEE 754.

I have just checked, the standard m68k-elf-gcc has the same differences.

--
Vincent Rivière