* [RFA]: fix ia64 long double support
@ 2003-12-04 22:37 J. Johnston
2003-12-05 0:50 ` Richard Henderson
2003-12-05 1:19 ` Kevin Buettner
0 siblings, 2 replies; 8+ messages in thread
From: J. Johnston @ 2003-12-04 22:37 UTC (permalink / raw)
To: gdb-patches; +Cc: Kevin Buettner
[-- Attachment #1: Type: text/plain, Size: 738 bytes --]
Fix to a couple of problems. First of all, we aren't setting up a long double
format for the architecture so it defaults to double when you try and print a
long double value via gdb.
Although the ia64 has a special long double format it specifies, this format is
only valid for register values. Values in memory use the x86 extended float
format which is 80 bits. Register long doubles are 82 bits (2 more bits of
exponent).
Anyway, this simple change fixes it so long doubles print correctly.
Ok to commit?
-- Jeff J.
2003-12-04 Jeff Johnston <jjohnstn@redhat.com>
* ia64-tdep.c (ia64_gdbarch_init): Set up the gdbarch long double
format to be the i387 extended float format which is used for
long double's in memory.
[-- Attachment #2: ia64-long-double.patch --]
[-- Type: text/plain, Size: 852 bytes --]
Index: ia64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ia64-tdep.c,v
retrieving revision 1.104
diff -u -p -r1.104 ia64-tdep.c
--- ia64-tdep.c 17 Nov 2003 21:38:36 -0000 1.104
+++ ia64-tdep.c 4 Dec 2003 22:29:43 -0000
@@ -3361,6 +3361,11 @@ ia64_gdbarch_init (struct gdbarch_info i
0, "builtin_type_ia64_ext", NULL);
TYPE_FLOATFORMAT (builtin_type_ia64_ext) = &floatformat_ia64_ext;
+ /* On the ia64, long double floats in memory are actually stored
+ in memory different than they are in registers. In memory,
+ they match the x86 extended float format which is 80-bits. */
+ set_gdbarch_long_double_format (gdbarch, &floatformat_i387_ext);
+
set_gdbarch_short_bit (gdbarch, 16);
set_gdbarch_int_bit (gdbarch, 32);
set_gdbarch_long_bit (gdbarch, 64);
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFA]: fix ia64 long double support
2003-12-04 22:37 [RFA]: fix ia64 long double support J. Johnston
@ 2003-12-05 0:50 ` Richard Henderson
2003-12-05 1:54 ` J. Johnston
2003-12-05 1:19 ` Kevin Buettner
1 sibling, 1 reply; 8+ messages in thread
From: Richard Henderson @ 2003-12-05 0:50 UTC (permalink / raw)
To: J. Johnston; +Cc: gdb-patches, Kevin Buettner
On Thu, Dec 04, 2003 at 05:37:41PM -0500, J. Johnston wrote:
> * ia64-tdep.c (ia64_gdbarch_init): Set up the gdbarch long double
> format to be the i387 extended float format which is used for
> long double's in memory.
This is os specific. HPUX uses ieee quad format.
r~
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFA]: fix ia64 long double support
2003-12-04 22:37 [RFA]: fix ia64 long double support J. Johnston
2003-12-05 0:50 ` Richard Henderson
@ 2003-12-05 1:19 ` Kevin Buettner
2003-12-05 1:52 ` J. Johnston
1 sibling, 1 reply; 8+ messages in thread
From: Kevin Buettner @ 2003-12-05 1:19 UTC (permalink / raw)
To: J. Johnston, gdb-patches; +Cc: Kevin Buettner
On Dec 4, 5:37pm, J. Johnston wrote:
> Fix to a couple of problems. First of all, we aren't setting up a long double
> format for the architecture so it defaults to double when you try and print a
> long double value via gdb.
>
> Although the ia64 has a special long double format it specifies,
> this format is only valid for register values. Values in memory use
> the x86 extended float format which is 80 bits. Register long
> doubles are 82 bits (2 more bits of exponent).
So what happens when we try to print a long double in a register?
> Anyway, this simple change fixes it so long doubles print correctly.
>
> Ok to commit?
Sure. I'm guessing that we still won't always print long doubles correctly,
but it looks like this gets us closer...
Kevin
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFA]: fix ia64 long double support
2003-12-05 1:19 ` Kevin Buettner
@ 2003-12-05 1:52 ` J. Johnston
2003-12-05 5:13 ` Kevin Buettner
0 siblings, 1 reply; 8+ messages in thread
From: J. Johnston @ 2003-12-05 1:52 UTC (permalink / raw)
To: Kevin Buettner; +Cc: gdb-patches
Kevin Buettner wrote:
> On Dec 4, 5:37pm, J. Johnston wrote:
>
>
>>Fix to a couple of problems. First of all, we aren't setting up a long double
>>format for the architecture so it defaults to double when you try and print a
>>long double value via gdb.
>>
>>Although the ia64 has a special long double format it specifies,
>>this format is only valid for register values. Values in memory use
>>the x86 extended float format which is 80 bits. Register long
>>doubles are 82 bits (2 more bits of exponent).
>
>
> So what happens when we try to print a long double in a register?
>
The routine ia64_register_type() returns builtin_type_ia64_ext for the
floating-point registers which is the 82-bit register variant.
>
>>Anyway, this simple change fixes it so long doubles print correctly.
>>
>>Ok to commit?
>
>
> Sure. I'm guessing that we still won't always print long doubles correctly,
> but it looks like this gets us closer...
>
> Kevin
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFA]: fix ia64 long double support
2003-12-05 0:50 ` Richard Henderson
@ 2003-12-05 1:54 ` J. Johnston
2003-12-05 5:18 ` Kevin Buettner
0 siblings, 1 reply; 8+ messages in thread
From: J. Johnston @ 2003-12-05 1:54 UTC (permalink / raw)
To: Richard Henderson; +Cc: gdb-patches, Kevin Buettner
Richard Henderson wrote:
> On Thu, Dec 04, 2003 at 05:37:41PM -0500, J. Johnston wrote:
>
>> * ia64-tdep.c (ia64_gdbarch_init): Set up the gdbarch long double
>> format to be the i387 extended float format which is used for
>> long double's in memory.
>
>
> This is os specific. HPUX uses ieee quad format.
>
>
> r~
>
The Intel doc doesn't differentiate for OS. Kevin, is this something we should
account for by calling a function in a native tdep file?
-- Jeff J.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFA]: fix ia64 long double support
2003-12-05 1:52 ` J. Johnston
@ 2003-12-05 5:13 ` Kevin Buettner
0 siblings, 0 replies; 8+ messages in thread
From: Kevin Buettner @ 2003-12-05 5:13 UTC (permalink / raw)
To: J. Johnston, Kevin Buettner; +Cc: gdb-patches
On Dec 4, 8:52pm, J. Johnston wrote:
> > So what happens when we try to print a long double in a register?
>
> The routine ia64_register_type() returns builtin_type_ia64_ext for the
> floating-point registers which is the 82-bit register variant.
Okay, cool.
(The patch is still approved.)
Thanks,
Kevin
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFA]: fix ia64 long double support
2003-12-05 1:54 ` J. Johnston
@ 2003-12-05 5:18 ` Kevin Buettner
2003-12-06 0:18 ` J. Johnston
0 siblings, 1 reply; 8+ messages in thread
From: Kevin Buettner @ 2003-12-05 5:18 UTC (permalink / raw)
To: J. Johnston, Richard Henderson; +Cc: gdb-patches, Kevin Buettner
On Dec 4, 8:54pm, J. Johnston wrote:
> Richard Henderson wrote:
> > On Thu, Dec 04, 2003 at 05:37:41PM -0500, J. Johnston wrote:
> >
> >> * ia64-tdep.c (ia64_gdbarch_init): Set up the gdbarch long double
> >> format to be the i387 extended float format which is used for
> >> long double's in memory.
> >
> > This is os specific. HPUX uses ieee quad format.
> >
> > r~
> >
>
> The Intel doc doesn't differentiate for OS. Kevin, is this something we should
> account for by calling a function in a native tdep file?
Hmm. I suppose we could introduce an ia64-linux-tdep.c (with the
appropriate osabi machinery) to set this for linux. If it was ever
made to work with hpux, there'd be an ia64-hpux-tdep.c file which
would set it to IEEE quad format.
If you feel up to this, go ahead. Otherwise, just add a comment
to ia64-tdep.c which indicates that the setting is Linux specific
and that other OSes may use other types. The comment should also
indicate the correct way that it should be handled (via an OS-specific
tdep.c file.)
Kevin
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFA]: fix ia64 long double support
2003-12-05 5:18 ` Kevin Buettner
@ 2003-12-06 0:18 ` J. Johnston
0 siblings, 0 replies; 8+ messages in thread
From: J. Johnston @ 2003-12-06 0:18 UTC (permalink / raw)
To: Kevin Buettner; +Cc: Richard Henderson, gdb-patches
Kevin Buettner wrote:
> On Dec 4, 8:54pm, J. Johnston wrote:
>
>
>>Richard Henderson wrote:
>>
>>>On Thu, Dec 04, 2003 at 05:37:41PM -0500, J. Johnston wrote:
>>>
>>>
>>>> * ia64-tdep.c (ia64_gdbarch_init): Set up the gdbarch long double
>>>> format to be the i387 extended float format which is used for
>>>> long double's in memory.
>>>
>>>This is os specific. HPUX uses ieee quad format.
>>>
>>>r~
>>>
>>
>>The Intel doc doesn't differentiate for OS. Kevin, is this something we should
>>account for by calling a function in a native tdep file?
>
>
> Hmm. I suppose we could introduce an ia64-linux-tdep.c (with the
> appropriate osabi machinery) to set this for linux. If it was ever
> made to work with hpux, there'd be an ia64-hpux-tdep.c file which
> would set it to IEEE quad format.
>
> If you feel up to this, go ahead. Otherwise, just add a comment
> to ia64-tdep.c which indicates that the setting is Linux specific
> and that other OSes may use other types. The comment should also
> indicate the correct way that it should be handled (via an OS-specific
> tdep.c file.)
>
> Kevin
>
I have added a comment and checked the code in.
Thanks,
-- Jeff J.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2003-12-06 0:18 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-04 22:37 [RFA]: fix ia64 long double support J. Johnston
2003-12-05 0:50 ` Richard Henderson
2003-12-05 1:54 ` J. Johnston
2003-12-05 5:18 ` Kevin Buettner
2003-12-06 0:18 ` J. Johnston
2003-12-05 1:19 ` Kevin Buettner
2003-12-05 1:52 ` J. Johnston
2003-12-05 5:13 ` Kevin Buettner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox