qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org
Subject: [Qemu-devel] [PULL 2/6] tcg-ia64: Use tcg_malloc to allocate TCGLabelQemuLdst
Date: Fri, 13 Mar 2015 13:23:09 -0700	[thread overview]
Message-ID: <1426278193-15317-3-git-send-email-rth@twiddle.net> (raw)
In-Reply-To: <1426278193-15317-1-git-send-email-rth@twiddle.net>

Reviewed-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 tcg/ia64/tcg-target.c | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/tcg/ia64/tcg-target.c b/tcg/ia64/tcg-target.c
index 6bc9924..1c01fd9 100644
--- a/tcg/ia64/tcg-target.c
+++ b/tcg/ia64/tcg-target.c
@@ -1550,34 +1550,33 @@ static inline void tcg_out_qemu_tlb(TCGContext *s, TCGReg addr_reg,
                    bswap2);
 }
 
-#define TCG_MAX_QEMU_LDST       640
-
 typedef struct TCGLabelQemuLdst {
     bool is_ld;
     TCGMemOp size;
     tcg_insn_unit *label_ptr;     /* label pointers to be updated */
+    struct TCGLabelQemuLdst *next;
 } TCGLabelQemuLdst;
 
 typedef struct TCGBackendData {
-    int nb_ldst_labels;
-    TCGLabelQemuLdst ldst_labels[TCG_MAX_QEMU_LDST];
+    TCGLabelQemuLdst *labels;
 } TCGBackendData;
 
 static inline void tcg_out_tb_init(TCGContext *s)
 {
-    s->be->nb_ldst_labels = 0;
+    s->be->labels = NULL;
 }
 
 static void add_qemu_ldst_label(TCGContext *s, bool is_ld, TCGMemOp opc,
                                 tcg_insn_unit *label_ptr)
 {
     TCGBackendData *be = s->be;
-    TCGLabelQemuLdst *l = &be->ldst_labels[be->nb_ldst_labels++];
+    TCGLabelQemuLdst *l = tcg_malloc(sizeof(*l));
 
-    assert(be->nb_ldst_labels <= TCG_MAX_QEMU_LDST);
     l->is_ld = is_ld;
     l->size = opc & MO_SIZE;
     l->label_ptr = label_ptr;
+    l->next = be->labels;
+    be->labels = l;
 }
 
 static void tcg_out_tb_finalize(TCGContext *s)
@@ -1593,11 +1592,9 @@ static void tcg_out_tb_finalize(TCGContext *s)
         helper_le_ldq_mmu,
     };
     tcg_insn_unit *thunks[8] = { };
-    TCGBackendData *be = s->be;
-    size_t i, n = be->nb_ldst_labels;
+    TCGLabelQemuLdst *l;
 
-    for (i = 0; i < n; i++) {
-        TCGLabelQemuLdst *l = &be->ldst_labels[i];
+    for (l = s->be->labels; l != NULL; l = l->next) {
         long x = l->is_ld * 4 + l->size;
         tcg_insn_unit *dest = thunks[x];
 
-- 
2.1.0

  parent reply	other threads:[~2015-03-13 20:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-13 20:23 [Qemu-devel] [PULL 0/6] Use tcg_malloc more; tcg_cond_always fix Richard Henderson
2015-03-13 20:23 ` [Qemu-devel] [PULL 1/6] tcg: Use tcg_malloc to allocate TCGLabelQemuLdst Richard Henderson
2015-03-13 20:23 ` Richard Henderson [this message]
2015-03-13 20:23 ` [Qemu-devel] [PULL 3/6] tcg: Change translator-side labels to a pointer Richard Henderson
2015-03-13 20:23 ` [Qemu-devel] [PULL 4/6] tcg: Change generator-side " Richard Henderson
2015-03-13 20:23 ` [Qemu-devel] [PULL 5/6] tcg: Use tcg_malloc to allocate TCGLabel Richard Henderson
2015-03-13 20:23 ` [Qemu-devel] [PULL 6/6] tcg: Complete handling of ALWAYS and NEVER Richard Henderson
2015-03-13 20:50 ` [Qemu-devel] [PULL 0/6] Use tcg_malloc more; tcg_cond_always fix Patchew Tool
2015-03-16  9:53 ` Peter Maydell
2015-03-16 10:57 ` Peter Maydell

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=1426278193-15317-3-git-send-email-rth@twiddle.net \
    --to=rth@twiddle.net \
    --cc=peter.maydell@linaro.org \
    --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).