From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59488) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wjzht-0005J7-3W for qemu-devel@nongnu.org; Mon, 12 May 2014 19:32:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wjzhn-0005yp-56 for qemu-devel@nongnu.org; Mon, 12 May 2014 19:32:29 -0400 Received: from mail-qg0-x22a.google.com ([2607:f8b0:400d:c04::22a]:49888) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wjzhn-0005yk-1C for qemu-devel@nongnu.org; Mon, 12 May 2014 19:32:23 -0400 Received: by mail-qg0-f42.google.com with SMTP id q107so8622495qgd.15 for ; Mon, 12 May 2014 16:32:22 -0700 (PDT) Sender: Richard Henderson From: Richard Henderson Date: Mon, 12 May 2014 16:31:10 -0700 Message-Id: <1399937474-6530-23-git-send-email-rth@twiddle.net> In-Reply-To: <1399937474-6530-1-git-send-email-rth@twiddle.net> References: <1399937474-6530-1-git-send-email-rth@twiddle.net> Subject: [Qemu-devel] [PULL 22/26] tcg-mips: Split out tcg_out_call List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Signed-off-by: Richard Henderson --- tcg/mips/tcg-target.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tcg/mips/tcg-target.c b/tcg/mips/tcg-target.c index eaf1745..65acc86 100644 --- a/tcg/mips/tcg-target.c +++ b/tcg/mips/tcg-target.c @@ -153,11 +153,6 @@ static int target_parse_constraint(TCGArgConstraint *ct, const char **pct_str) ct->ct |= TCG_CT_REG; tcg_regset_set(ct->u.regs, 0xffffffff); break; - case 'C': - ct->ct |= TCG_CT_REG; - tcg_regset_clear(ct->u.regs); - tcg_regset_set_reg(ct->u.regs, TCG_REG_T9); - break; case 'L': /* qemu_ld output arg constraint */ ct->ct |= TCG_CT_REG; tcg_regset_set(ct->u.regs, 0xffffffff); @@ -1252,6 +1247,13 @@ static void tcg_out_qemu_st(TCGContext *s, const TCGArg *args, #endif } +static void tcg_out_call(TCGContext *s, tcg_insn_unit *target) +{ + tcg_out_movi(s, TCG_TYPE_PTR, TCG_REG_T9, (intptr_t)target); + tcg_out_opc_reg(s, OPC_JALR, TCG_REG_RA, TCG_REG_T9, 0); + tcg_out_nop(s); +} + static inline void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, const int *const_args) { @@ -1277,8 +1279,8 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode opc, s->tb_next_offset[args[0]] = tcg_current_code_size(s); break; case INDEX_op_call: - tcg_out_opc_reg(s, OPC_JALR, TCG_REG_RA, args[0], 0); - tcg_out_nop(s); + assert(const_args[0]); + tcg_out_call(s, (tcg_insn_unit *)(intptr_t)args[0]); break; case INDEX_op_br: tcg_out_brcond(s, TCG_COND_EQ, TCG_REG_ZERO, TCG_REG_ZERO, args[0]); @@ -1546,7 +1548,7 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode opc, static const TCGTargetOpDef mips_op_defs[] = { { INDEX_op_exit_tb, { } }, { INDEX_op_goto_tb, { } }, - { INDEX_op_call, { "C" } }, + { INDEX_op_call, { "i" } }, { INDEX_op_br, { } }, { INDEX_op_mov_i32, { "r", "r" } }, -- 1.9.0