This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [PATCH] Provide `long double' support for most i386 targets



> The various i386 maintainers may want to put a
> 
>    #define HOST_LONG_DOUBLE_FORMAT &floatformat_i387_ext
> 
> in their host file.  This will optimize things a bit.  I'll take care
> of Linux and the Hurd.

Done for DJGPP.  Thanks for the tip.

> Eli may want to remove the REGISTER_CONVERT_TO_VIRTUAL,
> REGISTER_CONVERT_TO_RAW and TARGET_LONG_DOUBLE_BIT stuff from
> tm-go32.h.

Done.

> The LD_I387 definition can probably also be removed.  Its
> only purpose would be the HEX_LONG_DOUBLE_INPUT macro, but that macro
> is never used in the GDB sources.

Hmm, this HEX_LONG_DOUBLE_INPUT seems like a useful feature, but it
doesn't work, including in GDB 4.18.  Did it ever work?

I removed the macro.

> By the way Eli, the
> I386_DJGPP_TARGET macro is redundant too now I've changed
> i386_extract_return_value().

Done.

The patches I will commit are below.

2000-04-02  Eli Zaretskii  <eliz@is.elta.co.il>

	* config/i386/xm-go32.h (HOST_LONG_DOUBLE_FORMAT): Define.

	* config/i386/tm-go32.h (TARGET_LONG_DOUBLE_BIT): Remove
	definition (and use the common one in tm-i386.h).
	(REGISTER_CONVERT_TO_VIRTUAL, REGISTER_CONVERT_TO_RAW): Likewise.
	(I386_DJGPP_TARGET): Don't define, it's no longer required.
	(LOW_RETURN_REGNUM, HIGH_RETURN_REGNUM): Remove definition,
	i386-tdep.c defines it for all x86 targets.
	(LD_I387, HEX_LONG_DOUBLE_INPUT): Remove.

	* config/djgpp/fnchange.lst: Add i386-linux-tdep.c.

	* config/djgpp/djcheck.sh: Edit the copyright year out of the test
	results.  Fix editing of `main' arguments for non-GNU Sed.


--- gdb/config/i386/xm-go32.h~2	Sat Mar  4 13:58:36 2000
+++ gdb/config/i386/xm-go32.h	Sun Apr  2 19:57:16 2000
@@ -36,3 +36,5 @@
 #define DIRNAME_SEPARATOR ';'
 
 #define HOST_I386
+
+#define HOST_LONG_DOUBLE_FORMAT &floatformat_i387_ext
--- gdb/config/i386/tm-go32.h~2	Fri Feb 25 08:33:50 2000
+++ gdb/config/i386/tm-go32.h	Sun Apr  2 20:22:30 2000
@@ -21,57 +21,11 @@
 #ifndef TM_GO32_H
 #define TM_GO32_H
 
-#define I386_DJGPP_TARGET
 #undef HAVE_SSE_REGS	/* FIXME! go32-nat.c needs to support XMMi registers */
 #define HAVE_I387_REGS
 
 #include "i386/tm-i386.h"
 
-/* The host and target are i386 machines and the compiler supports
-   long doubles. Long doubles on the host therefore have the same
-   layout as a 387 FPU stack register. */
-
-#if defined(HAVE_LONG_DOUBLE) && defined(HOST_I386)
-#undef LD_I387
-#define LD_I387
-#endif
-
-/* Define eax/edx as return registers for long long return values. */
-/* FIXME: Maybe this should be moved to tm-i386.h, as it is pretty generic. */
-#define LOW_RETURN_REGNUM 0	/* Holds low four bytes of result */
-#define HIGH_RETURN_REGNUM 2	/* Holds high four bytes of result */
-
-/* Allow floating point numbers to be specified by a raw long double
-   10 hex bytes number, e.g. 1.0 can be input as
-   0x3fff8000000000000000 */
-
-#ifdef LD_I387
-#define HEX_LONG_DOUBLE_INPUT(base,p,len,target) \
-  ((base) == 16 && (len) == 20 \
-   && i387_hex_long_double_input ((p), (target)))
-#endif
-
-extern int i387_hex_long_double_input (char *p, long double *putithere);
-
-#ifdef LD_I387	/* otherwise, definitions from tm-i386.h are good enough */
-
-#undef REGISTER_CONVERT_TO_VIRTUAL
-#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,TYPE,FROM,TO)	\
-{								\
-  long double val = *((long double *)(FROM));			\
-  store_floating ((TO), TYPE_LENGTH (TYPE), val);		\
-}
-
-#undef REGISTER_CONVERT_TO_RAW
-#define REGISTER_CONVERT_TO_RAW(TYPE,REGNUM,FROM,TO)			\
-{									\
-  long double val = extract_floating ((FROM), TYPE_LENGTH (TYPE));	\
-  *((long double *)(TO)) = val;						\
-}
-
-#undef TARGET_LONG_DOUBLE_BIT
-#define TARGET_LONG_DOUBLE_BIT 96
-
 /* FRAME_CHAIN takes a frame's nominal address and produces the frame's
    chain-pointer.
    In the case of the i386, the frame's nominal address
@@ -94,5 +48,4 @@
 #undef  FRAME_SAVED_PC
 #define FRAME_SAVED_PC(FRAME) (read_memory_integer ((FRAME)->frame + 4, 4))
 
-#endif /* LD_I387 */
 #endif /* TM_GO32_H */
--- gdb/config/djgpp/fnchange.l~0	Fri Mar 17 20:46:08 2000
+++ gdb/config/djgpp/fnchange.lst	Sat Apr  1 18:01:26 2000
@@ -33,6 +33,7 @@
 gdb-0222/gdb/remote-vxsparc.c gdb-0222/gdb/rmt-vxsparc.c
 gdb-0222/gdb/sparclet-rom.c gdb-0222/gdb/splet-rom.c
 gdb-0222/gdb/sparclet-stub.c gdb-0222/gdb/splet-stub.c
+gdb-0222/gdb/i386-linux-tdep.c gdb-0222/gdb/i386linux-tdep.c
 gdb-0222/gdb/config/alpha/alpha-osf1.mh gdb-0222/gdb/config/alpha/alphosf1.mh
 gdb-0222/gdb/config/alpha/alpha-osf2.mh gdb-0222/gdb/config/alpha/alphosf2.mh
 gdb-0222/gdb/config/alpha/alpha-osf3.mh gdb-0222/gdb/config/alpha/alphosf3.mh
--- gdb/config/djgpp/djcheck.s~0	Sat Mar 18 15:44:22 2000
+++ gdb/config/djgpp/djcheck.sh	Sun Apr  2 20:53:46 2000
@@ -20,9 +20,10 @@
 	options=
     fi
     $GDB ${options} < ${base}.in 2>&1 \
-      | sed -e '/^GNU gdb /s/ [.0-9][.0-9]*//' \
+      | sed -e '/GNU gdb /s/ [.0-9][.0-9]*//' \
+            -e '/^Copyright/s/[12][0-9][0-9][0-9]/XYZZY/g' \
             -e '/Starting program: /s|[A-z]:/.*/||' \
-            -e '/main (.*argv=/s/\(argv\|envp\)=0x[0-9a-f][0-9a-f]*/\1=XYZ/g' \
+            -e '/main (/s/=0x[0-9a-f][0-9a-f]*/=XYZ/g' \
       > ${base}.tst
     if diff --binary -u ${base}.out ${base}.tst ; then
       rm -f ${base}.tst

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]