Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: gdb-patches@sources.redhat.com
Subject: [RFA] alpha_register_reggroup_p
Date: Mon, 02 Jun 2003 03:28:00 -0000	[thread overview]
Message-ID: <20030602032821.GA7199@twiddle.net> (raw)

The main object here is to get the FPCR to be considered
part of the FP state.  It's not immediately clear what to
do with the PALcode UNIQ value, but "system" seems a good
choice.

Ok?


r~



	* alpha-tdep.c (alpha_register_reggroup_p): New.
	(alpha_gdbarch_init): Register it.
	
--- alpha-tdep.c.11	2003-06-01 20:11:56.000000000 -0700
+++ alpha-tdep.c	2003-06-01 20:15:28.000000000 -0700
@@ -20,6 +20,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
+#include "doublest.h"
 #include "frame.h"
 #include "frame-unwind.h"
 #include "frame-base.h"
@@ -34,7 +35,7 @@
 #include "gdb_string.h"
 #include "linespec.h"
 #include "regcache.h"
-#include "doublest.h"
+#include "reggroups.h"
 #include "arch-utils.h"
 #include "osabi.h"
 #include "block.h"
@@ -102,6 +103,39 @@ alpha_register_virtual_type (int regno)
   return builtin_type_int64;
 }
 
+/* Is REGNUM a member of REGGROUP?  */
+
+static int
+alpha_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
+			   struct reggroup *group)
+{
+  /* Filter out any registers eliminated, but whose regnum is 
+     reserved for backward compatibility, e.g. the vfp.  */
+  if (REGISTER_NAME (regnum) == NULL || *REGISTER_NAME (regnum) == '\0')
+    return 0;
+
+  /* Since we implement no pseudo registers, save/restore is equal to all. */
+  if (group == all_reggroup
+      || group == save_reggroup
+      || group == restore_reggroup)
+    return 1;
+
+  /* All other groups are non-overlapping.  */
+
+  /* Since this is really a PALcode memory slot...  */
+  if (regnum == ALPHA_UNIQUE_REGNUM)
+    return group == system_reggroup;
+
+  /* Force the FPCR to be considered part of the floating point state.  */
+  if (regnum == ALPHA_FPCR_REGNUM)
+    return group == float_reggroup;
+
+  if (regnum >= ALPHA_FP0_REGNUM && regnum < ALPHA_FP0_REGNUM + 31)
+    return group == float_reggroup;
+  else
+    return group == general_reggroup;
+}
+
 static int
 alpha_register_byte (int regno)
 {
@@ -1418,6 +1452,8 @@ alpha_gdbarch_init (struct gdbarch_info 
                                            alpha_register_convert_to_virtual);
   set_gdbarch_register_convert_to_raw (gdbarch, alpha_register_convert_to_raw);
 
+  set_gdbarch_register_reggroup_p (gdbarch, alpha_register_reggroup_p);
+
   /* Prologue heuristics.  */
   set_gdbarch_skip_prologue (gdbarch, alpha_skip_prologue);
 


             reply	other threads:[~2003-06-02  3:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-02  3:28 Richard Henderson [this message]
2003-06-02  3:54 ` Andrew Cagney
2003-06-02  3:58   ` Richard Henderson
2003-06-02  4:00   ` Richard Henderson
2003-06-02  4:21     ` Daniel Jacobowitz
2003-06-02 19:11       ` Michael Snyder

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=20030602032821.GA7199@twiddle.net \
    --to=rth@twiddle.net \
    --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