From: Kevin Buettner <kevinb@redhat.com>
To: Andrew Cagney <ac131313@redhat.com>, Kevin Buettner <kevinb@redhat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA] MIPS: Introduce struct mips_regnums and accessors
Date: Thu, 22 May 2003 20:16:00 -0000 [thread overview]
Message-ID: <1030522201633.ZM31133@localhost.localdomain> (raw)
In-Reply-To: Andrew Cagney <ac131313@redhat.com> "Re: [RFA] MIPS: Introduce struct mips_regnums and accessors" (May 22, 3:40pm)
On May 22, 3:40pm, Andrew Cagney wrote:
> + /* Raw register number initializations. They are initialized in the
> + same order that they appear in the struct to make it easier to
> + verify that they're all initialized. */
> + tdep->raw_regnums.zero_regnum = 0;
> + tdep->raw_regnums.v0_regnum = 2;
> + tdep->raw_regnums.a0_regnum = 4;
> + tdep->raw_regnums.t9_regnum = 25;
> + tdep->raw_regnums.sp_regnum = 29;
> + tdep->raw_regnums.ra_regnum = 31;
>
> and, at least for v0_regnum, it doesn't change. V0 is an offset in the
> selected block of registers. It could be either:
>
> enum { V0_OFFSET = 2 };
>
> cookednum->gp0 + V0_OFFSET
> or
> rawnum->gp0 + V0_OFFSET
>
> however, either way, it doesn't change. The only thing that changes is
> things like where the general purpose, for floating point, registers start.
I have the following objections to the use of offsets:
1) They don't work for floating point registers. (That's assuming
that I can convince you that it's desirable to have 16 cooked
registers for o32...) The reason that it won't work is that,
e.g, an FPA0_OFFSET will need to have different values for the
raw and cooked cases.
2) The conversion from *_REGNUM is much less transparent.
3) The use of offsets is more error prone. There's nothing to
prevent you from adding an offset to the wrong boundary start.
4) The notation is more cumbersome.
Furthermore, I really don't understand the problem that you had with
my proposed layout. Could you please explain the underlying reasons
for proposing the offset idea? E.g, are you concerned about the
initialization and the maintenance thereof? Or do you just want to
present a minimal view of the raw register numbers to clients outside
of mips-tdep.c? Or something else altogether?
Kevin
next prev parent reply other threads:[~2003-05-22 20:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-15 23:51 Kevin Buettner
2003-05-21 19:39 ` Andrew Cagney
2003-05-21 20:40 ` Kevin Buettner
2003-05-22 19:41 ` Andrew Cagney
2003-05-22 20:16 ` Kevin Buettner [this message]
2003-06-15 18:37 ` Andrew Cagney
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=1030522201633.ZM31133@localhost.localdomain \
--to=kevinb@redhat.com \
--cc=ac131313@redhat.com \
--cc=gdb-patches@sources.redhat.com \
/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