Floating point types in target descriptions

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Floating point types in target descriptions

Paul Brook
The patch below adds ieee_single and ieee_double predefined types for use in
XML target descriptions.  These are needed to describe vector types with
floating point elements.

I considered using "float"/"double" and/or "float32"/"float64". However the
former are ambiguous with the "float" register type, and the latter don't
really tell you want you're getting. If targets need non-ieee types they can
add them like arm_fpa_ext.

Ok?

Paul

2007-04-13  Paul Brook  <[hidden email]>

        * target-descriptions.c (tdesc_named_type): Add ieee_single and
        ieee_double.
        * doc/gdb.texinfo: Document ieee_single and ieee_double target types.

Index: gdb/doc/gdb.texinfo
===================================================================
--- gdb/doc/gdb.texinfo (revision 168411)
+++ gdb/doc/gdb.texinfo (working copy)
@@ -26070,6 +26070,12 @@ pointers; printing a code pointer conver
 address.  The stack pointer and any dedicated address registers
 may be marked as data pointers.
 
+@item ieee_single
+Single precision IEEE floating point.
+
+@item ieee_double
+Double precision IEEE floating point.
+
 @item arm_fpa_ext
 The 12-byte extended precision format used by ARM FPA registers.
 
Index: gdb/target-descriptions.c
===================================================================
--- gdb/target-descriptions.c (revision 168411)
+++ gdb/target-descriptions.c (working copy)
@@ -409,6 +409,12 @@ tdesc_named_type (const struct tdesc_fea
   if (strcmp (id, "uint64") == 0)
     return builtin_type_uint64;
 
+  if (strcmp (id, "ieee_single") == 0)
+    return builtin_type_ieee_single;
+
+  if (strcmp (id, "ieee_double") == 0)
+    return builtin_type_ieee_double;
+
   if (strcmp (id, "arm_fpa_ext") == 0)
     return builtin_type_arm_ext;
 
Reply | Threaded
Open this post in threaded view
|

Re: Floating point types in target descriptions

Daniel Jacobowitz-2
On Fri, Apr 13, 2007 at 01:48:09PM +0100, Paul Brook wrote:

> The patch below adds ieee_single and ieee_double predefined types for use in
> XML target descriptions.  These are needed to describe vector types with
> floating point elements.
>
> I considered using "float"/"double" and/or "float32"/"float64". However the
> former are ambiguous with the "float" register type, and the latter don't
> really tell you want you're getting. If targets need non-ieee types they can
> add them like arm_fpa_ext.
>
> Ok?

Thanks, this is OK.

--
Daniel Jacobowitz
CodeSourcery
Reply | Threaded
Open this post in threaded view
|

Re: Floating point types in target descriptions

Paul Brook
On Friday 13 April 2007 14:53, Daniel Jacobowitz wrote:
> On Fri, Apr 13, 2007 at 01:48:09PM +0100, Paul Brook wrote:
> > The patch below adds ieee_single and ieee_double predefined types for use
> > in XML target descriptions.  These are needed to describe vector types
> > with floating point elements.
>
> Thanks, this is OK.

Applied to CVS head.

Paul