Floating point types in target descriptions

Paul Brook
2007-04-13T12:48:21Z

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 <paul@codesourcery.com>

* 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;