* Long double support on m68k
@ 2001-07-24 7:30 Andreas Schwab
2001-07-24 8:58 ` Andrew Cagney
0 siblings, 1 reply; 11+ messages in thread
From: Andreas Schwab @ 2001-07-24 7:30 UTC (permalink / raw)
To: gdb-patches
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 4279 bytes --]
This patch enables long double support for m68k.
Andreas.
2001-07-23 Andreas Schwab <schwab@suse.de>
* config/m68k/tm-m68k.h (TARGET_LONG_DOUBLE_FORMAT): Define.
(TARGET_LONG_DOUBLE_BIT): Define.
(REGISTER_VIRTUAL_SIZE): Return 12 for floating point registers.
(MAX_REGISTER_VIRTUAL_SIZE): Increase to 12.
(REGISTER_VIRTUAL_TYPE): Return builtin_type_long_double for
floating point registers.
(REGISTER_CONVERTIBLE, REGISTER_CONVERT_TO_VIRTUAL,
REGISTER_CONVERT_TO_RAW): Remove.
* config/m68k/xm-linux.h (HOST_LONG_DOUBLE_FORMAT): Define.
--- tm-m68k.h.~1.6.~ Thu Mar 15 10:16:08 2001
+++ tm-m68k.h Sun Jul 15 22:26:50 2001
@@ -28,6 +28,10 @@
/* Define the bit, byte, and word ordering of the machine. */
#define TARGET_BYTE_ORDER BIG_ENDIAN
+#define TARGET_LONG_DOUBLE_FORMAT &floatformat_m68881_ext
+
+#define TARGET_LONG_DOUBLE_BIT 96
+
/* Offset from address of function to start of its code.
Zero on most machines. */
@@ -137,9 +141,9 @@
/* Number of bytes of storage in the program's representation
for register N. On the 68000, all regs are 4 bytes
- except the floating point regs which are 8-byte doubles. */
+ except the floating point regs which are 12-byte long doubles. */
-#define REGISTER_VIRTUAL_SIZE(N) (((unsigned)(N) - FP0_REGNUM) < 8 ? 8 : 4)
+#define REGISTER_VIRTUAL_SIZE(N) (((unsigned)(N) - FP0_REGNUM) < 8 ? 12 : 4)
/* Largest value REGISTER_RAW_SIZE can have. */
@@ -147,39 +151,10 @@
/* Largest value REGISTER_VIRTUAL_SIZE can have. */
-#define MAX_REGISTER_VIRTUAL_SIZE 8
-
-/* Nonzero if register N requires conversion
- from raw format to virtual format. */
-
-#define REGISTER_CONVERTIBLE(N) (((unsigned)(N) - FP0_REGNUM) < 8)
-
-#include "floatformat.h"
-
-/* Convert data from raw format for register REGNUM in buffer FROM
- to virtual format with type TYPE in buffer TO. */
-
-#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,TYPE,FROM,TO) \
-do \
- { \
- DOUBLEST dbl_tmp_val; \
- floatformat_to_doublest (&floatformat_m68881_ext, (FROM), &dbl_tmp_val); \
- store_floating ((TO), TYPE_LENGTH (TYPE), dbl_tmp_val); \
- } while (0)
-
-/* Convert data from virtual format with type TYPE in buffer FROM
- to raw format for register REGNUM in buffer TO. */
-
-#define REGISTER_CONVERT_TO_RAW(TYPE,REGNUM,FROM,TO) \
-do \
- { \
- DOUBLEST dbl_tmp_val; \
- dbl_tmp_val = extract_floating ((FROM), TYPE_LENGTH (TYPE)); \
- floatformat_from_doublest (&floatformat_m68881_ext, &dbl_tmp_val, (TO)); \
- } while (0)
+#define MAX_REGISTER_VIRTUAL_SIZE 12
/* Return the GDB type object for the "standard" data type of data
- in register N. This should be int for D0-D7, double for FP0-FP7,
+ in register N. This should be int for D0-D7, long double for FP0-FP7,
and void pointer for all others (A0-A7, PC, SR, FPCONTROL etc).
Note, for registers which contain addresses return pointer to void,
not pointer to char, because we don't want to attempt to print
@@ -187,7 +162,7 @@
#define REGISTER_VIRTUAL_TYPE(N) \
((unsigned) (N) >= FPC_REGNUM ? lookup_pointer_type (builtin_type_void) : \
- (unsigned) (N) >= FP0_REGNUM ? builtin_type_double : \
+ (unsigned) (N) >= FP0_REGNUM ? builtin_type_long_double : \
(unsigned) (N) >= A0_REGNUM ? lookup_pointer_type (builtin_type_void) : \
builtin_type_int)
Index: config/m68k/xm-linux.h
===================================================================
RCS file: /cvs/src/src/gdb/config/m68k/xm-linux.h,v
retrieving revision 1.5
diff -u -a -u -r1.5 config/m68k/xm-linux.h
--- config/m68k/xm-linux.h 2001/07/23 19:21:55 1.5
+++ config/m68k/xm-linux.h 2001/07/24 14:28:43
@@ -29,6 +29,8 @@
to get the offset in the core file of the register values. */
#define KERNEL_U_ADDR 0x0
+#define HOST_LONG_DOUBLE_FORMAT &floatformat_m68881_ext
+
/* Need R_OK etc, but USG isn't defined. */
#include <unistd.h>
--
Andreas Schwab "And now for something
SuSE Labs completely different."
Andreas.Schwab@suse.de
SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Long double support on m68k
2001-07-24 7:30 Long double support on m68k Andreas Schwab
@ 2001-07-24 8:58 ` Andrew Cagney
2001-07-24 9:13 ` Andreas Schwab
0 siblings, 1 reply; 11+ messages in thread
From: Andrew Cagney @ 2001-07-24 8:58 UTC (permalink / raw)
To: Andreas Schwab; +Cc: gdb-patches
> This patch enables long double support for m68k.
>
> Andreas.
>
> 2001-07-23 Andreas Schwab <schwab@suse.de>
>
> * config/m68k/tm-m68k.h (TARGET_LONG_DOUBLE_FORMAT): Define.
> (TARGET_LONG_DOUBLE_BIT): Define.
> (REGISTER_VIRTUAL_SIZE): Return 12 for floating point registers.
> (MAX_REGISTER_VIRTUAL_SIZE): Increase to 12.
> (REGISTER_VIRTUAL_TYPE): Return builtin_type_long_double for
> floating point registers.
> (REGISTER_CONVERTIBLE, REGISTER_CONVERT_TO_VIRTUAL,
> REGISTER_CONVERT_TO_RAW): Remove.
> * config/m68k/xm-linux.h (HOST_LONG_DOUBLE_FORMAT): Define.
The patch changes something included by all the other config/m68k/tm-*.h
header files. Can you explain why it won't break some of those targets.
Andrew
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Long double support on m68k
2001-07-24 8:58 ` Andrew Cagney
@ 2001-07-24 9:13 ` Andreas Schwab
2001-07-24 15:12 ` Andrew Cagney
2001-07-28 13:03 ` Andrew Cagney
0 siblings, 2 replies; 11+ messages in thread
From: Andreas Schwab @ 2001-07-24 9:13 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1480 bytes --]
Andrew Cagney <ac131313@cygnus.com> writes:
|> > This patch enables long double support for m68k.
|> > Andreas.
|> > 2001-07-23 Andreas Schwab <schwab@suse.de>
|> > * config/m68k/tm-m68k.h (TARGET_LONG_DOUBLE_FORMAT): Define.
|> > (TARGET_LONG_DOUBLE_BIT): Define.
|> > (REGISTER_VIRTUAL_SIZE): Return 12 for floating point registers.
|> > (MAX_REGISTER_VIRTUAL_SIZE): Increase to 12.
|> > (REGISTER_VIRTUAL_TYPE): Return builtin_type_long_double for
|> > floating point registers.
|> > (REGISTER_CONVERTIBLE, REGISTER_CONVERT_TO_VIRTUAL,
|> > REGISTER_CONVERT_TO_RAW): Remove.
|> > * config/m68k/xm-linux.h (HOST_LONG_DOUBLE_FORMAT): Define.
|>
|>
|> The patch changes something included by all the other config/m68k/tm-*.h
|> header files. Can you explain why it won't break some of those targets.
Well, that's how the m68k looks like on all targets (if they support
floating point at all). All targets that make use of the fpu do it
similar as m68k-linux and don't touch any of the macros I changed, so I
think this should be safe. The patch only changes the representation of
floating point values at gdb's point of view, not how the target is using
it.
Andreas.
--
Andreas Schwab "And now for something
SuSE Labs completely different."
Andreas.Schwab@suse.de
SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Long double support on m68k
2001-07-24 9:13 ` Andreas Schwab
@ 2001-07-24 15:12 ` Andrew Cagney
2001-07-25 1:17 ` Andreas Schwab
2001-07-28 13:03 ` Andrew Cagney
1 sibling, 1 reply; 11+ messages in thread
From: Andrew Cagney @ 2001-07-24 15:12 UTC (permalink / raw)
To: Andreas Schwab; +Cc: gdb-patches
> Andrew Cagney <ac131313@cygnus.com> writes:
>
> |> > This patch enables long double support for m68k.
> |> > Andreas.
> |> > 2001-07-23 Andreas Schwab <schwab@suse.de>
> |> > * config/m68k/tm-m68k.h (TARGET_LONG_DOUBLE_FORMAT): Define.
> |> > (TARGET_LONG_DOUBLE_BIT): Define.
> |> > (REGISTER_VIRTUAL_SIZE): Return 12 for floating point registers.
> |> > (MAX_REGISTER_VIRTUAL_SIZE): Increase to 12.
> |> > (REGISTER_VIRTUAL_TYPE): Return builtin_type_long_double for
> |> > floating point registers.
> |> > (REGISTER_CONVERTIBLE, REGISTER_CONVERT_TO_VIRTUAL,
> |> > REGISTER_CONVERT_TO_RAW): Remove.
> |> > * config/m68k/xm-linux.h (HOST_LONG_DOUBLE_FORMAT): Define.
> |> |> |> The patch changes something included by all the other config/m68k/tm-*.h
> |> header files. Can you explain why it won't break some of those targets.
>
> Well, that's how the m68k looks like on all targets (if they support
> floating point at all). All targets that make use of the fpu do it
> similar as m68k-linux and don't touch any of the macros I changed, so I
> think this should be safe. The patch only changes the representation of
> floating point values at gdb's point of view, not how the target is using
> it.
So, what you're saying is that:
o
only tm-m68k defines the current
REGISTER_CONVERT* macros. All
m68k targets import/use this.
o
the existing REGISTER_CONVERT* macro's
only work when the raw register buffer
is laid out using a specific format.
o
A target's FP only works when
the target has a raw register buffer
that correctly matches REGISTER_CONVERT*
o
If a target has somehow managed to get
a raw register buffer that doesn't match
REGISTER_CONVERT* then, even
before this change, it is broken.
So, if a target's raw FP registers are in the correct format for
REGISTER_CONVERT* then they are also in the correct format for this
change and such targets will continue to work. If a target's raw FP
registers were not in the correct format then, that target is already
broken and this change doesn't make things better or worse.
Correct?
Andrew
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Long double support on m68k
2001-07-24 15:12 ` Andrew Cagney
@ 2001-07-25 1:17 ` Andreas Schwab
2001-07-25 8:42 ` Andrew Cagney
0 siblings, 1 reply; 11+ messages in thread
From: Andreas Schwab @ 2001-07-25 1:17 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2369 bytes --]
Andrew Cagney <ac131313@cygnus.com> writes:
|> > Andrew Cagney <ac131313@cygnus.com> writes:
|> > |> > This patch enables long double support for m68k.
|> > |> > Andreas.
|> > |> > 2001-07-23 Andreas Schwab <schwab@suse.de>
|> > |> > * config/m68k/tm-m68k.h (TARGET_LONG_DOUBLE_FORMAT): Define.
|> > |> > (TARGET_LONG_DOUBLE_BIT): Define.
|> > |> > (REGISTER_VIRTUAL_SIZE): Return 12 for floating point registers.
|> > |> > (MAX_REGISTER_VIRTUAL_SIZE): Increase to 12.
|> > |> > (REGISTER_VIRTUAL_TYPE): Return builtin_type_long_double for
|> > |> > floating point registers.
|> > |> > (REGISTER_CONVERTIBLE, REGISTER_CONVERT_TO_VIRTUAL,
|> > |> > REGISTER_CONVERT_TO_RAW): Remove.
|> > |> > * config/m68k/xm-linux.h (HOST_LONG_DOUBLE_FORMAT): Define.
|> > |> |> |> The patch changes something included by all the other config/m68k/tm-*.h
|> > |> header files. Can you explain why it won't break some of those targets.
|> > Well, that's how the m68k looks like on all targets (if they support
|> > floating point at all). All targets that make use of the fpu do it
|> > similar as m68k-linux and don't touch any of the macros I changed, so I
|> > think this should be safe. The patch only changes the representation of
|> > floating point values at gdb's point of view, not how the target is using
|> > it.
|>
|>
|> So, what you're saying is that:
|>
|> o only tm-m68k defines the current
|> REGISTER_CONVERT* macros. All
|> m68k targets import/use this.
Yes (if they support the fpu at all).
|> So, if a target's raw FP registers are in the correct format for
|> REGISTER_CONVERT* then they are also in the correct format for this change
|> and such targets will continue to work. If a target's raw FP registers
|> were not in the correct format then, that target is already broken and
|> this change doesn't make things better or worse.
Yes. There is only one floating point format for the m68k fpu. The
previous version already assumed floatformat_m68881_ext, this patch just
removes the conversion, and makes the raw format avaliable to gdb.
Andreas.
--
Andreas Schwab "And now for something
SuSE Labs completely different."
Andreas.Schwab@suse.de
SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Long double support on m68k
2001-07-25 1:17 ` Andreas Schwab
@ 2001-07-25 8:42 ` Andrew Cagney
2001-07-25 9:05 ` Andreas Schwab
0 siblings, 1 reply; 11+ messages in thread
From: Andrew Cagney @ 2001-07-25 8:42 UTC (permalink / raw)
To: Andreas Schwab; +Cc: gdb-patches
> Yes (if they support the fpu at all).
>
> |> So, if a target's raw FP registers are in the correct format for
> |> REGISTER_CONVERT* then they are also in the correct format for this change
> |> and such targets will continue to work. If a target's raw FP registers
> |> were not in the correct format then, that target is already broken and
> |> this change doesn't make things better or worse.
>
> Yes. There is only one floating point format for the m68k fpu. The
> previous version already assumed floatformat_m68881_ext, this patch just
> removes the conversion, and makes the raw format avaliable to gdb.
The other thing it affects is `sizeof (long double)`. For GCC, at
least, is m68k's `sizeof (long double)` 12?
Andrew
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Long double support on m68k
2001-07-25 8:42 ` Andrew Cagney
@ 2001-07-25 9:05 ` Andreas Schwab
2001-07-25 15:47 ` Andrew Cagney
0 siblings, 1 reply; 11+ messages in thread
From: Andreas Schwab @ 2001-07-25 9:05 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1226 bytes --]
Andrew Cagney <ac131313@cygnus.com> writes:
|> > Yes (if they support the fpu at all).
|> > |> So, if a target's raw FP registers are in the correct format for
|> > |> REGISTER_CONVERT* then they are also in the correct format for this change
|> > |> and such targets will continue to work. If a target's raw FP registers
|> > |> were not in the correct format then, that target is already broken and
|> > |> this change doesn't make things better or worse.
|> > Yes. There is only one floating point format for the m68k fpu. The
|> > previous version already assumed floatformat_m68881_ext, this patch just
|> > removes the conversion, and makes the raw format avaliable to gdb.
|>
|>
|> The other thing it affects is `sizeof (long double)`. For GCC, at least,
|> is m68k's `sizeof (long double)` 12?
Yes, of course. That's why I started with this patch, a testsuite failure
indicated that something was wrong.
Andreas.
--
Andreas Schwab "And now for something
SuSE Labs completely different."
Andreas.Schwab@suse.de
SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Long double support on m68k
2001-07-25 9:05 ` Andreas Schwab
@ 2001-07-25 15:47 ` Andrew Cagney
2001-07-26 1:43 ` Andreas Schwab
0 siblings, 1 reply; 11+ messages in thread
From: Andrew Cagney @ 2001-07-25 15:47 UTC (permalink / raw)
To: Andreas Schwab; +Cc: gdb-patches
> The other thing it affects is `sizeof (long double)`. For GCC, at least,
> |> is m68k's `sizeof (long double)` 12?
>
> Yes, of course. That's why I started with this patch, a testsuite failure
> indicated that something was wrong.
Ah, thank you! I was going to ask what effect this had on sizeof.exp
but I'll assume it was positive.
Yes, approved,
Andrew
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Long double support on m68k
2001-07-25 15:47 ` Andrew Cagney
@ 2001-07-26 1:43 ` Andreas Schwab
2001-07-26 6:36 ` Andrew Cagney
0 siblings, 1 reply; 11+ messages in thread
From: Andreas Schwab @ 2001-07-26 1:43 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 832 bytes --]
Andrew Cagney <ac131313@cygnus.com> writes:
|> > The other thing it affects is `sizeof (long double)`. For GCC, at least,
|> > |> is m68k's `sizeof (long double)` 12?
|> > Yes, of course. That's why I started with this patch, a testsuite
|> > failure
|> > indicated that something was wrong.
|>
|>
|> Ah, thank you! I was going to ask what effect this had on sizeof.exp but
|> I'll assume it was positive.
|>
|> Yes, approved,
Thanks. I'm not yet listed under Write After Approval in gdb/MAINTAINERS.
Should I add me?
Andreas.
--
Andreas Schwab "And now for something
SuSE Labs completely different."
Andreas.Schwab@suse.de
SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Long double support on m68k
2001-07-26 1:43 ` Andreas Schwab
@ 2001-07-26 6:36 ` Andrew Cagney
0 siblings, 0 replies; 11+ messages in thread
From: Andrew Cagney @ 2001-07-26 6:36 UTC (permalink / raw)
To: Andreas Schwab; +Cc: gdb-patches
> Thanks. I'm not yet listed under Write After Approval in gdb/MAINTAINERS.
> Should I add me?
Sorry, I just slipped on the paper trail. I'll follow this up off line.
Andrew
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Long double support on m68k
2001-07-24 9:13 ` Andreas Schwab
2001-07-24 15:12 ` Andrew Cagney
@ 2001-07-28 13:03 ` Andrew Cagney
1 sibling, 0 replies; 11+ messages in thread
From: Andrew Cagney @ 2001-07-28 13:03 UTC (permalink / raw)
To: Andreas Schwab; +Cc: gdb-patches
> |> > This patch enables long double support for m68k.
> |> > Andreas.
> |> > 2001-07-23 Andreas Schwab <schwab@suse.de>
> |> > * config/m68k/tm-m68k.h (TARGET_LONG_DOUBLE_FORMAT): Define.
> |> > (TARGET_LONG_DOUBLE_BIT): Define.
> |> > (REGISTER_VIRTUAL_SIZE): Return 12 for floating point registers.
> |> > (MAX_REGISTER_VIRTUAL_SIZE): Increase to 12.
> |> > (REGISTER_VIRTUAL_TYPE): Return builtin_type_long_double for
> |> > floating point registers.
> |> > (REGISTER_CONVERTIBLE, REGISTER_CONVERT_TO_VIRTUAL,
> |> > REGISTER_CONVERT_TO_RAW): Remove.
> |> > * config/m68k/xm-linux.h (HOST_LONG_DOUBLE_FORMAT): Define.
Ok, I've checked this in. As they say, there is only one way to fix
this bug and Andreas has done exactly that.
Andrew
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2001-07-28 13:03 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-24 7:30 Long double support on m68k Andreas Schwab
2001-07-24 8:58 ` Andrew Cagney
2001-07-24 9:13 ` Andreas Schwab
2001-07-24 15:12 ` Andrew Cagney
2001-07-25 1:17 ` Andreas Schwab
2001-07-25 8:42 ` Andrew Cagney
2001-07-25 9:05 ` Andreas Schwab
2001-07-25 15:47 ` Andrew Cagney
2001-07-26 1:43 ` Andreas Schwab
2001-07-26 6:36 ` Andrew Cagney
2001-07-28 13:03 ` Andrew Cagney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox