This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Thumb32 assembler (16/69)


Fold handling of VFP control registers into the generic register
parser.

zw

	* config/tc-arm.c (arm_reg_type): Add REG_TYPE_VFC,
	(reg_expected_msgs): Add matching message.
	(reg_names): Add definitions for fpsid, fpscr, fpexc in class VFC.
	(do_vfp_reg_from_ctrl, do_vfp_ctrl_from_reg): Use reg_or_fail
	with REG_TYPE_VFC and shift 16.
	(vfp_reg, vfp_regs, vfp_psr_parse, vfp_psr_required_here): Delete.

===================================================================
Index: gas/config/tc-arm.c
--- gas/config/tc-arm.c	(revision 17)
+++ gas/config/tc-arm.c	(revision 18)
@@ -373,23 +373,6 @@
   VFP_LDSTMIA, VFP_LDSTMDB, VFP_LDSTMIAX, VFP_LDSTMDBX
 };
 
-/* VFP system registers.  */
-struct vfp_reg
-{
-  const char *name;
-  unsigned long regno;
-};
-
-static const struct vfp_reg vfp_regs[] =
-{
-  {"fpsid", 0x00000000},
-  {"FPSID", 0x00000000},
-  {"fpscr", 0x00010000},
-  {"FPSCR", 0x00010000},
-  {"fpexc", 0x00080000},
-  {"FPEXC", 0x00080000}
-};
-
 /* ARM register categories.  This includes coprocessor numbers and various
    architecture extensions' registers.  */
 enum arm_reg_type
@@ -400,6 +383,7 @@
   REG_TYPE_FN,
   REG_TYPE_VFS,
   REG_TYPE_VFD,
+  REG_TYPE_VFC,
   REG_TYPE_MVF,
   REG_TYPE_MVD,
   REG_TYPE_MVFX,
@@ -430,6 +414,7 @@
   N_("FPA register expected"),
   N_("VFP single precision register expected"),
   N_("VFP double precision register expected"),
+  N_("VFP system register expected"),
   N_("Maverick MVF register expected"),
   N_("Maverick MVD register expected"),
   N_("Maverick MVFX register expected"),
@@ -2240,63 +2225,7 @@
   return FAIL;
 }
 
-static const struct vfp_reg *
-vfp_psr_parse (char ** str)
-{
-  char *start = *str;
-  char  c;
-  char *p;
-  const struct vfp_reg *vreg;
-
-  p = start;
-
-  /* Find the end of the current token.  */
-  do
-    {
-      c = *p++;
-    }
-  while (ISALPHA (c));
-
-  /* Mark it.  */
-  *--p = 0;
-
-  for (vreg = vfp_regs + 0;
-       vreg < vfp_regs + sizeof (vfp_regs) / sizeof (struct vfp_reg);
-       vreg++)
-    {
-      if (streq (start, vreg->name))
-	{
-	  *p = c;
-	  *str = p;
-	  return vreg;
-	}
-    }
-
-  *p = c;
-  return NULL;
-}
-
 static int
-vfp_psr_required_here (char ** str)
-{
-  char *start = *str;
-  const struct vfp_reg *vreg;
-
-  vreg = vfp_psr_parse (str);
-
-  if (vreg)
-    {
-      inst.instruction |= vreg->regno;
-      return SUCCESS;
-    }
-
-  inst.error = _("VFP system register expected");
-
-  *str = start;
-  return FAIL;
-}
-
-static int
 co_proc_number (char ** str)
 {
   int processor;
@@ -7479,17 +7408,14 @@
   reg_or_fail (&str, 12, REG_TYPE_RN);
   comma_or_fail (&str);
 
-  if (vfp_psr_required_here (&str) == FAIL)
-    return;
-
+  reg_or_fail (&str, 16, REG_TYPE_VFC);
   end_of_line (str);
 }
 
 static void
 do_vfp_ctrl_from_reg (char * str)
 {
-  if (vfp_psr_required_here (&str) == FAIL)
-    return;
+  reg_or_fail (&str, 16, REG_TYPE_VFC);
   comma_or_fail (&str);
 
   reg_or_fail (&str, 12, REG_TYPE_RN);
@@ -9005,6 +8931,10 @@
 
   /* VFP DP Registers.  */
   REGSET(d,VFD), REGSET(D,VFS),
+
+  /* VFP control registers.  */
+  REGDEF(fpsid,0,VFC), REGDEF(fpscr,1,VFC), REGDEF(fpexc,8,VFC),
+  REGDEF(FPSID,0,VFC), REGDEF(FPSCR,1,VFC), REGDEF(FPEXC,8,VFC),
   
   /* Maverick DSP coprocessor registers.  */
   REGSET(mvf,MVF),  REGSET(mvd,MVD),  REGSET(mvfx,MVFX),  REGSET(mvdx,MVDX),

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]