include/ChangeLog:
authorUlrich Weigand <uweigand@de.ibm.com>
Tue, 6 Jul 2010 12:56:24 +0000 (12:56 +0000)
committerUlrich Weigand <uweigand@de.ibm.com>
Tue, 6 Jul 2010 12:56:24 +0000 (12:56 +0000)
2010-07-06  Ken Werner  <ken.werner@de.ibm.com>

* floatformat.h (floatformat_ieee_half_big): Add declaration.
(floatformat_ieee_half_little): Likewise.

libiberty/ChangeLog:

2010-07-06  Ken Werner  <ken.werner@de.ibm.com>

* floatformat.c (floatformat_ieee_half_big): New variable.
(floatformat_ieee_half_little): Likewise.

gdb/ChangeLog:

2010-07-06  Ken Werner  <ken.werner@de.ibm.com>

* gdbtypes.h (floatformats_ieee_half): Add declaration.
* gdbtypes.c (floatformats_ieee_half): New variable.
* doublest.c (floatformat_from_length): Set format to
gdbarch_half_format if length matches.
* gdbarch.sh (half_bit): New architecture method.
(half_format): Likewise.
* gdbarch.h: Regenerate.
* gdbarch.c: Likewise.

gdb/ChangeLog
gdb/doublest.c
gdb/gdbarch.c
gdb/gdbarch.h
gdb/gdbarch.sh
gdb/gdbtypes.c
gdb/gdbtypes.h
include/ChangeLog
include/floatformat.h
libiberty/ChangeLog
libiberty/floatformat.c

index 061bf554b7d0283c7ffe826f68e02c3ce20065b9..375f0553f92199a29469dc39685536920bdff79c 100644 (file)
@@ -1,3 +1,14 @@
+2010-07-06  Ken Werner  <ken.werner@de.ibm.com>
+
+       * gdbtypes.h (floatformats_ieee_half): Add declaration.
+       * gdbtypes.c (floatformats_ieee_half): New variable.
+       * doublest.c (floatformat_from_length): Set format to
+       gdbarch_half_format if length matches.
+       * gdbarch.sh (half_bit): New architecture method.
+       (half_format): Likewise.
+       * gdbarch.h: Regenerate.
+       * gdbarch.c: Likewise.
+
 2010-07-05  Jan Kratochvil  <jan.kratochvil@redhat.com>
            Joel Brobecker  <brobecker@adacore.com>
 
index 0dc09ab9b9b9a97c3c5b94b0bea565cf60cfb4c5..7e8b34345f9cb5aea70128a6521b73a82e88df3e 100644 (file)
@@ -777,7 +777,10 @@ floatformat_from_length (struct gdbarch *gdbarch, int len)
 {
   const struct floatformat *format;
 
-  if (len * TARGET_CHAR_BIT == gdbarch_float_bit (gdbarch))
+  if (len * TARGET_CHAR_BIT == gdbarch_half_bit (gdbarch))
+    format = gdbarch_half_format (gdbarch)
+              [gdbarch_byte_order (gdbarch)];
+  else if (len * TARGET_CHAR_BIT == gdbarch_float_bit (gdbarch))
     format = gdbarch_float_format (gdbarch)
               [gdbarch_byte_order (gdbarch)];
   else if (len * TARGET_CHAR_BIT == gdbarch_double_bit (gdbarch))
index bf41ab3441c13344d7670a88867fc01ac3ae46fe..103abcb66c9745a79ca365902fd166a851844057 100644 (file)
@@ -145,6 +145,8 @@ struct gdbarch
   int int_bit;
   int long_bit;
   int long_long_bit;
+  int half_bit;
+  const struct floatformat ** half_format;
   int float_bit;
   const struct floatformat ** float_format;
   int double_bit;
@@ -293,6 +295,8 @@ struct gdbarch startup_gdbarch =
   8 * sizeof (int),  /* int_bit */
   8 * sizeof (long),  /* long_bit */
   8 * sizeof (LONGEST),  /* long_long_bit */
+  16,  /* half_bit */
+  0,  /* half_format */
   8 * sizeof (float),  /* float_bit */
   0,  /* float_format */
   8 * sizeof (double),  /* double_bit */
@@ -451,6 +455,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
   gdbarch->int_bit = 4*TARGET_CHAR_BIT;
   gdbarch->long_bit = 4*TARGET_CHAR_BIT;
   gdbarch->long_long_bit = 2*gdbarch->long_bit;
+  gdbarch->half_bit = 2*TARGET_CHAR_BIT;
   gdbarch->float_bit = 4*TARGET_CHAR_BIT;
   gdbarch->double_bit = 8*TARGET_CHAR_BIT;
   gdbarch->long_double_bit = 8*TARGET_CHAR_BIT;
@@ -562,6 +567,9 @@ verify_gdbarch (struct gdbarch *gdbarch)
   /* Skip verify of int_bit, invalid_p == 0 */
   /* Skip verify of long_bit, invalid_p == 0 */
   /* Skip verify of long_long_bit, invalid_p == 0 */
+  /* Skip verify of half_bit, invalid_p == 0 */
+  if (gdbarch->half_format == 0)
+    gdbarch->half_format = floatformats_ieee_half;
   /* Skip verify of float_bit, invalid_p == 0 */
   if (gdbarch->float_format == 0)
     gdbarch->float_format = floatformats_ieee_single;
@@ -934,6 +942,12 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
   fprintf_unfiltered (file,
                       "gdbarch_dump: get_syscall_number = <%s>\n",
                       host_address_to_string (gdbarch->get_syscall_number));
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: half_bit = %s\n",
+                      plongest (gdbarch->half_bit));
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: half_format = %s\n",
+                      pformat (gdbarch->half_format));
   fprintf_unfiltered (file,
                       "gdbarch_dump: has_dos_based_file_system = %s\n",
                       plongest (gdbarch->has_dos_based_file_system));
@@ -1374,6 +1388,39 @@ set_gdbarch_long_long_bit (struct gdbarch *gdbarch,
   gdbarch->long_long_bit = long_long_bit;
 }
 
+int
+gdbarch_half_bit (struct gdbarch *gdbarch)
+{
+  gdb_assert (gdbarch != NULL);
+  /* Skip verify of half_bit, invalid_p == 0 */
+  if (gdbarch_debug >= 2)
+    fprintf_unfiltered (gdb_stdlog, "gdbarch_half_bit called\n");
+  return gdbarch->half_bit;
+}
+
+void
+set_gdbarch_half_bit (struct gdbarch *gdbarch,
+                      int half_bit)
+{
+  gdbarch->half_bit = half_bit;
+}
+
+const struct floatformat **
+gdbarch_half_format (struct gdbarch *gdbarch)
+{
+  gdb_assert (gdbarch != NULL);
+  if (gdbarch_debug >= 2)
+    fprintf_unfiltered (gdb_stdlog, "gdbarch_half_format called\n");
+  return gdbarch->half_format;
+}
+
+void
+set_gdbarch_half_format (struct gdbarch *gdbarch,
+                         const struct floatformat ** half_format)
+{
+  gdbarch->half_format = half_format;
+}
+
 int
 gdbarch_float_bit (struct gdbarch *gdbarch)
 {
index e0c933cb469088b37a298d8b31aff301dfa99d0a..cfc777ee1d6a576bfe99192ff937794b979c3e96 100644 (file)
@@ -118,12 +118,18 @@ extern void set_gdbarch_long_bit (struct gdbarch *gdbarch, int long_bit);
 extern int gdbarch_long_long_bit (struct gdbarch *gdbarch);
 extern void set_gdbarch_long_long_bit (struct gdbarch *gdbarch, int long_long_bit);
 
-/* The ABI default bit-size and format for "float", "double", and "long
-   double".  These bit/format pairs should eventually be combined into
-   a single object.  For the moment, just initialize them as a pair.
+/* The ABI default bit-size and format for "half", "float", "double", and
+   "long double".  These bit/format pairs should eventually be combined
+   into a single object.  For the moment, just initialize them as a pair.
    Each format describes both the big and little endian layouts (if
    useful). */
 
+extern int gdbarch_half_bit (struct gdbarch *gdbarch);
+extern void set_gdbarch_half_bit (struct gdbarch *gdbarch, int half_bit);
+
+extern const struct floatformat ** gdbarch_half_format (struct gdbarch *gdbarch);
+extern void set_gdbarch_half_format (struct gdbarch *gdbarch, const struct floatformat ** half_format);
+
 extern int gdbarch_float_bit (struct gdbarch *gdbarch);
 extern void set_gdbarch_float_bit (struct gdbarch *gdbarch, int float_bit);
 
index 1e9a4893831c3f60b77cdd9d71af9fe7a02ce92e..eece393c990cc5a2b04a6190c209e3c0675aa94b 100755 (executable)
@@ -363,12 +363,14 @@ v:int:long_bit:::8 * sizeof (long):4*TARGET_CHAR_BIT::0
 # machine.
 v:int:long_long_bit:::8 * sizeof (LONGEST):2*gdbarch->long_bit::0
 
-# The ABI default bit-size and format for "float", "double", and "long
-# double".  These bit/format pairs should eventually be combined into
-# a single object.  For the moment, just initialize them as a pair.
+# The ABI default bit-size and format for "half", "float", "double", and
+# "long double".  These bit/format pairs should eventually be combined
+# into a single object.  For the moment, just initialize them as a pair.
 # Each format describes both the big and little endian layouts (if
 # useful).
 
+v:int:half_bit:::16:2*TARGET_CHAR_BIT::0
+v:const struct floatformat **:half_format:::::floatformats_ieee_half::pformat (gdbarch->half_format)
 v:int:float_bit:::8 * sizeof (float):4*TARGET_CHAR_BIT::0
 v:const struct floatformat **:float_format:::::floatformats_ieee_single::pformat (gdbarch->float_format)
 v:int:double_bit:::8 * sizeof (double):8*TARGET_CHAR_BIT::0
index ba8c7e41243d1534f94db34c00d8aa5ab9871633..443f6f7a10c5f2136289ff4f1b19ac5f6e1c76c7 100644 (file)
 
 
 /* Floatformat pairs.  */
+const struct floatformat *floatformats_ieee_half[BFD_ENDIAN_UNKNOWN] = {
+  &floatformat_ieee_half_big,
+  &floatformat_ieee_half_little
+};
 const struct floatformat *floatformats_ieee_single[BFD_ENDIAN_UNKNOWN] = {
   &floatformat_ieee_single_big,
   &floatformat_ieee_single_little
index 2a9bc9bd046647f20425e99b2e23f38e258f89c6..085270e21d28324bd6872759047221c03607c7b2 100644 (file)
@@ -1191,6 +1191,7 @@ extern const struct objfile_type *objfile_type (struct objfile *objfile);
 
  
 /* Explicit floating-point formats.  See "floatformat.h".  */
+extern const struct floatformat *floatformats_ieee_half[BFD_ENDIAN_UNKNOWN];
 extern const struct floatformat *floatformats_ieee_single[BFD_ENDIAN_UNKNOWN];
 extern const struct floatformat *floatformats_ieee_double[BFD_ENDIAN_UNKNOWN];
 extern const struct floatformat *floatformats_ieee_double_littlebyte_bigword[BFD_ENDIAN_UNKNOWN];
index 4fb2a44894c7e7443461d5066be3bf1f54aee44b..91b2edbed0f2b742d0b0540f5cb75d10d871c29d 100644 (file)
@@ -1,3 +1,8 @@
+2010-07-06  Ken Werner  <ken.werner@de.ibm.com>
+
+       * floatformat.h (floatformat_ieee_half_big): Add declaration.
+       (floatformat_ieee_half_little): Likewise.
+
 2010-06-29  Alan Modra  <amodra@gmail.com>
 
        * dis-asm.h: Remove references to maxq.
index c5f60a3cd93a285dfb8d3e063a614bd196a7a125..0fc8e75dc8b3316a05022406c8d75e296ad9a7be 100644 (file)
@@ -96,6 +96,8 @@ struct floatformat
 
 /* floatformats for IEEE single and double, big and little endian.  */
 
+extern const struct floatformat floatformat_ieee_half_big;
+extern const struct floatformat floatformat_ieee_half_little;
 extern const struct floatformat floatformat_ieee_single_big;
 extern const struct floatformat floatformat_ieee_single_little;
 extern const struct floatformat floatformat_ieee_double_big;
index a16e393d0277da81b383f31ea13beb2b93542004..1b1610b6929aaddc789c9ef375b794688feabfe2 100644 (file)
@@ -1,3 +1,8 @@
+2010-07-06  Ken Werner  <ken.werner@de.ibm.com>
+
+       * floatformat.c (floatformat_ieee_half_big): New variable.
+       (floatformat_ieee_half_little): Likewise.
+
 2010-06-14  Gerald Pfeifer  <gerald@pfeifer.com>
 
        * libiberty.texi: Remove reference to GCC 3 and 2001 (thrice).
index cbf13ea3406076ec7efd052d408ac135ec2eda09..4819507cbdd2812ee3cda622a07dd66c713c9458 100644 (file)
@@ -77,7 +77,23 @@ floatformat_always_valid (const struct floatformat *fmt ATTRIBUTE_UNUSED,
    a system header, what we do if not, etc.  */
 #define FLOATFORMAT_CHAR_BIT 8
 
-/* floatformats for IEEE single and double, big and little endian.  */
+/* floatformats for IEEE half, single and double, big and little endian.  */
+const struct floatformat floatformat_ieee_half_big =
+{
+  floatformat_big, 16, 0, 1, 5, 15, 31, 6, 10,
+  floatformat_intbit_no,
+  "floatformat_ieee_half_big",
+  floatformat_always_valid,
+  NULL
+};
+const struct floatformat floatformat_ieee_half_little =
+{
+  floatformat_little, 16, 0, 1, 5, 15, 31, 6, 10,
+  floatformat_intbit_no,
+  "floatformat_ieee_half_little",
+  floatformat_always_valid,
+  NULL
+};
 const struct floatformat floatformat_ieee_single_big =
 {
   floatformat_big, 32, 0, 1, 8, 127, 255, 9, 23,
This page took 0.040406 seconds and 4 git commands to generate.