tcg-ia64: Use tcg_malloc to allocate TCGLabelQemuLdst
Reviewed-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de> Signed-off-by: Richard Henderson <rth@twiddle.net>
This commit is contained in:
parent
686461c962
commit
3f626793a2
|
@ -1550,34 +1550,33 @@ static inline void tcg_out_qemu_tlb(TCGContext *s, TCGReg addr_reg,
|
||||||
bswap2);
|
bswap2);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define TCG_MAX_QEMU_LDST 640
|
|
||||||
|
|
||||||
typedef struct TCGLabelQemuLdst {
|
typedef struct TCGLabelQemuLdst {
|
||||||
bool is_ld;
|
bool is_ld;
|
||||||
TCGMemOp size;
|
TCGMemOp size;
|
||||||
tcg_insn_unit *label_ptr; /* label pointers to be updated */
|
tcg_insn_unit *label_ptr; /* label pointers to be updated */
|
||||||
|
struct TCGLabelQemuLdst *next;
|
||||||
} TCGLabelQemuLdst;
|
} TCGLabelQemuLdst;
|
||||||
|
|
||||||
typedef struct TCGBackendData {
|
typedef struct TCGBackendData {
|
||||||
int nb_ldst_labels;
|
TCGLabelQemuLdst *labels;
|
||||||
TCGLabelQemuLdst ldst_labels[TCG_MAX_QEMU_LDST];
|
|
||||||
} TCGBackendData;
|
} TCGBackendData;
|
||||||
|
|
||||||
static inline void tcg_out_tb_init(TCGContext *s)
|
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,
|
static void add_qemu_ldst_label(TCGContext *s, bool is_ld, TCGMemOp opc,
|
||||||
tcg_insn_unit *label_ptr)
|
tcg_insn_unit *label_ptr)
|
||||||
{
|
{
|
||||||
TCGBackendData *be = s->be;
|
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->is_ld = is_ld;
|
||||||
l->size = opc & MO_SIZE;
|
l->size = opc & MO_SIZE;
|
||||||
l->label_ptr = label_ptr;
|
l->label_ptr = label_ptr;
|
||||||
|
l->next = be->labels;
|
||||||
|
be->labels = l;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void tcg_out_tb_finalize(TCGContext *s)
|
static void tcg_out_tb_finalize(TCGContext *s)
|
||||||
|
@ -1593,11 +1592,9 @@ static void tcg_out_tb_finalize(TCGContext *s)
|
||||||
helper_le_ldq_mmu,
|
helper_le_ldq_mmu,
|
||||||
};
|
};
|
||||||
tcg_insn_unit *thunks[8] = { };
|
tcg_insn_unit *thunks[8] = { };
|
||||||
TCGBackendData *be = s->be;
|
TCGLabelQemuLdst *l;
|
||||||
size_t i, n = be->nb_ldst_labels;
|
|
||||||
|
|
||||||
for (i = 0; i < n; i++) {
|
for (l = s->be->labels; l != NULL; l = l->next) {
|
||||||
TCGLabelQemuLdst *l = &be->ldst_labels[i];
|
|
||||||
long x = l->is_ld * 4 + l->size;
|
long x = l->is_ld * 4 + l->size;
|
||||||
tcg_insn_unit *dest = thunks[x];
|
tcg_insn_unit *dest = thunks[x];
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue