All of lore.kernel.org
 help / color / mirror / Atom feed
From: Max Filippov <jcmvbkbc@gmail.com>
To: qemu-devel@nongnu.org
Cc: Richard Henderson <rth@twiddle.net>, Max Filippov <jcmvbkbc@gmail.com>
Subject: [Qemu-devel] [PATCH v2 11/16] target/xtensa: drop DisasContext::litbase
Date: Mon, 18 Dec 2017 21:38:47 -0800	[thread overview]
Message-ID: <1513661932-6849-12-git-send-email-jcmvbkbc@gmail.com> (raw)
In-Reply-To: <1513661932-6849-1-git-send-email-jcmvbkbc@gmail.com>

It doesn't help much, always-set bit 0 of the LITBASE SR is easy to
compensate with decrement of the l32r immediate argument.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
 target/xtensa/translate.c | 27 +++++----------------------
 1 file changed, 5 insertions(+), 22 deletions(-)

diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c
index 0460edf61389..fb6a4c979590 100644
--- a/target/xtensa/translate.c
+++ b/target/xtensa/translate.c
@@ -59,7 +59,6 @@ typedef struct DisasContext {
     int ring;
     uint32_t lbeg;
     uint32_t lend;
-    TCGv_i32 litbase;
     int is_jmp;
     int singlestep_enabled;
 
@@ -266,21 +265,6 @@ static inline bool option_enabled(DisasContext *dc, int opt)
     return xtensa_option_enabled(dc->config, opt);
 }
 
-static void init_litbase(DisasContext *dc)
-{
-    if (dc->tb->flags & XTENSA_TBFLAG_LITBASE) {
-        dc->litbase = tcg_temp_local_new_i32();
-        tcg_gen_andi_i32(dc->litbase, cpu_SR[LITBASE], 0xfffff000);
-    }
-}
-
-static void reset_litbase(DisasContext *dc)
-{
-    if (dc->tb->flags & XTENSA_TBFLAG_LITBASE) {
-        tcg_temp_free(dc->litbase);
-    }
-}
-
 static void init_sar_tracker(DisasContext *dc)
 {
     dc->sar_5bit = false;
@@ -1094,7 +1078,6 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb)
         dc.slotbuf = xtensa_insnbuf_alloc(dc.config->isa);
     }
 
-    init_litbase(&dc);
     init_sar_tracker(&dc);
     if (dc.icount) {
         dc.next_icount = tcg_temp_local_new_i32();
@@ -1169,7 +1152,6 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb)
             dc.pc + xtensa_insn_len(env, &dc) <= next_page_start &&
             !tcg_op_buf_full());
 done:
-    reset_litbase(&dc);
     reset_sar_tracker(&dc);
     if (dc.icount) {
         tcg_temp_free(dc.next_icount);
@@ -1672,12 +1654,13 @@ static void translate_l32r(DisasContext *dc, const uint32_t arg[],
                            const uint32_t par[])
 {
     if (gen_window_check1(dc, arg[0])) {
-        TCGv_i32 tmp = (dc->tb->flags & XTENSA_TBFLAG_LITBASE) ?
-                       tcg_const_i32(dc->raw_arg[1] - 1) :
-                       tcg_const_i32(arg[1]);
+        TCGv_i32 tmp;
 
         if (dc->tb->flags & XTENSA_TBFLAG_LITBASE) {
-            tcg_gen_add_i32(tmp, tmp, dc->litbase);
+            tmp = tcg_const_i32(dc->raw_arg[1] - 1);
+            tcg_gen_add_i32(tmp, cpu_SR[LITBASE], tmp);
+        } else {
+            tmp = tcg_const_i32(arg[1]);
         }
         tcg_gen_qemu_ld32u(cpu_R[arg[0]], tmp, dc->cring);
         tcg_temp_free(tmp);
-- 
2.1.4

  parent reply	other threads:[~2017-12-19  5:40 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-19  5:38 [Qemu-devel] [PATCH v2 00/16] target/xtensa: switch to libisa Max Filippov
2017-12-19  5:38 ` [Qemu-devel] [PATCH v2 01/16] target/xtensa: pass actual frame size to the entry helper Max Filippov
2017-12-19  5:38 ` [Qemu-devel] [PATCH v2 02/16] target/xtensa: import libisa source Max Filippov
2017-12-19  5:38 ` [Qemu-devel] [PATCH v2 03/16] target/xtensa: extract core opcode translators Max Filippov
2017-12-19  5:38 ` [Qemu-devel] [PATCH v2 04/16] target/xtensa: extract FPU2000 " Max Filippov
2017-12-19  5:38 ` [Qemu-devel] [PATCH v2 05/16] target/xtensa: update import_core.sh script for libisa Max Filippov
2017-12-19  5:38 ` [Qemu-devel] [PATCH v2 06/16] target/xtensa: switch dc232b to libisa Max Filippov
2017-12-19  5:38 ` [Qemu-devel] [PATCH v2 07/16] target/xtensa: switch dc233c " Max Filippov
2017-12-19  5:38 ` [Qemu-devel] [PATCH v2 08/16] target/xtensa: switch fsf " Max Filippov
2017-12-19  5:38 ` [Qemu-devel] [PATCH v2 09/16] target/xtensa: use libisa for instruction decoding Max Filippov
2017-12-19  5:38 ` [Qemu-devel] [PATCH v2 10/16] target/xtensa: tests: fix memctl SR test Max Filippov
2017-12-19  5:38 ` Max Filippov [this message]
2017-12-19  5:38 ` [Qemu-devel] [PATCH v2 12/16] target/xtensa: add internal/noop SRs and opcodes Max Filippov
2017-12-19  5:38 ` [Qemu-devel] [PATCH v2 13/16] target/xtensa: implement salt/saltu Max Filippov
2017-12-19  5:38 ` [Qemu-devel] [PATCH v2 14/16] target/xtensa: implement GPIO32 Max Filippov
2017-12-19  5:38 ` [Qemu-devel] [PATCH v2 15/16] target/xtensa: implement const16 Max Filippov
2017-12-19  5:38 ` [Qemu-devel] [PATCH v2 16/16] target/xtensa: implement disassembler Max Filippov
2018-01-18 13:34   ` Peter Maydell
2017-12-19  6:14 ` [Qemu-devel] [PATCH v2 00/16] target/xtensa: switch to libisa no-reply

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=1513661932-6849-12-git-send-email-jcmvbkbc@gmail.com \
    --to=jcmvbkbc@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.