Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] Add some VAX floating point formats to floatformat.[ch]
@ 2005-08-21 21:59 Mark Kettenis
  2005-08-22 10:22 ` Nick Clifton
  2005-08-23 21:58 ` Ken Raeburn
  0 siblings, 2 replies; 11+ messages in thread
From: Mark Kettenis @ 2005-08-21 21:59 UTC (permalink / raw)
  To: gdb-patches, binutils, gcc-patches

This patch adds support for the two VAX floating-point formats used by
GCC for 'float' and 'double'.  The real guts are in gdb/doublest.c
(which I wil post later to the gdb list); this only adds the
description.

ok?

Mark

Index: include/ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* floatformat.h (enum floatformat_byteorders): Add
	floatformat_vax.
	(floatformat_vax_aingle, floatformat_vax_double): Declare.

Index: include/floatformat.h
===================================================================
RCS file: /cvs/src/src/include/floatformat.h,v
retrieving revision 1.12
diff -u -p -r1.12 floatformat.h
--- include/floatformat.h 17 Aug 2005 18:03:25 -0000 1.12
+++ include/floatformat.h 21 Aug 2005 21:48:26 -0000
@@ -29,25 +29,23 @@ Foundation, Inc., 51 Franklin Street - F
    (i.e. BITS_BIG_ENDIAN type numbering), and specify which bits each field
    contains with the *_start and *_len fields.  */
 
-/* What is the order of the bytes. */
+/* What is the order of the bytes?  */
 
 enum floatformat_byteorders {
-
   /* Standard little endian byte order.
      EX: 1.2345678e10 => 00 00 80 c5 e0 fe 06 42 */
-
   floatformat_little,
 
   /* Standard big endian byte order.
      EX: 1.2345678e10 => 42 06 fe e0 c5 80 00 00 */
-
   floatformat_big,
 
   /* Little endian byte order but big endian word order.
      EX: 1.2345678e10 => e0 fe 06 42 00 00 80 c5 */
+  floatformat_littlebyte_bigword,
 
-  floatformat_littlebyte_bigword
-
+  /* VAX byte order.  */
+  floatformat_vax
 };
 
 enum floatformat_intbit { floatformat_intbit_yes, floatformat_intbit_no };
@@ -97,6 +95,11 @@ extern const struct floatformat floatfor
 
 extern const struct floatformat floatformat_ieee_double_littlebyte_bigword;
 
+/* floatformats for VAX.  */
+
+extern const struct floatformat floatformat_vax_single;
+extern const struct floatformat floatformat_vax_double;
+
 /* floatformats for various extendeds.  */
 
 extern const struct floatformat floatformat_i387_ext;
Index: libiberty/ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* floatformat.c (floatformat_vax_aingle, floatformat_vax_double):
	New variables.

Index: libiberty/floatformat.c
===================================================================
RCS file: /cvs/src/src/libiberty/floatformat.c,v
retrieving revision 1.16
diff -u -p -r1.16 floatformat.c
--- libiberty/floatformat.c 17 Aug 2005 18:03:42 -0000 1.16
+++ libiberty/floatformat.c 21 Aug 2005 21:48:31 -0000
@@ -108,6 +108,23 @@ const struct floatformat floatformat_iee
   floatformat_always_valid
 };
 
+/* floatformat for VAX.  Not quite IEEE, but close enough.  */
+
+const struct floatformat floatformat_vax_single =
+{
+  floatformat_vax, 32, 0, 1, 8, 129, 0, 9, 23,
+  floatformat_intbit_no,
+  "floatformat_vax_single",
+  floatformat_always_valid
+};
+const struct floatformat floatformat_vax_double =
+{
+  floatformat_vax, 64, 0, 1, 8, 129, 0, 9, 55,
+  floatformat_intbit_no,
+  "floatformat_vax_single",
+  floatformat_always_valid
+};
+
 static int floatformat_i387_ext_is_valid (const struct floatformat *fmt,
 					  const void *from);
 


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFA] Add some VAX floating point formats to floatformat.[ch]
  2005-08-21 21:59 [RFA] Add some VAX floating point formats to floatformat.[ch] Mark Kettenis
@ 2005-08-22 10:22 ` Nick Clifton
  2005-08-22 11:53   ` Mark Kettenis
  2005-08-22 18:40   ` DJ Delorie
  2005-08-23 21:58 ` Ken Raeburn
  1 sibling, 2 replies; 11+ messages in thread
From: Nick Clifton @ 2005-08-22 10:22 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: gdb-patches, binutils, gcc-patches

Hi Mark,

> Index: include/ChangeLog
> from  Mark Kettenis  <kettenis@gnu.org>
> 
> 	* floatformat.h (enum floatformat_byteorders): Add
> 	floatformat_vax.
> 	(floatformat_vax_aingle, floatformat_vax_double): Declare.

No objections from binutils for this, although it is officially a GDB 
header file so make sure that you get agreement from them before 
committing your change.  One point though:

> +  /* VAX byte order.  */
> +  floatformat_vax

I think that having a more descriptive comment for the VAX byte order 
would be helpful.  eg describing the layout of 1.2345678e10 as is done 
with the other entries in this enum.

Cheers
   Nick


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFA] Add some VAX floating point formats to floatformat.[ch]
  2005-08-22 10:22 ` Nick Clifton
@ 2005-08-22 11:53   ` Mark Kettenis
  2005-08-22 16:07     ` Nick Clifton
  2005-08-22 18:40   ` DJ Delorie
  1 sibling, 1 reply; 11+ messages in thread
From: Mark Kettenis @ 2005-08-22 11:53 UTC (permalink / raw)
  To: Nick Clifton; +Cc: Mark Kettenis, gdb-patches, binutils, gcc-patches

> Hi Mark,
>
> No objections from binutils for this, although it is officially a GDB
> header file so make sure that you get agreement from them before
> committing your change.

Thanks!

>> +  /* VAX byte order.  */
>> +  floatformat_vax
>
> I think that having a more descriptive comment for the VAX byte order
> would be helpful.  eg describing the layout of 1.2345678e10 as is done
> with the other entries in this enum.

Could do that, although it wouldn't be particular useful.  VAX is not quite
IEEE, so the bytes will be completely different, not just shuffled around.

Mark


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFA] Add some VAX floating point formats to floatformat.[ch]
  2005-08-22 11:53   ` Mark Kettenis
@ 2005-08-22 16:07     ` Nick Clifton
  2005-08-22 16:26       ` Jan-Benedict Glaw
  0 siblings, 1 reply; 11+ messages in thread
From: Nick Clifton @ 2005-08-22 16:07 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: gdb-patches, binutils, gcc-patches

Hi Mark,

>>>+  /* VAX byte order.  */
>>>+  floatformat_vax
>>
>>I think that having a more descriptive comment for the VAX byte order
>>would be helpful.  eg describing the layout of 1.2345678e10 as is done
>>with the other entries in this enum.
> 
> Could do that, although it wouldn't be particular useful.  VAX is not quite
> IEEE, so the bytes will be completely different, not just shuffled around.

Ok well then how about the comment containing a quick precis of the VAX 
format.  I am sure that various people will be interested to read it.

Cheers
   Nick



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFA] Add some VAX floating point formats to floatformat.[ch]
  2005-08-22 16:07     ` Nick Clifton
@ 2005-08-22 16:26       ` Jan-Benedict Glaw
  2005-08-22 18:32         ` Paul Koning
  0 siblings, 1 reply; 11+ messages in thread
From: Jan-Benedict Glaw @ 2005-08-22 16:26 UTC (permalink / raw)
  To: Nick Clifton; +Cc: Mark Kettenis, gdb-patches, binutils, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1172 bytes --]

On Mon, 2005-08-22 13:00:26 +0100, Nick Clifton <nickc@redhat.com> wrote:
> Hi Mark,
> 
> >>>+  /* VAX byte order.  */
> >>>+  floatformat_vax
> >>
> >>I think that having a more descriptive comment for the VAX byte order
> >>would be helpful.  eg describing the layout of 1.2345678e10 as is done
> >>with the other entries in this enum.
> >
> >Could do that, although it wouldn't be particular useful.  VAX is not quite
> >IEEE, so the bytes will be completely different, not just shuffled around.
> 
> Ok well then how about the comment containing a quick precis of the VAX 
> format.  I am sure that various people will be interested to read it.

That's actually quite simple: transcribe the nice pictures in the VAX
Architecture Reference Manual into ASCII art and give a specific example
for one number.

MfG, JBG

-- 
Jan-Benedict Glaw       jbglaw@lug-owl.de    . +49-172-7608481             _ O _
"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O
 für einen Freien Staat voll Freier Bürger"  | im Internet! |   im Irak!   O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFA] Add some VAX floating point formats to floatformat.[ch]
  2005-08-22 16:26       ` Jan-Benedict Glaw
@ 2005-08-22 18:32         ` Paul Koning
  0 siblings, 0 replies; 11+ messages in thread
From: Paul Koning @ 2005-08-22 18:32 UTC (permalink / raw)
  To: jbglaw; +Cc: gdb-patches, binutils, gcc-patches

>>>>> "Jan-Benedict" == Jan-Benedict Glaw <jbglaw@lug-owl.de> writes:

 >> Ok well then how about the comment containing a quick precis of
 >> the VAX format.  I am sure that various people will be interested
 >> to read it.

 Jan-Benedict> That's actually quite simple: transcribe the nice
 Jan-Benedict> pictures in the VAX Architecture Reference Manual into
 Jan-Benedict> ASCII art and give a specific example for one number.

Or copy the reference from real.c in gcc.

   paul


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFA] Add some VAX floating point formats to floatformat.[ch]
  2005-08-22 10:22 ` Nick Clifton
  2005-08-22 11:53   ` Mark Kettenis
@ 2005-08-22 18:40   ` DJ Delorie
  1 sibling, 0 replies; 11+ messages in thread
From: DJ Delorie @ 2005-08-22 18:40 UTC (permalink / raw)
  To: nickc; +Cc: mark.kettenis, gdb-patches, binutils, gcc-patches


> No objections from binutils for this, although it is officially a GDB 
> header file . . .

It's a libiberty header file now.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFA] Add some VAX floating point formats to floatformat.[ch]
  2005-08-21 21:59 [RFA] Add some VAX floating point formats to floatformat.[ch] Mark Kettenis
  2005-08-22 10:22 ` Nick Clifton
@ 2005-08-23 21:58 ` Ken Raeburn
  2005-08-31  8:48   ` Mark Kettenis
  1 sibling, 1 reply; 11+ messages in thread
From: Ken Raeburn @ 2005-08-23 21:58 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: gdb-patches, binutils, gcc-patches

On Aug 21, 2005, at 17:53, Mark Kettenis wrote:
> This patch adds support for the two VAX floating-point formats used by
> GCC for 'float' and 'double'.  The real guts are in gdb/doublest.c
> (which I wil post later to the gdb list); this only adds the
> description.

It's been a long time since I checked, but doesn't gcc support both  
of the "double"-size FP formats the VAX architecture has, in addition  
to the "float" format?

+const struct floatformat floatformat_vax_single =
+{
+  floatformat_vax, 32, 0, 1, 8, 129, 0, 9, 23,
+  floatformat_intbit_no,
+  "floatformat_vax_single",
+  floatformat_always_valid
+};
+const struct floatformat floatformat_vax_double =
+{
+  floatformat_vax, 64, 0, 1, 8, 129, 0, 9, 55,
+  floatformat_intbit_no,
+  "floatformat_vax_single",
+  floatformat_always_valid
+};

Shouldn't this one be labelled "floatformat_vax_double"?  (And maybe  
"_d" or "_g"?)


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFA] Add some VAX floating point formats to floatformat.[ch]
  2005-08-23 21:58 ` Ken Raeburn
@ 2005-08-31  8:48   ` Mark Kettenis
  2005-08-31 17:30     ` Jan-Benedict Glaw
  0 siblings, 1 reply; 11+ messages in thread
From: Mark Kettenis @ 2005-08-31  8:48 UTC (permalink / raw)
  To: gdb-patches, binutils; +Cc: dj, raeburn, pkoning, jbglaw, nick, gcc-patches

Thanks folks,

Took me a while to digest all the comments I got on this one..  And
then a VAX isn't actually that fast, even if you simulate it on a
blazingly fast amd64 machine, so it took some time to test.  Here's a
new patch, with the variables renamed, and somewhat better comments.

DJ, if this is ok, can you check this in for me?

Thanks,

Mark


Index: include/ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* floatformat.h (enum floatformat_byteorders): Add
	floatformat_vax.
	(floatformat_vax_aingle, floatformat_vax_double): Declare.

Index: include/floatformat.h
===================================================================
RCS file: /cvs/src/src/include/floatformat.h,v
retrieving revision 1.12
diff -u -p -r1.12 floatformat.h
--- include/floatformat.h 17 Aug 2005 18:03:25 -0000 1.12
+++ include/floatformat.h 31 Aug 2005 07:39:01 -0000
@@ -29,25 +29,26 @@ Foundation, Inc., 51 Franklin Street - F
    (i.e. BITS_BIG_ENDIAN type numbering), and specify which bits each field
    contains with the *_start and *_len fields.  */
 
-/* What is the order of the bytes. */
+/* What is the order of the bytes?  */
 
 enum floatformat_byteorders {
-
   /* Standard little endian byte order.
      EX: 1.2345678e10 => 00 00 80 c5 e0 fe 06 42 */
-
   floatformat_little,
 
   /* Standard big endian byte order.
      EX: 1.2345678e10 => 42 06 fe e0 c5 80 00 00 */
-
   floatformat_big,
 
   /* Little endian byte order but big endian word order.
      EX: 1.2345678e10 => e0 fe 06 42 00 00 80 c5 */
+  floatformat_littlebyte_bigword,
 
-  floatformat_littlebyte_bigword
-
+  /* VAX byte order.  Little endian byte order with 16-bit words.  The
+     following example is an illustration of the byte order only; VAX
+     doesn't have a fully IEEE compliant floating-point format.
+     EX: 1.2345678e10 => 80 c5 00 00 06 42 e0 fe */
+  floatformat_vax
 };
 
 enum floatformat_intbit { floatformat_intbit_yes, floatformat_intbit_no };
@@ -97,6 +98,12 @@ extern const struct floatformat floatfor
 
 extern const struct floatformat floatformat_ieee_double_littlebyte_bigword;
 
+/* floatformats for VAX.  */
+
+extern const struct floatformat floatformat_vax_f;
+extern const struct floatformat floatformat_vax_d;
+extern const struct floatformat floatformat_vax_g;
+
 /* floatformats for various extendeds.  */
 
 extern const struct floatformat floatformat_i387_ext;
Index: libiberty/ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* floatformat.c (floatformat_vax_aingle, floatformat_vax_double):
	New variables.

Index: libiberty/floatformat.c
===================================================================
RCS file: /cvs/src/src/libiberty/floatformat.c,v
retrieving revision 1.16
diff -u -p -r1.16 floatformat.c
--- libiberty/floatformat.c 17 Aug 2005 18:03:42 -0000 1.16
+++ libiberty/floatformat.c 31 Aug 2005 07:39:06 -0000
@@ -108,6 +108,30 @@ const struct floatformat floatformat_iee
   floatformat_always_valid
 };
 
+/* floatformat for VAX.  Not quite IEEE, but close enough.  */
+
+const struct floatformat floatformat_vax_f =
+{
+  floatformat_vax, 32, 0, 1, 8, 129, 0, 9, 23,
+  floatformat_intbit_no,
+  "floatformat_vax_f",
+  floatformat_always_valid
+};
+const struct floatformat floatformat_vax_d =
+{
+  floatformat_vax, 64, 0, 1, 8, 129, 0, 9, 55,
+  floatformat_intbit_no,
+  "floatformat_vax_d",
+  floatformat_always_valid
+};
+const struct floatformat floatformat_vax_g =
+{
+  floatformat_vax, 64, 0, 1, 11, 1025, 0, 12, 52,
+  floatformat_intbit_no,
+  "floatformat_vax_g",
+  floatformat_always_valid
+};
+
 static int floatformat_i387_ext_is_valid (const struct floatformat *fmt,
 					  const void *from);
 


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFA] Add some VAX floating point formats to floatformat.[ch]
  2005-08-31  8:48   ` Mark Kettenis
@ 2005-08-31 17:30     ` Jan-Benedict Glaw
       [not found]       ` <200508312142.j7VLgn8f019978@elgar.sibelius.xs4all.nl>
  0 siblings, 1 reply; 11+ messages in thread
From: Jan-Benedict Glaw @ 2005-08-31 17:30 UTC (permalink / raw)
  To: Mark Kettenis
  Cc: gdb-patches, binutils, dj, raeburn, pkoning, nick, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1135 bytes --]

On Wed, 2005-08-31 09:52:21 +0200, Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
> --- include/floatformat.h 17 Aug 2005 18:03:25 -0000 1.12
> +++ include/floatformat.h 31 Aug 2005 07:39:01 -0000
> @@ -97,6 +98,12 @@ extern const struct floatformat floatfor
>  
>  extern const struct floatformat floatformat_ieee_double_littlebyte_bigword;
>  
> +/* floatformats for VAX.  */
> +
> +extern const struct floatformat floatformat_vax_f;
> +extern const struct floatformat floatformat_vax_d;
> +extern const struct floatformat floatformat_vax_g;
> +
>  /* floatformats for various extendeds.  */
>  
>  extern const struct floatformat floatformat_i387_ext;

What about h_floating? If you're already at cleaning up the FP support
for VAX, could you please add that one, too?

MfG, JBG

-- 
Jan-Benedict Glaw       jbglaw@lug-owl.de    . +49-172-7608481             _ O _
"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O
 für einen Freien Staat voll Freier Bürger"  | im Internet! |   im Irak!   O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFA] Add some VAX floating point formats to floatformat.[ch]
       [not found]       ` <200508312142.j7VLgn8f019978@elgar.sibelius.xs4all.nl>
@ 2005-11-02 10:20         ` Jan-Benedict Glaw
  0 siblings, 0 replies; 11+ messages in thread
From: Jan-Benedict Glaw @ 2005-11-02 10:20 UTC (permalink / raw)
  To: Mark Kettenis
  Cc: gdb-patches, binutils, dj, raeburn, pkoning, nick, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1097 bytes --]

On Wed, 2005-08-31 23:42:49 +0200, Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
> > Date: Wed, 31 Aug 2005 10:48:16 +0200
> > From: Jan-Benedict Glaw <jbglaw@lug-owl.de>
> >
> > What about h_floating? If you're already at cleaning up the FP support
> > for VAX, could you please add that one, too?
> 
> Hmm.  GCC doesn't use h_floating so I have no way to test it, and I'd
> rather not add untested code.

Well, these days I'm having quite some progress with Linux von VAX.
'long double' is currently the same as 'double', both being
implemented by d_floating (or g_floating, if requested). I'm thinking
about switching 'long double' to h_floating, at least for the Linux
port. So I'm really interested in having this for h_float, too.

MfG, JBG

-- 
Jan-Benedict Glaw       jbglaw@lug-owl.de    . +49-172-7608481             _ O _
"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O
 für einen Freien Staat voll Freier Bürger"  | im Internet! |   im Irak!   O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2005-11-02  8:58 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-21 21:59 [RFA] Add some VAX floating point formats to floatformat.[ch] Mark Kettenis
2005-08-22 10:22 ` Nick Clifton
2005-08-22 11:53   ` Mark Kettenis
2005-08-22 16:07     ` Nick Clifton
2005-08-22 16:26       ` Jan-Benedict Glaw
2005-08-22 18:32         ` Paul Koning
2005-08-22 18:40   ` DJ Delorie
2005-08-23 21:58 ` Ken Raeburn
2005-08-31  8:48   ` Mark Kettenis
2005-08-31 17:30     ` Jan-Benedict Glaw
     [not found]       ` <200508312142.j7VLgn8f019978@elgar.sibelius.xs4all.nl>
2005-11-02 10:20         ` Jan-Benedict Glaw

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox