From: Zack Weinberg <zack@codesourcery.com>
To: binutils <binutils@sourceware.org>
Subject: Thumb32 assembler (16/69)
Date: Tue, 26 Apr 2005 09:59:00 -0000 [thread overview]
Message-ID: <87sm1d279d.fsf@codesourcery.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 79 bytes --]
Fold handling of VFP control registers into the generic register
parser.
zw
[-- Attachment #2: Type: text/plain, Size: 331 bytes --]
* 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.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 16.diff.txt --]
[-- Type: text/x-patch; name=16.diff.txt, Size: 2953 bytes --]
===================================================================
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),
reply other threads:[~2005-04-26 9:58 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87sm1d279d.fsf@codesourcery.com \
--to=zack@codesourcery.com \
--cc=binutils@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).