From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29239 invoked by alias); 20 Apr 2002 01:37:18 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 29229 invoked from network); 20 Apr 2002 01:37:15 -0000 Received: from unknown (HELO cygnus.com) (205.180.83.203) by sources.redhat.com with SMTP; 20 Apr 2002 01:37:15 -0000 Received: from redhat.com (reddwarf.sfbay.redhat.com [172.16.24.50]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id SAA04855; Fri, 19 Apr 2002 18:37:14 -0700 (PDT) Message-ID: <3CC0C38C.237D5798@redhat.com> Date: Fri, 19 Apr 2002 18:37:00 -0000 From: Michael Snyder Organization: Red Hat, Inc. X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: gdb-patches@sources.redhat.com Subject: Re: [RFA] Sparc/Linux fixes part 1 References: <20020419.144600.97361868.davem@redhat.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2002-04/txt/msg00654.txt.bz2 "David S. Miller" wrote: > > Ok, let's try to split up these changes even more in hopes > someone might be able to start to look at least at the obvious > bits. > > 32-bit Sparc under Linux does not have a 16-byte long double, > this causes testsuite failures. Fix this by providing a > SPARC_TARGET_LONG_DOUBLE_BYTES the OS specific target headers > can override. > > Tested on sparc-linux-gnu, no regressions, a few new successes > :-) The idea is sound, but the implementation is not very multi-arch-ish. Is there a runtime way to do this, rather than by using a macro? The whole purpose of multi-arch is that these decisions get made at runtime. > > 2002-04-19 David S. Miller > > * config/sparc/tm-sparc.h (SPARC_TARGET_LONG_DOUBLE_BYTES): New. > (TARGET_LONG_DOUBLE_BIT): Define in non-multi-arch case. > * config/sparc/tm-linux.h (SPARC_TARGET_LONG_DOUBLE_BYTES): > Override. > * config/sparc/tm-sp64linux.h (SPARC_TARGET_LONG_DOUBLE_BYTES): > Override. > * sparc-tdep.c (sparc_gdbarch_init): Use > SPARC_TARGET_LONG_DOUBLE_BYTES in set_gdbarch_long_double_bit > call. Do it after GDB_TARGET_IS_SPARC64 has stabilized. > > --- ./config/sparc/tm-sparc.h.~1~ Mon Jan 28 20:42:44 2002 > +++ ./config/sparc/tm-sparc.h Fri Apr 19 13:55:48 2002 > @@ -137,6 +137,8 @@ extern int sparc_intreg_size (void); > #endif > #endif > > +#define SPARC_TARGET_LONG_DOUBLE_BYTES 16 > + > #if !defined (GDB_MULTI_ARCH) || (GDB_MULTI_ARCH == 0) > /* > * The following defines must go away for MULTI_ARCH > @@ -175,6 +177,11 @@ extern int sparc_intreg_size (void); > real way to know how big a register is. */ > > #define REGISTER_SIZE 4 > + > +/* Say how large a 'long double' is. */ > + > +#define TARGET_LONG_DOUBLE_BIT \ > + (SPARC_TARGET_LONG_DOUBLE_BYTES * TARGET_CHAR_BIT) > > /* Number of machine registers */ > > --- ./config/sparc/tm-linux.h.~1~ Sun Feb 24 14:56:07 2002 > +++ ./config/sparc/tm-linux.h Fri Apr 19 13:58:11 2002 > @@ -25,6 +25,9 @@ > > #include "sparc/tm-sparc.h" > > +#undef SPARC_TARGET_LONG_DOUBLE_BYTES > +#define SPARC_TARGET_LONG_DOUBLE_BYTES 8 > + > #define SIGCONTEXT_PC_OFFSET 12 > > #include "tm-linux.h" > --- ./config/sparc/tm-sp64linux.h.~1~ Sun Feb 24 14:56:07 2002 > +++ ./config/sparc/tm-sp64linux.h Fri Apr 19 13:58:03 2002 > @@ -25,6 +25,10 @@ Foundation, Inc., 59 Temple Place - Suit > > #include "sparc/tm-sp64.h" > > +#undef SPARC_TARGET_LONG_DOUBLE_BYTES > +#define SPARC_TARGET_LONG_DOUBLE_BYTES \ > + (GDB_TARGET_IS_SPARC64 ? 16 : 8) > + > #define SIGCONTEXT_PC_OFFSET 16 /* See asm-sparc64/sigcontext.h */ > > /* We always want full V9 + Ultra VIS stuff... */ > --- ./sparc-tdep.c.~1~ Fri Apr 12 11:18:57 2002 > +++ ./sparc-tdep.c Fri Apr 19 13:57:40 2002 > @@ -2970,7 +2970,6 @@ sparc_gdbarch_init (struct gdbarch_info > set_gdbarch_init_extra_frame_info (gdbarch, sparc_init_extra_frame_info); > set_gdbarch_inner_than (gdbarch, core_addr_lessthan); > set_gdbarch_int_bit (gdbarch, 4 * TARGET_CHAR_BIT); > - set_gdbarch_long_double_bit (gdbarch, 16 * TARGET_CHAR_BIT); > set_gdbarch_long_long_bit (gdbarch, 8 * TARGET_CHAR_BIT); > set_gdbarch_max_register_raw_size (gdbarch, 8); > set_gdbarch_max_register_virtual_size (gdbarch, 8); > @@ -3114,6 +3113,11 @@ sparc_gdbarch_init (struct gdbarch_info > tdep->call_dummy_call_offset = 148 + 4 * 5; > break; > } > + > + /* Set this after GDB_TARGET_IS_SPARC64 has stabilized. */ > + set_gdbarch_long_double_bit (gdbarch, > + SPARC_TARGET_LONG_DOUBLE_BYTES > + * TARGET_CHAR_BIT); > > /* > * Settings that vary per-architecture: