qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Aurelien Jarno <aurelien@aurel32.net>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [5217] ppc: Convert ctr, lr moves to TCG
Date: Sun, 14 Sep 2008 18:30:24 +0000	[thread overview]
Message-ID: <E1KewMa-0000wR-0F@cvs.savannah.gnu.org> (raw)

Revision: 5217
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5217
Author:   aurel32
Date:     2008-09-14 18:30:23 +0000 (Sun, 14 Sep 2008)

Log Message:
-----------
ppc: Convert ctr, lr moves to TCG

Introduce TCG variables cpu_{ctr,lr} and replace op_{load,store}_{lr,ctr}
with tcg_gen_mov_tl.

Signed-off-by: Andreas Faerber <andreas.faerber@web.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

Modified Paths:
--------------
    trunk/target-ppc/op.c
    trunk/target-ppc/translate.c
    trunk/target-ppc/translate_init.c

Modified: trunk/target-ppc/op.c
===================================================================
--- trunk/target-ppc/op.c	2008-09-14 17:18:29 UTC (rev 5216)
+++ trunk/target-ppc/op.c	2008-09-14 18:30:23 UTC (rev 5217)
@@ -233,30 +233,6 @@
     RETURN();
 }
 
-void OPPROTO op_load_lr (void)
-{
-    T0 = env->lr;
-    RETURN();
-}
-
-void OPPROTO op_store_lr (void)
-{
-    env->lr = T0;
-    RETURN();
-}
-
-void OPPROTO op_load_ctr (void)
-{
-    T0 = env->ctr;
-    RETURN();
-}
-
-void OPPROTO op_store_ctr (void)
-{
-    env->ctr = T0;
-    RETURN();
-}
-
 void OPPROTO op_load_tbl (void)
 {
     T0 = cpu_ppc_load_tbl(env);

Modified: trunk/target-ppc/translate.c
===================================================================
--- trunk/target-ppc/translate.c	2008-09-14 17:18:29 UTC (rev 5216)
+++ trunk/target-ppc/translate.c	2008-09-14 18:30:23 UTC (rev 5217)
@@ -61,6 +61,8 @@
 static TCGv cpu_avrh[32], cpu_avrl[32];
 static TCGv cpu_crf[8];
 static TCGv cpu_nip;
+static TCGv cpu_ctr;
+static TCGv cpu_lr;
 
 /* dyngen register indexes */
 static TCGv cpu_T[3];
@@ -168,6 +170,12 @@
     cpu_nip = tcg_global_mem_new(TCG_TYPE_TL, TCG_AREG0,
                                  offsetof(CPUState, nip), "nip");
 
+    cpu_ctr = tcg_global_mem_new(TCG_TYPE_TL, TCG_AREG0,
+                                 offsetof(CPUState, ctr), "ctr");
+
+    cpu_lr = tcg_global_mem_new(TCG_TYPE_TL, TCG_AREG0,
+                                offsetof(CPUState, lr), "lr");
+
     /* register helpers */
 #undef DEF_HELPER
 #define DEF_HELPER(ret, name, params) tcg_register_helper(name, #name);

Modified: trunk/target-ppc/translate_init.c
===================================================================
--- trunk/target-ppc/translate_init.c	2008-09-14 17:18:29 UTC (rev 5216)
+++ trunk/target-ppc/translate_init.c	2008-09-14 18:30:23 UTC (rev 5217)
@@ -110,23 +110,23 @@
 /* LR */
 static void spr_read_lr (void *opaque, int sprn)
 {
-    gen_op_load_lr();
+    tcg_gen_mov_tl(cpu_T[0], cpu_lr);
 }
 
 static void spr_write_lr (void *opaque, int sprn)
 {
-    gen_op_store_lr();
+    tcg_gen_mov_tl(cpu_lr, cpu_T[0]);
 }
 
 /* CTR */
 static void spr_read_ctr (void *opaque, int sprn)
 {
-    gen_op_load_ctr();
+    tcg_gen_mov_tl(cpu_T[0], cpu_ctr);
 }
 
 static void spr_write_ctr (void *opaque, int sprn)
 {
-    gen_op_store_ctr();
+    tcg_gen_mov_tl(cpu_ctr, cpu_T[0]);
 }
 
 /* User read access to SPR */

                 reply	other threads:[~2008-09-14 18:30 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=E1KewMa-0000wR-0F@cvs.savannah.gnu.org \
    --to=aurelien@aurel32.net \
    --cc=qemu-devel@nongnu.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 NNTP newsgroup(s).