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] [5167] ppc: Convert op_add, op_addi to TCG
Date: Fri, 05 Sep 2008 14:19:43 +0000	[thread overview]
Message-ID: <E1KbcA3-0007xC-IN@cvs.savannah.gnu.org> (raw)

Revision: 5167
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5167
Author:   aurel32
Date:     2008-09-05 14:19:43 +0000 (Fri, 05 Sep 2008)

Log Message:
-----------
ppc: Convert op_add, op_addi to TCG

Replace op_add with tcg_gen_add_tl and op_addi with tcg_gen_addi_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

Modified: trunk/target-ppc/op.c
===================================================================
--- trunk/target-ppc/op.c	2008-09-05 14:19:35 UTC (rev 5166)
+++ trunk/target-ppc/op.c	2008-09-05 14:19:43 UTC (rev 5167)
@@ -602,12 +602,6 @@
 
 /***                           Integer arithmetic                          ***/
 /* add */
-void OPPROTO op_add (void)
-{
-    T0 += T1;
-    RETURN();
-}
-
 void OPPROTO op_check_addo (void)
 {
     xer_ov = (((uint32_t)T2 ^ (uint32_t)T1 ^ UINT32_MAX) &
@@ -664,13 +658,6 @@
 }
 #endif
 
-/* add immediate */
-void OPPROTO op_addi (void)
-{
-    T0 += (int32_t)PARAM1;
-    RETURN();
-}
-
 /* add to minus one extended */
 void OPPROTO op_add_me (void)
 {

Modified: trunk/target-ppc/translate.c
===================================================================
--- trunk/target-ppc/translate.c	2008-09-05 14:19:35 UTC (rev 5166)
+++ trunk/target-ppc/translate.c	2008-09-05 14:19:43 UTC (rev 5167)
@@ -827,10 +827,14 @@
 #endif
 
 /* add    add.    addo    addo.    */
+static always_inline void gen_op_add (void)
+{
+    tcg_gen_add_tl(cpu_T[0], cpu_T[0], cpu_T[1]);
+}
 static always_inline void gen_op_addo (void)
 {
     tcg_gen_mov_tl(cpu_T[2], cpu_T[0]);
-    gen_op_add();
+    tcg_gen_add_tl(cpu_T[0], cpu_T[0], cpu_T[1]);
     gen_op_check_addo();
 }
 #if defined(TARGET_PPC64)
@@ -838,7 +842,7 @@
 static always_inline void gen_op_addo_64 (void)
 {
     tcg_gen_mov_tl(cpu_T[2], cpu_T[0]);
-    gen_op_add();
+    tcg_gen_add_tl(cpu_T[0], cpu_T[0], cpu_T[1]);
     gen_op_check_addo_64();
 }
 #endif
@@ -847,13 +851,13 @@
 static always_inline void gen_op_addc (void)
 {
     tcg_gen_mov_tl(cpu_T[2], cpu_T[0]);
-    gen_op_add();
+    tcg_gen_add_tl(cpu_T[0], cpu_T[0], cpu_T[1]);
     gen_op_check_addc();
 }
 static always_inline void gen_op_addco (void)
 {
     tcg_gen_mov_tl(cpu_T[2], cpu_T[0]);
-    gen_op_add();
+    tcg_gen_add_tl(cpu_T[0], cpu_T[0], cpu_T[1]);
     gen_op_check_addc();
     gen_op_check_addo();
 }
@@ -861,13 +865,13 @@
 static always_inline void gen_op_addc_64 (void)
 {
     tcg_gen_mov_tl(cpu_T[2], cpu_T[0]);
-    gen_op_add();
+    tcg_gen_add_tl(cpu_T[0], cpu_T[0], cpu_T[1]);
     gen_op_check_addc_64();
 }
 static always_inline void gen_op_addco_64 (void)
 {
     tcg_gen_mov_tl(cpu_T[2], cpu_T[0]);
-    gen_op_add();
+    tcg_gen_add_tl(cpu_T[0], cpu_T[0], cpu_T[1]);
     gen_op_check_addc_64();
     gen_op_check_addo_64();
 }
@@ -1022,7 +1026,7 @@
     } else {
         tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]);
         if (likely(simm != 0))
-            gen_op_addi(simm);
+            tcg_gen_addi_tl(cpu_T[0], cpu_T[0], simm);
     }
     tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]);
 }
@@ -1034,7 +1038,7 @@
     tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]);
     if (likely(simm != 0)) {
         tcg_gen_mov_tl(cpu_T[2], cpu_T[0]);
-        gen_op_addi(simm);
+        tcg_gen_addi_tl(cpu_T[0], cpu_T[0], simm);
 #if defined(TARGET_PPC64)
         if (ctx->sf_mode)
             gen_op_check_addc_64();
@@ -1054,7 +1058,7 @@
     tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]);
     if (likely(simm != 0)) {
         tcg_gen_mov_tl(cpu_T[2], cpu_T[0]);
-        gen_op_addi(simm);
+        tcg_gen_addi_tl(cpu_T[0], cpu_T[0], simm);
 #if defined(TARGET_PPC64)
         if (ctx->sf_mode)
             gen_op_check_addc_64();
@@ -1078,7 +1082,7 @@
     } else {
         tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]);
         if (likely(simm != 0))
-            gen_op_addi(simm << 16);
+            tcg_gen_addi_tl(cpu_T[0], cpu_T[0], simm << 16);
     }
     tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]);
 }
@@ -2118,7 +2122,7 @@
     } else {
         tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]);
         if (likely(simm != 0))
-            gen_op_addi(simm);
+            tcg_gen_addi_tl(cpu_T[0], cpu_T[0], simm);
     }
 #ifdef DEBUG_MEMORY_ACCESSES
     gen_op_print_mem_EA();
@@ -2132,7 +2136,7 @@
     } else {
         tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]);
         tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rB(ctx->opcode)]);
-        gen_op_add();
+        tcg_gen_add_tl(cpu_T[0], cpu_T[0], cpu_T[1]);
     }
 #ifdef DEBUG_MEMORY_ACCESSES
     gen_op_print_mem_EA();
@@ -2331,7 +2335,7 @@
     gen_addr_imm_index(ctx, 0x0F);
     op_ldst(ld);
     tcg_gen_mov_tl(cpu_gpr[rd], cpu_T[1]);
-    gen_op_addi(8);
+    tcg_gen_addi_tl(cpu_T[0], cpu_T[0], 8);
     op_ldst(ld);
     tcg_gen_mov_tl(cpu_gpr[rd + 1], cpu_T[1]);
 #endif
@@ -2427,7 +2431,7 @@
         gen_addr_imm_index(ctx, 0x03);
         tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rs]);
         op_ldst(std);
-        gen_op_addi(8);
+        tcg_gen_addi_tl(cpu_T[0], cpu_T[0], 8);
         tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rs + 1]);
         op_ldst(std);
 #endif
@@ -5346,7 +5350,7 @@
     } else {
         tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]);
         if (likely(simm != 0))
-            gen_op_addi(simm << sh);
+            tcg_gen_addi_tl(cpu_T[0], cpu_T[0], simm << sh);
     }
 }
 

                 reply	other threads:[~2008-09-05 14:21 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=E1KbcA3-0007xC-IN@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).