From: Andreas Schwab <schwab@suse.de>
To: gdb-patches@sources.redhat.com
Subject: Long double support on m68k
Date: Tue, 24 Jul 2001 07:30:00 -0000 [thread overview]
Message-ID: <jepuaqs8l2.fsf@sykes.suse.de> (raw)
[-- 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
next reply other threads:[~2001-07-24 7:30 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-07-24 7:30 Andreas Schwab [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jepuaqs8l2.fsf@sykes.suse.de \
--to=schwab@suse.de \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox