]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* config/tc-a29k.c (md_operand): Handle $float, $double, and
authorIan Lance Taylor <ian@airs.com>
Thu, 9 Nov 1995 01:01:44 +0000 (01:01 +0000)
committerIan Lance Taylor <ian@airs.com>
Thu, 9 Nov 1995 01:01:44 +0000 (01:01 +0000)
$extend.  Based on code from Eric Freudenthal
<freudenthal@nyu.edu>.
* config/tc-a29k.h (LEX_DOLLAR): Define.
* read.c (LEX_DOLLAR): Define if not defined.
(lex_type): Use LEX_DOLLAR.

gas/ChangeLog
gas/config/tc-a29k.c
gas/config/tc-a29k.h

index d32872d0eff9ab2d6fb1ada4110d14ab8f999115..d939a071164b241391cafb8134bcc6a882d05649 100644 (file)
@@ -1,3 +1,12 @@
+Wed Nov  8 19:59:36 1995  Ian Lance Taylor  <ian@cygnus.com>
+
+       * config/tc-a29k.c (md_operand): Handle $float, $double, and
+       $extend.  Based on code from Eric Freudenthal
+       <freudenthal@nyu.edu>.
+       * config/tc-a29k.h (LEX_DOLLAR): Define.
+       * read.c (LEX_DOLLAR): Define if not defined.
+       (lex_type): Use LEX_DOLLAR.
+
 Wed Nov  8 16:38:14 1995  Eric Freudenthal <freudenthal@nyu.edu>
 
        * configure.in (a29k-nyu-sym1): New target, just like other a29k
index 96b13d9dfc3b74888724f9523b95b04c1cc4a114..6da39d01f9bcada34e6163fa9e700727aad6c5a2 100644 (file)
@@ -1148,6 +1148,77 @@ md_operand (expressionP)
       else
        expressionP->X_op = O_constant;
     }
+  else if (input_line_pointer[0] == '$')
+    {
+      char *s;
+      char type;
+      int fieldnum, fieldlimit;
+      LITTLENUM_TYPE floatbuf[8];
+
+      /* $float(), $doubleN(), or $extendN() convert floating values
+        to integers.  */
+
+      s = input_line_pointer;
+
+      ++s;
+
+      fieldnum = 0;
+      if (strncmp (s, "double", sizeof "double" - 1) == 0)
+       {
+         s += sizeof "double" - 1;
+         type = 'd';
+         fieldlimit = 2;
+       }
+      else if (strncmp (s, "float", sizeof "float" - 1) == 0)
+       {
+         s += sizeof "float" - 1;
+         type = 'f';
+         fieldlimit = 1;
+       }
+      else if (strncmp (s, "extend", sizeof "extend" - 1) == 0)
+       {
+         s += sizeof "extend" - 1;
+         type = 'x';
+         fieldlimit = 4;
+       }
+      else 
+       {
+         /* FIXME: We should handle a29k local labels here.  */
+         return;
+       }
+
+      if (isdigit (*s))
+       {
+         fieldnum = *s - '0';
+         ++s;
+       }
+      if (fieldnum >= fieldlimit)
+       return;
+
+      SKIP_WHITESPACE ();
+      if (*s != '(')
+       return;
+      ++s;
+      SKIP_WHITESPACE ();
+
+      s = atof_ieee (s, type, floatbuf);
+      if (s == NULL)
+       return;
+      s = s;
+
+      SKIP_WHITESPACE ();
+      if (*s != ')')
+       return;
+      ++s;
+      SKIP_WHITESPACE ();
+
+      input_line_pointer = s;
+      expressionP->X_op = O_constant; 
+      expressionP->X_unsigned = 1;
+      expressionP->X_add_number = ((floatbuf[fieldnum * 2]
+                                   << LITTLENUM_NUMBER_OF_BITS)
+                                  + floatbuf[fieldnum * 2 + 1]);
+    }
 }
 
 /* Round up a section size to the appropriate boundary.  */
index 5f4f2b2f96ad66bc4c8aed7ce8a544c9b1e60c41..1c36f07fc9972cefd993261b12533ebb8c51a467 100644 (file)
@@ -21,6 +21,8 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307
 
 #define TARGET_BYTES_BIG_ENDIAN        1
 
+#define LEX_DOLLAR 1
+
 #define tc_headers_hook(a)             ;       /* not used */
 #define tc_headers_hook(a)             ;       /* not used */
 #define tc_crawl_symbol_chain(a)       ;       /* not used */