*** empty log message ***
authorMichael Meissner <meissner@gcc.gnu.org>
Tue, 2 Jun 1992 19:35:24 +0000 (19:35 +0000)
committerMichael Meissner <meissner@gcc.gnu.org>
Tue, 2 Jun 1992 19:35:24 +0000 (19:35 +0000)
From-SVN: r1138

gcc/config/mips/mips.c
gcc/config/mips/mips.h

index 80eae53ed35a0a1febd02cd76d223f0d27d9a141..612b49582ac577ba76820dde86c1ebbd1817f36a 100644 (file)
@@ -3047,6 +3047,7 @@ mips_debugger_offset (addr, offset)
 
   return offset;
 }
+
 \f
 /* A C compound statement to output to stdio stream STREAM the
    assembler syntax for an instruction operand X.  X is an RTL
@@ -3663,6 +3664,45 @@ mips_declare_object (stream, name, init_string, final_string, size)
     }
 }
 
+\f
+/* Output a double precision value to the assembler.  If both the
+   host and target are IEEE, emit the values in hex.  */
+
+void
+mips_output_double (stream, value)
+     FILE *stream;
+     REAL_VALUE_TYPE value;
+{
+#ifdef REAL_VALUE_TO_TARGET_DOUBLE
+  long value_long[2];
+  REAL_VALUE_TO_TARGET_DOUBLE (value, value_long);
+
+  fprintf (stream, "\t.word\t0x%08lx\t\t# %.20g\n\t.word\t0x%08lx\n",
+          value_long[0], value, value_long[1]);
+#else
+  fprintf (stream, "\t.double\t%.20g\n", value);
+#endif
+}
+
+
+/* Output a single precision value to the assembler.  If both the
+   host and target are IEEE, emit the values in hex.  */
+
+void
+mips_output_float (stream, value)
+     FILE *stream;
+     REAL_VALUE_TYPE value;
+{
+#ifdef REAL_VALUE_TO_TARGET_SINGLE
+  long value_long;
+  REAL_VALUE_TO_TARGET_SINGLE (value, value_long);
+
+  fprintf (stream, "\t.word\t0x%08lx\t\t# %.12g (float)\n", value_long, value);
+#else
+  fprintf (stream, "\t.float\t%.12g\n", value);
+#endif
+}
+
 \f
 /* Return the bytes needed to compute the frame pointer from the current
    stack pointer.
index 041ab49368efa6ac7129fcc373f2241f7936a350..0e631e6ea29851ce15585ec38ccd6f9fb0236916 100644 (file)
@@ -147,7 +147,9 @@ extern int          mips_epilogue_delay_slots ();
 extern char           *mips_fill_delay_slot ();
 extern char           *mips_move_1word ();
 extern char           *mips_move_2words ();
+extern void            mips_output_double ();
 extern int             mips_output_external ();
+extern void            mips_output_float ();
 extern void            mips_output_filename ();
 extern void            mips_output_lineno ();
 extern char           *output_block_move ();
@@ -426,7 +428,7 @@ while (0)
 \f
 /* Print subsidiary information on the compiler version in use.  */
 
-#define MIPS_VERSION "[AL 1.1, MM 18]"
+#define MIPS_VERSION "[AL 1.1, MM 19]"
 
 #ifndef MACHINE_TYPE
 #define MACHINE_TYPE "BSD Mips"
@@ -3006,21 +3008,14 @@ while (0)
 /* This is how to output an assembler line defining a `double' constant.  */
 
 #define ASM_OUTPUT_DOUBLE(STREAM,VALUE)                                        \
-{                                                                      \
-  union { double d; long l[2]; } u2;                                   \
-  u2.d = VALUE;                                                                \
-  fprintf (STREAM, "\t.word\t0x%08lx\t\t# %.20g\n\t.word\t0x%08lx\n",  \
-          u2.l[0], u2.d, u2.l[1]);                                     \
-}
+  mips_output_double (STREAM, VALUE)
+
 
 /* This is how to output an assembler line defining a `float' constant.  */
 
 #define ASM_OUTPUT_FLOAT(STREAM,VALUE)                                 \
-{                                                                      \
-  union { float f; long l; } u2;                                       \
-  u2.f = VALUE;                                                                \
-  fprintf (STREAM, "\t.word\t0x%08lx\t\t# %.12g\n", u2.l, u2.f);       \
-}
+  mips_output_float (STREAM, VALUE)
+
 
 /* This is how to output an assembler line defining an `int' constant.  */