Re: [rfc] Add some more floatformat types ....

Mark Kettenis
2001-08-17T12:32:00Z

Date: Fri, 17 Aug 2001 12:12:48 -0400
From: Andrew Cagney <ac131313@cygnus.com>

Ah, ok, now I understand. So this means the original i386 did a 4:4:2
memory transfer when storing an extended float (long sigh)? The extra 2
bytes and the end of the `long double' always remaining undefined (long
double sigh)? I've been hacking sane hardware for too long.

I think it shows here that the predecessor of the i386 was a 16-bit
processor.

I think I'll clarify the `struct type . length' to:

``Length of storage for a value of this type. This is length of the type
and not the length of the value that resides within the type. An
i386-ext floating-point value, for instance, only occupies 80 bits of
what is typically a 96 bit `long double'.''

Sounds good to me. The key point here is that `struct type . length'
should match the debug info about the type.

I'll drop the i387_ext from the list of things to add to floatformat.h.

I assume you mean that you'll leave it as it is now ;-).

> I would simply introduce the builtin_type_i387_ext for the 80-bit
> floating point type and keep builtin_type_long_double for the 96-bit
> floating point type, both based on floatformat_i387_ext.
> register_virtual_type would then indeed return builtin_type_i387_ext
> for the floating-point registers.

Ok. The key thing here being that GDB gets two instead of one i387_ext
`struct type' (because the existing builtin_type_long_double can't
correctly describe an i387 register) which is really all I'm trying to
achieve.

Yep.

--

> The IA-64, for instance, has an 82 bit floating-point register. That
> register is always represented in memory as 128 bits.
Consequently, my
> proposal includes ia64_ext128 and not ia64_ext82.
>
> So we only need a single floatformat_ia64_ext. Why not keep the
> floatformat_ia64_ext that we already have in ia64-tdep.c and move it
> to ../libiberty/floatformat.c?

Dam! You spotted my cunning plan :-) That is one of the next steps.
In the light of the exchange above, a double check on this one is in order.

Seems the ia64 stuff is even more braindamaged than the i386 stuff.

Mark, this meaning that the ia64_ext should have a size of 128 and not
82 as it currently does in ia64-tdep.c?

I think so. (But I also think we should rename it to ia64_reg as
Kevin proposes).

Mark