Unifying the x86 FPU register sets
Mark Kettenis
kettenis@wins.uva.nl
Thu Oct 21 06:34:00 GMT 1999
Date: Thu, 21 Oct 1999 07:43:54 -0400
From: Eli Zaretskii <eliz@gnu.org>
> You'll also notice that all the other
> i386 ports (including Linux) have a 96-bit `long double'. In other
> words `sizeof (long double)' is 12.
A `long double' on x86 is always 10 bytes; sizeof reports 12 because
of alignment considerations. The extra 2 bytes are junk and will
never be used by any FP instruction.
Indeed. But we're not alone in this respect. The m68881, i960,
m88110 and arm extended floating point types are all 80-bit types that
actually use 96-bits and contain 16 unused bits. By having
#define TARGET_LONG_DOUBLE_BIT 80
as `tm-linux.h' does, we're disabling a lot of the code already
contained in GDB that deals with the `long double' type.
Note that in `tm-go32.h' there is a
#undef TARGET_LONG_DOUBLE_BIT
#define TARGET_LONG_DOUBLE_BIT 96
So DJGPP is already treating the 80-bit extended types as a 96-bit
type.
I'm proposing that all i386 systems that switch to the new common
floating point register layout that somehow support `long double',
shoule have
#define TARGET_LONG_DOUBLE_BIT 96
#define TARGET_LONG_DOUBLE_FORMAT &floatformat_i387_ext
in their `tm-xxx.h' file and
#define HOST_LONG_DOUBLE_FORMAT &floatformat_i387_ext
in their `xm-xxx.h' file.
Then it will be very easy to support the i387 data registers as `long
doubles' on hosts that have an equivalent type, without the LD_387
kludge that's now used by DJGPP and Linux/i386.
Mark
More information about the Gdb
mailing list