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] [6033] target-ppc: remove FPRF optimization
Date: Sun, 14 Dec 2008 18:59:09 +0000	[thread overview]
Message-ID: <E1LBwBJ-0000eK-8I@cvs.savannah.gnu.org> (raw)

Revision: 6033
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6033
Author:   aurel32
Date:     2008-12-14 18:59:08 +0000 (Sun, 14 Dec 2008)

Log Message:
-----------
target-ppc: remove FPRF optimization

FPRF optimization is totally broken, remove it.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

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

Modified: trunk/target-ppc/translate.c
===================================================================
--- trunk/target-ppc/translate.c	2008-12-14 18:40:58 UTC (rev 6032)
+++ trunk/target-ppc/translate.c	2008-12-14 18:59:08 UTC (rev 6033)
@@ -41,7 +41,6 @@
 //#define DO_SINGLE_STEP
 //#define PPC_DEBUG_DISAS
 //#define DO_PPC_STATISTICS
-//#define OPTIMIZE_FPRF_UPDATE
 
 /*****************************************************************************/
 /* Code translation helpers                                                  */
@@ -162,11 +161,6 @@
     done_init = 1;
 }
 
-#if defined(OPTIMIZE_FPRF_UPDATE)
-static uint16_t *gen_fprf_buf[OPC_BUF_SIZE];
-static uint16_t **gen_fprf_ptr;
-#endif
-
 /* internal defines */
 typedef struct DisasContext {
     struct TranslationBlock *tb;
@@ -216,9 +210,6 @@
 
     if (set_fprf != 0) {
         /* This case might be optimized later */
-#if defined(OPTIMIZE_FPRF_UPDATE)
-        *gen_fprf_ptr++ = gen_opc_ptr;
-#endif
         tcg_gen_movi_i32(t0, 1);
         gen_helper_compute_fprf(t0, arg, t0);
         if (unlikely(set_rc)) {
@@ -235,17 +226,6 @@
     tcg_temp_free_i32(t0);
 }
 
-static always_inline void gen_optimize_fprf (void)
-{
-#if defined(OPTIMIZE_FPRF_UPDATE)
-    uint16_t **ptr;
-
-    for (ptr = gen_fprf_buf; ptr != (gen_fprf_ptr - 1); ptr++)
-        *ptr = INDEX_op_nop1;
-    gen_fprf_ptr = gen_fprf_buf;
-#endif
-}
-
 static always_inline void gen_set_access_type (DisasContext *ctx, int access_type)
 {
     if (ctx->access_type != access_type) {
@@ -2326,7 +2306,6 @@
         gen_exception(ctx, POWERPC_EXCP_FPU);
         return;
     }
-    gen_optimize_fprf();
     bfa = 4 * (7 - crfS(ctx->opcode));
     tcg_gen_shri_i32(cpu_crf[crfD(ctx->opcode)], cpu_fpscr, bfa);
     tcg_gen_andi_i32(cpu_crf[crfD(ctx->opcode)], cpu_crf[crfD(ctx->opcode)], 0xf);
@@ -2340,7 +2319,6 @@
         gen_exception(ctx, POWERPC_EXCP_FPU);
         return;
     }
-    gen_optimize_fprf();
     gen_reset_fpstatus();
     tcg_gen_extu_i32_i64(cpu_fpr[rD(ctx->opcode)], cpu_fpscr);
     gen_compute_fprf(cpu_fpr[rD(ctx->opcode)], 0, Rc(ctx->opcode) != 0);
@@ -2356,7 +2334,6 @@
         return;
     }
     crb = 31 - crbD(ctx->opcode);
-    gen_optimize_fprf();
     gen_reset_fpstatus();
     if (likely(crb != FPSCR_FEX && crb != FPSCR_VX)) {
         TCGv_i32 t0 = tcg_const_i32(crb);
@@ -2378,7 +2355,6 @@
         return;
     }
     crb = 31 - crbD(ctx->opcode);
-    gen_optimize_fprf();
     gen_reset_fpstatus();
     /* XXX: we pretend we can only do IEEE floating-point computations */
     if (likely(crb != FPSCR_FEX && crb != FPSCR_VX && crb != FPSCR_NI)) {
@@ -2402,7 +2378,6 @@
         gen_exception(ctx, POWERPC_EXCP_FPU);
         return;
     }
-    gen_optimize_fprf();
     gen_reset_fpstatus();
     t0 = tcg_const_i32(FM(ctx->opcode));
     gen_helper_store_fpscr(cpu_fpr[rB(ctx->opcode)], t0);
@@ -2427,7 +2402,6 @@
     }
     bf = crbD(ctx->opcode) >> 2;
     sh = 7 - bf;
-    gen_optimize_fprf();
     gen_reset_fpstatus();
     t0 = tcg_const_i64(FPIMM(ctx->opcode) << (4 * sh));
     t1 = tcg_const_i32(1 << sh);
@@ -7727,9 +7701,6 @@
 
     pc_start = tb->pc;
     gen_opc_end = gen_opc_buf + OPC_MAX_SIZE;
-#if defined(OPTIMIZE_FPRF_UPDATE)
-    gen_fprf_ptr = gen_fprf_buf;
-#endif
     ctx.nip = pc_start;
     ctx.tb = tb;
     ctx.exception = POWERPC_EXCP_NONE;

                 reply	other threads:[~2008-12-14 18:59 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=E1LBwBJ-0000eK-8I@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).