public inbox for frysk@sourceware.org
 help / color / mirror / Atom feed
From: Jose Flavio Aguilar Paulino <jflavio@br.ibm.com>
To: Frysk <frysk@sourceware.org>
Subject: Correcting Power64 registers (groups, construcor)
Date: Wed, 07 Nov 2007 16:09:00 -0000	[thread overview]
Message-ID: <1194192473.25281.4.camel@kandinsky.prado> (raw)

[-- Attachment #1: Type: text/plain, Size: 137 bytes --]


-- 
Jose Flavio Aguilar Paulino
(jflavio@br.ibm.com)
System / Software Engineer

Toolchain Team
LTC, Linux Technology Center
IBM Brazil

[-- Attachment #2: frysk_isa2_power64 --]
[-- Type: text/x-patch, Size: 4298 bytes --]

Index: frysk/frysk-core/frysk/isa/PPC64Registers.java
===================================================================
--- frysk.orig/frysk-core/frysk/isa/PPC64Registers.java
+++ frysk/frysk-core/frysk/isa/PPC64Registers.java
@@ -173,9 +173,88 @@ public class PPC64Registers extends Regi
     public static final Register FPR31
 	= new Register("fpr31", StandardTypes.FLOAT64B_T);
 
+    /* Special Registers */
+    public static final Register LR
+	= new Register("lr", StandardTypes.VOIDPTR64B_T);
+    public static final Register CTR
+	= new Register("ctr", StandardTypes.INT64B_T);
+    public static final Register ARG
+	= new Register("arg", StandardTypes.INT64B_T);
+    public static final Register CR
+	= new Register("cr", StandardTypes.INT64B_T);
+    public static final Register XER
+	= new Register("xer", StandardTypes.INT64B_T);
+
+    /* Alti-vec special register */
+    public static final Register VRSAVE
+	= new Register("vrsave", StandardTypes.INT64B_T);
+    public static final Register VSCR
+	= new Register("vscr", StandardTypes.INT64B_T);
+
+    /* SPUs special registers (for CELL processors) */
+    public static final Register SPEACC
+	= new Register("speacc", StandardTypes.INT64B_T);
+    public static final Register SPEFSCR
+	= new Register("spefscr", StandardTypes.INT64B_T);
+
+    /* Frame-Pointer */
+    public static final Register FRP
+	= new Register("frp", StandardTypes.VOIDPTR64B_T);
+
+    /* Next-Instruction Pointer (Program Pointer) */
     public static final Register NIP
 	= new Register("nip", StandardTypes.VOIDPTR64B_T);
 
+    /* 
+     * Defining Register Groups
+     */
+    public static final RegisterGroup GENERAL
+        = new RegisterGroup("general",
+                  new Register[] {
+                          GPR0 , GPR1 , GPR2 , GPR3 , GPR4 , GPR5 , GPR6 , GPR7 , GPR8 , GPR9 ,
+                          GPR10, GPR11, GPR12, GPR13, GPR14, GPR15, GPR16, GPR17, GPR18, GPR19,
+                          GPR20, GPR21, GPR22, GPR23, GPR24, GPR25, GPR26, GPR27, GPR28, GPR29,
+                          GPR30, GPR31 });
+
+    public static final RegisterGroup SPECIAL
+        = new RegisterGroup("special",
+                  new Register[] { LR, CTR, ARG, CR, XER, 
+                                   VRSAVE, VSCR, SPEACC, SPEFSCR, 
+                                   FRP, NIP });
+
+    public static final RegisterGroup FLOATING_POINTER
+        = new RegisterGroup("floatingpointer",
+                  new Register[] {
+                          FPR0 , FPR1 , FPR2 , FPR3 , FPR4 , FPR5 , FPR6 , FPR7 , FPR8 , FPR9 ,
+                          FPR10, FPR11, FPR12, FPR13, FPR14, FPR15, FPR16, FPR17, FPR18, FPR19,
+                          FPR20, FPR21, FPR22, FPR23, FPR24, FPR25, FPR26, FPR27, FPR28, FPR29,
+                          FPR30, FPR31 });
+
+    /*
+     * Creating the special ALL group
+     */
+    public static final RegisterGroup ALL;
+    static {
+        Register[] allRegs = new Register[
+                GENERAL.getRegisters().length +
+                SPECIAL.getRegisters().length +
+                FLOATING_POINTER.getRegisters().length];
+
+        System.arraycopy(GENERAL.getRegisters(), 0,
+                         allRegs, 0,
+                         GENERAL.getRegisters().length);
+
+        System.arraycopy(SPECIAL.getRegisters(), 0,
+                         allRegs, GENERAL.getRegisters().length,
+                         SPECIAL.getRegisters().length);
+
+        System.arraycopy(FLOATING_POINTER.getRegisters(), 0,
+                         allRegs, GENERAL.getRegisters().length + SPECIAL.getRegisters().length,
+                         FLOATING_POINTER.getRegisters().length);
+
+        ALL = new RegisterGroup("all", allRegs);
+    }
+
     public Register getProgramCounter() {
 	return NIP;
     }
@@ -185,17 +264,17 @@ public class PPC64Registers extends Regi
     }
 
     public RegisterGroup getDefaultRegisterGroup() {
-	// FIXME!
-	return null;
+	return GENERAL;
     }
 
     public RegisterGroup getAllRegistersGroup() {
-	// FIXME!
-	return null;
+	return ALL;
     }
 
+    /* 
+     * Default Constructor
+     */
     PPC64Registers() {
-	// FIXME!
-	super(null);
+	super(new RegisterGroup[] { GENERAL, SPECIAL, FLOATING_POINTER, ALL });
     }
 }

                 reply	other threads:[~2007-11-07 16:09 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=1194192473.25281.4.camel@kandinsky.prado \
    --to=jflavio@br.ibm.com \
    --cc=frysk@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).