* config/rx-defs.h: Add macros for RX100, RX200, RX600, and
authorNick Clifton <nickc@redhat.com>
Thu, 18 Jul 2013 12:15:15 +0000 (12:15 +0000)
committerNick Clifton <nickc@redhat.com>
Thu, 18 Jul 2013 12:15:15 +0000 (12:15 +0000)
RX610.
        * config/rx-parse.y: (rx_check_float_support): Add function to
check floating point operation support for target RX100 and
RX200.
        * config/tc-rx.c: Add CPU options RX100, RX200, RX600, and RX610.
        * doc/c-rx.texi: Add -mcpu option to recognize macros for RX100,
        RX200, RX600, and RX610

gas/ChangeLog
gas/config/rx-defs.h
gas/config/rx-parse.y
gas/config/tc-rx.c
gas/doc/c-rx.texi

index 3ca1cd6151c7f3d27f4e9a7ddd277c497f483f9e..87908d7267ffa615e86a2fba22d465abf81378d9 100644 (file)
@@ -1,3 +1,14 @@
+2013-07-18  Sandeep Kumar Singh  <Sandeep.Singh2@kpitcummins.com>
+
+        * config/rx-defs.h: Add macros for RX100, RX200, RX600, and
+       RX610.
+        * config/rx-parse.y: (rx_check_float_support): Add function to
+       check floating point operation support for target RX100 and
+       RX200.
+        * config/tc-rx.c: Add CPU options RX100, RX200, RX600, and RX610.
+        * doc/c-rx.texi: Add -mcpu option to recognize macros for RX100,
+        RX200, RX600, and RX610
+
 2013-07-18  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>
 
        * config/tc-avr.c (md_show_usage): Add avrxmega2 to help text
index 5353cb919156609fa80d1fa689926d32c3f22e30..78ab4dff9880c0c1a417d51e29b9710466a94c45 100644 (file)
@@ -1,6 +1,5 @@
 /* rx-defs.h Renesas RX internal definitions
-   Copyright 2008, 2009
-   Free Software Foundation, Inc.
+   Copyright 2008-2013 Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -20,7 +19,7 @@
    02110-1301, USA.  */
 
 #ifndef RX_DEFS_H
-#define RX_DEFS_H  
+#define RX_DEFS_H
 
 /* Third operand to rx_op.  */
 #define RXREL_SIGNED           0
 #define RX_RELAX_IMM   2
 #define RX_RELAX_DISP  3
 
+enum rx_cpu_types
+{
+  RX600,
+  RX610,
+  RX200,
+  RX100
+};
+
 extern int rx_pid_register;
 extern int rx_gp_register;
+extern enum rx_cpu_types rx_cpu;
 
 extern int    rx_error (const char *);
 extern void   rx_lex_init (char *, char *);
@@ -57,4 +65,5 @@ extern int    rx_wrap (void);
 
 extern char * rx_lex_start;
 extern char * rx_lex_end;
-#endif
+
+#endif /* RX_DEFS_H */
index c719acc96e34a975dc769be0451ba77efa4e5cdd..09e3e84fe4ba13ee18d3e8198784ec046463838f 100644 (file)
@@ -1,6 +1,5 @@
 /* rx-parse.y  Renesas RX parser
-   Copyright 2008, 2009
-   Free Software Foundation, Inc.
+   Copyright 2008-2013 Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -104,6 +103,7 @@ static int sizemap[] = { BSIZE, WSIZE, LSIZE, WSIZE };
 
 #define id24(a,b2,b3)     B3 (0xfb+a, b2, b3)
 
+static void       rx_check_float_support (void);
 static int         rx_intop (expressionS, int, int);
 static int         rx_uintop (expressionS, int);
 static int         rx_disp3op (expressionS);
@@ -881,17 +881,16 @@ op_shift
        ;
 
 
-
 float2_op
        : '#' EXPR ',' REG
-         { id24 (2, 0x72, sub_op << 4); F ($4, 20, 4); O4 ($2); }
+       { rx_check_float_support (); id24 (2, 0x72, sub_op << 4); F ($4, 20, 4); O4 ($2); }
        | float2_op_ni
        ;
 float2_op_ni
        : REG ',' REG
-         { id24 (1, 0x83 + (sub_op << 2), 0); F ($1, 16, 4); F ($3, 20, 4); }
+         { rx_check_float_support (); id24 (1, 0x83 + (sub_op << 2), 0); F ($1, 16, 4); F ($3, 20, 4); }
        | disp '[' REG ']' opt_l ',' REG
-         { id24 (1, 0x80 + (sub_op << 2), 0); F ($3, 16, 4); F ($7, 20, 4); DSP ($1, 14, LSIZE); }
+         { rx_check_float_support (); id24 (1, 0x80 + (sub_op << 2), 0); F ($3, 16, 4); F ($7, 20, 4); DSP ($1, 14, LSIZE); }
        ;
 
 /* ====================================================================== */
@@ -1629,3 +1628,10 @@ rx_range (expressionS exp, int minv, int maxv)
   if (val < minv || val > maxv)
     as_warn (_("Value %d out of range %d..%d"), val, minv, maxv);
 }
+
+static void
+rx_check_float_support (void)
+{
+  if (rx_cpu == RX100 || rx_cpu == RX200)
+    rx_error (_("target CPU type does not support floating point instructions"));
+}
index b1d0b20773c10aa77acdb3e02b5dc4d31485d014..f15ed93c4d4cd55340d06014780eecd1421e7990 100644 (file)
@@ -1,6 +1,5 @@
 /* tc-rx.c -- Assembler for the Renesas RX
-   Copyright 2008, 2009, 2010, 2011
-   Free Software Foundation, Inc.
+   Copyright 2008-2013 Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -56,6 +55,8 @@ static int rx_num_int_regs = 0;
 int rx_pid_register;
 int rx_gp_register;
 
+enum rx_cpu_types rx_cpu = RX600;
+
 static void rx_fetchalign (int ignore ATTRIBUTE_UNUSED);
 
 enum options
@@ -72,6 +73,7 @@ enum options
   OPTION_INT_REGS,
   OPTION_USES_GCC_ABI,
   OPTION_USES_RX_ABI,
+  OPTION_CPU,
 };
 
 #define RX_SHORTOPTS ""
@@ -98,6 +100,7 @@ struct option md_longopts[] =
   {"mint-register", required_argument, NULL, OPTION_INT_REGS},
   {"mgcc-abi", no_argument, NULL, OPTION_USES_GCC_ABI},
   {"mrx-abi", no_argument, NULL, OPTION_USES_RX_ABI},
+  {"mcpu",required_argument,NULL,OPTION_CPU},
   {NULL, no_argument, NULL, 0}
 };
 size_t md_longopts_size = sizeof (md_longopts);
@@ -155,6 +158,22 @@ md_parse_option (int c ATTRIBUTE_UNUSED, char * arg ATTRIBUTE_UNUSED)
     case OPTION_USES_RX_ABI:
       elf_flags |= E_FLAG_RX_ABI;
       return 1;
+
+    case OPTION_CPU:
+      if (strcasecmp (arg, "rx100") == 0)
+        rx_cpu = RX100;
+      else if (strcasecmp (arg, "rx200") == 0)
+       rx_cpu = RX200;
+      else if (strcasecmp (arg, "rx600") == 0)
+       rx_cpu = RX600;
+      else if (strcasecmp (arg, "rx610") == 0)
+       rx_cpu = RX610;
+      else
+       {
+         as_warn (_("unrecognised RX CPU type %s"), arg);
+         break;
+       }
+      return 1;
     }
   return 0;
 }
@@ -173,6 +192,7 @@ md_show_usage (FILE * stream)
   fprintf (stream, _("  --mrelax\n"));
   fprintf (stream, _("  --mpid\n"));
   fprintf (stream, _("  --mint-register=<value>\n"));
+  fprintf (stream, _("  --mcpu=<rx100|rx200|rx600|rx610>\n"));
 }
 
 static void
index d6390c8bd15c2bb38d764668ac5f504828e0242e..2b3ab3964b4b25f99ba002e4baec9ccee554098f 100644 (file)
@@ -1,5 +1,4 @@
-@c Copyright 2008, 2009, 2011
-@c Free Software Foundation, Inc.
+@c Copyright 2008-2013 Free Software Foundation, Inc.
 @c This is part of the GAS manual.
 @c For copying conditions, see the file as.texinfo.
 @ifset GENERIC
@@ -106,6 +105,13 @@ by the assembled code.  With this version of the ABI function
 arguments that are passed on the stack are aligned to their natural
 alignments.  This option is the default.
 
+@cindex @samp{-mcpu=}
+@item -mcpu=@var{name}
+This option tells the assembler the target CPU type.  Currently the
+@code{rx200}, @code{rx600} and @code{rx610} are recognised as valid
+cpu names.  Attempting to assemble an instruction not supported by the
+indicated cpu type will result in an error message being generated.
+
 @end table
 
 @node RX-Modifiers
This page took 0.033047 seconds and 4 git commands to generate.