* config/sparc/nm-linux.h: Include config/nm-linux.h.
[deliverable/binutils-gdb.git] / gdb / i387-tdep.c
index 20e446d2ff43cd1bc831567779c280132b18f830..f56b3d01a3a60a892c939f5811bf6010255f8b6f 100644 (file)
@@ -166,8 +166,22 @@ static void
 print_i387_value (char *raw)
 {
   DOUBLEST value;
-  
-  floatformat_to_doublest (&floatformat_i387_ext, raw, &value);
+
+  /* Avoid call to floatformat_to_doublest if possible to preserve as
+     much information as possible.  */
+
+#ifdef HAVE_LONG_DOUBLE
+  if (sizeof (value) == sizeof (long double)
+      && HOST_LONG_DOUBLE_FORMAT == &floatformat_i387_ext)
+    {
+      /* Copy straight over, but take care of the padding.  */
+      memcpy (&value, raw, FPU_REG_RAW_SIZE);
+      memset ((char *) &value + FPU_REG_RAW_SIZE, 0,
+             sizeof (value) - FPU_REG_RAW_SIZE);
+    }
+  else
+#endif
+    floatformat_to_doublest (&floatformat_i387_ext, raw, &value);
 
   /* We try to print 19 digits.  The last digit may or may not contain
      garbage, but we'd better print one too many.  We need enough room
This page took 0.024617 seconds and 4 git commands to generate.