gas/:
[binutils-gdb.git] / gas / config / tc-i370.c
index de67ce3e682fb96beb303c2f33388b8a40694d13..af3b2841e892ebee81482ea95cb337b1923116f9 100644 (file)
@@ -1,14 +1,14 @@
 /* tc-i370.c -- Assembler for the IBM 360/370/390 instruction set.
    Loosely based on the ppc files by Linas Vepstas <linas@linas.org> 1998, 99
    Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-   2004, 2005 Free Software Foundation, Inc.
+   2004, 2005, 2006, 2007 Free Software Foundation, Inc.
    Written by Ian Lance Taylor, Cygnus Support.
 
    This file is part of GAS, the GNU Assembler.
 
    GAS is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    GAS is distributed in the hope that it will be useful,
@@ -27,7 +27,6 @@
    similarities between HLASM and the MRI assemblers, such as section
    names, lack of leading . in pseudo-ops, DC and DS, etc.  */
 
-#include <stdio.h>
 #include "as.h"
 #include "safe-ctype.h"
 #include "subsegs.h"
@@ -959,6 +958,7 @@ i370_dc (int unused ATTRIBUTE_UNUSED)
       emit_expr (&exp, nbytes);
       break;
     case 'E':  /* 32-bit */
+      type = 'f';
     case 'D':  /* 64-bit */
       md_atof (type, tmp, &nbytes);
       p = frag_more (nbytes);
@@ -2102,7 +2102,7 @@ md_assemble (char *str)
 
           if (! register_name (&ex))
            as_bad ("expecting a register for operand %d",
-                   opindex_ptr - opcode->operands + 1);
+                   (int) (opindex_ptr - opcode->operands + 1));
         }
 
       /* Check for an address constant expression.  */
@@ -2356,53 +2356,12 @@ i370_tc (int ignore ATTRIBUTE_UNUSED)
     }
 }
 \f
-/* Turn a string in input_line_pointer into a floating point constant
-   of type TYPE, and store the appropriate bytes in *LITP.  The number
-   of LITTLENUMS emitted is stored in *SIZEP.  An error message is
-   returned, or NULL on OK.  */
-
 char *
 md_atof (int type, char *litp, int *sizep)
 {
-  int prec;
-  LITTLENUM_TYPE words[4];
-  char *t;
-  int i;
-
-  switch (type)
-    {
-    case 'f':
-    case 'E':
-      type = 'f';
-      prec = 2;
-      break;
-
-    case 'd':
-    case 'D':
-      type = 'd';
-      prec = 4;
-      break;
-
-    default:
-      *sizep = 0;
-      return "bad call to md_atof";
-    }
-
   /* 360/370/390 have two float formats: an old, funky 360 single-precision
-   * format, and the ieee format.  Support only the ieee format.  */
-  t = atof_ieee (input_line_pointer, type, words);
-  if (t)
-    input_line_pointer = t;
-
-  *sizep = prec * 2;
-
-  for (i = 0; i < prec; i++)
-    {
-      md_number_to_chars (litp, (valueT) words[i], 2);
-      litp += 2;
-    }
-
-  return NULL;
+     format, and the ieee format.  Support only the ieee format.  */
+  return ieee_md_atof (type, litp, sizep, TRUE);
 }
 
 /* Write a value out to the object file, using the appropriate