2004-08-08 Andrew Cagney <cagney@gnu.org>
authorAndrew Cagney <cagney@redhat.com>
Sun, 8 Aug 2004 17:18:16 +0000 (17:18 +0000)
committerAndrew Cagney <cagney@redhat.com>
Sun, 8 Aug 2004 17:18:16 +0000 (17:18 +0000)
* gdbtypes.c (builtin_type_arm_ext, builtin_type_ieee_single)
(builtin_type_ieee_double, builtin_type_ia64_quad)
(builtin_type_ia64_spill, _initialize_gdbtypes): Add tables of
BE/LE floating-point types.
* gdbtypes.h (builtin_type_arm_ext, builtin_type_ieee_single)
(builtin_type_ieee_double, builtin_type_ia64_quad)
(builtin_type_ia64_spill): Declare.
* doublest.c (_initialize_doublest, floatformat_ieee_single)
(floatformat_ieee_double, floatformat_arm_ext)
(floatformat_ia64_spill, floatformat_ia64_quad): Add tables
of LE/BE floatformats.
* doublest.h: (struct floatformat, floatformat_ieee_single)
(floatformat_ieee_double, floatformat_arm_ext)
(floatformat_ia64_spill, floatformat_ia64_quad): Declare.

gdb/ChangeLog
gdb/doublest.c
gdb/doublest.h
gdb/gdbtypes.c
gdb/gdbtypes.h

index b4bf80ae1bd6e1b66e63fed8a11c6d05ae214418..3657a77c39e01ca639a7b96600d0e32e1eadef8f 100644 (file)
@@ -1,3 +1,20 @@
+2004-08-08  Andrew Cagney  <cagney@gnu.org>
+
+       * gdbtypes.c (builtin_type_arm_ext, builtin_type_ieee_single)
+       (builtin_type_ieee_double, builtin_type_ia64_quad)
+       (builtin_type_ia64_spill, _initialize_gdbtypes): Add tables of
+       BE/LE floating-point types.
+       * gdbtypes.h (builtin_type_arm_ext, builtin_type_ieee_single)
+       (builtin_type_ieee_double, builtin_type_ia64_quad)
+       (builtin_type_ia64_spill): Declare.
+       * doublest.c (_initialize_doublest, floatformat_ieee_single)
+       (floatformat_ieee_double, floatformat_arm_ext)
+       (floatformat_ia64_spill, floatformat_ia64_quad): Add tables
+       of LE/BE floatformats.  
+       * doublest.h: (struct floatformat, floatformat_ieee_single)
+       (floatformat_ieee_double, floatformat_arm_ext)
+       (floatformat_ia64_spill, floatformat_ia64_quad): Declare.
+
 2004-08-08  Mark Kettenis  <kettenis@gnu.org>
 
        * i386gnu-nat.c (gnu_store_registers): Fix typo.
index e4dbb2ae50baedb41940e8f158f2bc0c80dabc30..89912419c7daae5716c2df7fae94775498d8ec48 100644 (file)
@@ -811,3 +811,26 @@ convert_typed_floating (const void *from, const struct type *from_type,
       floatformat_from_doublest (to_fmt, &d, to);
     }
 }
+
+const struct floatformat *floatformat_ieee_single[BFD_ENDIAN_UNKNOWN];
+const struct floatformat *floatformat_ieee_double[BFD_ENDIAN_UNKNOWN];
+const struct floatformat *floatformat_arm_ext[BFD_ENDIAN_UNKNOWN];
+const struct floatformat *floatformat_ia64_spill[BFD_ENDIAN_UNKNOWN];
+const struct floatformat *floatformat_ia64_quad[BFD_ENDIAN_UNKNOWN];
+
+extern void _initialize_doublest (void);
+
+extern void
+_initialize_doublest (void)
+{
+  floatformat_ieee_single[BFD_ENDIAN_LITTLE] = &floatformat_ieee_single_little;
+  floatformat_ieee_single[BFD_ENDIAN_BIG] = &floatformat_ieee_single_big;
+  floatformat_ieee_double[BFD_ENDIAN_LITTLE] = &floatformat_ieee_double_little;
+  floatformat_ieee_double[BFD_ENDIAN_BIG] = &floatformat_ieee_double_big;
+  floatformat_arm_ext[BFD_ENDIAN_LITTLE] = &floatformat_arm_ext_littlebyte_bigword;
+  floatformat_arm_ext[BFD_ENDIAN_BIG] = &floatformat_arm_ext_big;
+  floatformat_ia64_spill[BFD_ENDIAN_LITTLE] = &floatformat_ia64_spill_little;
+  floatformat_ia64_spill[BFD_ENDIAN_BIG] = &floatformat_ia64_spill_big;
+  floatformat_ia64_quad[BFD_ENDIAN_LITTLE] = &floatformat_ia64_quad_little;
+  floatformat_ia64_quad[BFD_ENDIAN_BIG] = &floatformat_ia64_quad_big;
+}
index 668efa71cf3a55513e62e171d620eda64cbe86f8..a568862e25e33dd50d98becaa266b1facad21080 100644 (file)
@@ -25,6 +25,7 @@
 #define DOUBLEST_H
 
 struct type;
+struct floatformat;
 
 /* Setup definitions for host and target floating point formats.  We need to
    consider the format for `float', `double', and `long double' for both target
@@ -87,4 +88,11 @@ extern void convert_typed_floating (const void *from,
                                    const struct type *from_type,
                                     void *to, const struct type *to_type);
 
+/* Table of convenient float-formats.  */
+extern const struct floatformat *floatformat_ieee_single[BFD_ENDIAN_UNKNOWN];
+extern const struct floatformat *floatformat_ieee_double[BFD_ENDIAN_UNKNOWN];
+extern const struct floatformat *floatformat_arm_ext[BFD_ENDIAN_UNKNOWN];
+extern const struct floatformat *floatformat_ia64_spill[BFD_ENDIAN_UNKNOWN];
+extern const struct floatformat *floatformat_ia64_quad[BFD_ENDIAN_UNKNOWN];
+
 #endif
index e42d118e8e14cbbcff1523cea176e55adfe15cf1..f8604bc151a6bb5897d52d9484e8f61e6c76ab71 100644 (file)
@@ -97,8 +97,10 @@ struct type *builtin_type_vec64;
 struct type *builtin_type_vec64i;
 struct type *builtin_type_vec128;
 struct type *builtin_type_vec128i;
+struct type *builtin_type_ieee_single[BFD_ENDIAN_UNKNOWN];
 struct type *builtin_type_ieee_single_big;
 struct type *builtin_type_ieee_single_little;
+struct type *builtin_type_ieee_double[BFD_ENDIAN_UNKNOWN];
 struct type *builtin_type_ieee_double_big;
 struct type *builtin_type_ieee_double_little;
 struct type *builtin_type_ieee_double_littlebyte_bigword;
@@ -107,10 +109,13 @@ struct type *builtin_type_m68881_ext;
 struct type *builtin_type_i960_ext;
 struct type *builtin_type_m88110_ext;
 struct type *builtin_type_m88110_harris_ext;
+struct type *builtin_type_arm_ext[BFD_ENDIAN_UNKNOWN];
 struct type *builtin_type_arm_ext_big;
 struct type *builtin_type_arm_ext_littlebyte_bigword;
+struct type *builtin_type_ia64_spill[BFD_ENDIAN_UNKNOWN];
 struct type *builtin_type_ia64_spill_big;
 struct type *builtin_type_ia64_spill_little;
+struct type *builtin_type_ia64_quad[BFD_ENDIAN_UNKNOWN];
 struct type *builtin_type_ia64_quad_big;
 struct type *builtin_type_ia64_quad_little;
 struct type *builtin_type_void_data_ptr;
@@ -3577,6 +3582,14 @@ _initialize_gdbtypes (void)
     init_type (TYPE_CODE_FLT, floatformat_ieee_single_little.totalsize / 8,
               0, "builtin_type_ieee_single_little", NULL);
   TYPE_FLOATFORMAT (builtin_type_ieee_single_little) = &floatformat_ieee_single_little;
+  builtin_type_ieee_single[BFD_ENDIAN_BIG]
+    = build_flt (floatformat_ieee_single_big.totalsize,
+                "builtin_type_ieee_single_big",
+                &floatformat_ieee_single_big);
+  builtin_type_ieee_single[BFD_ENDIAN_LITTLE]
+    = build_flt (floatformat_ieee_single_little.totalsize,
+                "builtin_type_ieee_single_little",
+                &floatformat_ieee_single_little);
   builtin_type_ieee_double_big =
     init_type (TYPE_CODE_FLT, floatformat_ieee_double_big.totalsize / 8,
               0, "builtin_type_ieee_double_big", NULL);
@@ -3585,6 +3598,14 @@ _initialize_gdbtypes (void)
     init_type (TYPE_CODE_FLT, floatformat_ieee_double_little.totalsize / 8,
               0, "builtin_type_ieee_double_little", NULL);
   TYPE_FLOATFORMAT (builtin_type_ieee_double_little) = &floatformat_ieee_double_little;
+  builtin_type_ieee_double[BFD_ENDIAN_BIG]
+    = build_flt (floatformat_ieee_double_big.totalsize,
+                "builtin_type_ieee_double_big",
+                &floatformat_ieee_double_big);
+  builtin_type_ieee_double[BFD_ENDIAN_LITTLE]
+    = build_flt (floatformat_ieee_double_little.totalsize,
+                "builtin_type_ieee_double_little",
+                &floatformat_ieee_double_little);
   builtin_type_ieee_double_littlebyte_bigword =
     init_type (TYPE_CODE_FLT, floatformat_ieee_double_littlebyte_bigword.totalsize / 8,
               0, "builtin_type_ieee_double_littlebyte_bigword", NULL);
@@ -3617,6 +3638,14 @@ _initialize_gdbtypes (void)
     init_type (TYPE_CODE_FLT, floatformat_arm_ext_littlebyte_bigword.totalsize / 8,
               0, "builtin_type_arm_ext_littlebyte_bigword", NULL);
   TYPE_FLOATFORMAT (builtin_type_arm_ext_littlebyte_bigword) = &floatformat_arm_ext_littlebyte_bigword;
+  builtin_type_arm_ext[BFD_ENDIAN_BIG]
+    = build_flt (floatformat_arm_ext_big.totalsize,
+                "builtin_type_arm_ext_big",
+                &floatformat_arm_ext_big);
+  builtin_type_arm_ext[BFD_ENDIAN_LITTLE]
+    = build_flt (floatformat_arm_ext_littlebyte_bigword.totalsize,
+                "builtin_type_arm_ext_littlebyte_bigword",
+                &floatformat_arm_ext_littlebyte_bigword);
   builtin_type_ia64_spill_big =
     init_type (TYPE_CODE_FLT, floatformat_ia64_spill_big.totalsize / 8,
               0, "builtin_type_ia64_spill_big", NULL);
@@ -3625,6 +3654,14 @@ _initialize_gdbtypes (void)
     init_type (TYPE_CODE_FLT, floatformat_ia64_spill_little.totalsize / 8,
               0, "builtin_type_ia64_spill_little", NULL);
   TYPE_FLOATFORMAT (builtin_type_ia64_spill_little) = &floatformat_ia64_spill_little;
+  builtin_type_ia64_spill[BFD_ENDIAN_BIG]
+    = build_flt (floatformat_ia64_spill_big.totalsize,
+                "builtin_type_ia64_spill_big",
+                &floatformat_ia64_spill_big);
+  builtin_type_ia64_spill[BFD_ENDIAN_LITTLE]
+    = build_flt (floatformat_ia64_spill_little.totalsize,
+                "builtin_type_ia64_spill_little",
+                &floatformat_ia64_spill_little);
   builtin_type_ia64_quad_big =
     init_type (TYPE_CODE_FLT, floatformat_ia64_quad_big.totalsize / 8,
               0, "builtin_type_ia64_quad_big", NULL);
@@ -3633,6 +3670,14 @@ _initialize_gdbtypes (void)
     init_type (TYPE_CODE_FLT, floatformat_ia64_quad_little.totalsize / 8,
               0, "builtin_type_ia64_quad_little", NULL);
   TYPE_FLOATFORMAT (builtin_type_ia64_quad_little) = &floatformat_ia64_quad_little;
+  builtin_type_ia64_quad[BFD_ENDIAN_BIG]
+    = build_flt (floatformat_ia64_quad_big.totalsize,
+                "builtin_type_ia64_quad_big",
+                &floatformat_ia64_quad_big);
+  builtin_type_ia64_quad[BFD_ENDIAN_LITTLE]
+    = build_flt (floatformat_ia64_quad_little.totalsize,
+                "builtin_type_ia64_quad_little",
+                &floatformat_ia64_quad_little);
 
   deprecated_add_show_from_set
     (add_set_cmd ("overload", no_class, var_zinteger, (char *) &overload_debug,
index a9d98dcbfddc63864a566ccd3b57af43cbfc9cad..3f90f6c3f06f67bb2e58f9e5dba99b445b2a261e 100644 (file)
@@ -1050,8 +1050,10 @@ extern struct type *builtin_type_vec128;
 extern struct type *builtin_type_vec128i;
 
 /* Explicit floating-point formats.  See "floatformat.h".  */
+extern struct type *builtin_type_ieee_single[BFD_ENDIAN_UNKNOWN];
 extern struct type *builtin_type_ieee_single_big;
 extern struct type *builtin_type_ieee_single_little;
+extern struct type *builtin_type_ieee_double[BFD_ENDIAN_UNKNOWN];
 extern struct type *builtin_type_ieee_double_big;
 extern struct type *builtin_type_ieee_double_little;
 extern struct type *builtin_type_ieee_double_littlebyte_bigword;
@@ -1060,10 +1062,13 @@ extern struct type *builtin_type_m68881_ext;
 extern struct type *builtin_type_i960_ext;
 extern struct type *builtin_type_m88110_ext;
 extern struct type *builtin_type_m88110_harris_ext;
+extern struct type *builtin_type_arm_ext[BFD_ENDIAN_UNKNOWN];
 extern struct type *builtin_type_arm_ext_big;
 extern struct type *builtin_type_arm_ext_littlebyte_bigword;
+extern struct type *builtin_type_ia64_spill[BFD_ENDIAN_UNKNOWN];
 extern struct type *builtin_type_ia64_spill_big;
 extern struct type *builtin_type_ia64_spill_little;
+extern struct type *builtin_type_ia64_quad[BFD_ENDIAN_UNKNOWN];
 extern struct type *builtin_type_ia64_quad_big;
 extern struct type *builtin_type_ia64_quad_little;