From nobody Fri Dec 19 20:12:15 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; dkim=fail spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 149375371498484.22472773706784; Tue, 2 May 2017 12:35:14 -0700 (PDT) Received: from localhost ([::1]:33344 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d5dZp-0003nt-MY for importer@patchew.org; Tue, 02 May 2017 15:35:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59618) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d5dOc-00027I-1q for qemu-devel@nongnu.org; Tue, 02 May 2017 15:23:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d5dOb-0001s9-2G for qemu-devel@nongnu.org; Tue, 02 May 2017 15:23:38 -0400 Received: from mail-qk0-x244.google.com ([2607:f8b0:400d:c09::244]:33032) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d5dOa-0001rm-TM for qemu-devel@nongnu.org; Tue, 02 May 2017 15:23:36 -0400 Received: by mail-qk0-x244.google.com with SMTP id o85so22942004qkh.0 for ; Tue, 02 May 2017 12:23:36 -0700 (PDT) Received: from bigtime.twiddle.net.com ([2602:47:d954:1500:5e51:4fff:fe40:9c64]) by smtp.gmail.com with ESMTPSA id d65sm10664657qkc.53.2017.05.02.12.23.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 May 2017 12:23:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2VHZoADljCGEOGUHgO434bUX/zLC/5WfcXwqGXqaqn8=; b=dr/FMJsz5NfblzxFZ7erT1Zs81LnSNUCoZHfVzelauDBZAEFI5hefitx6fQl1Q1lib 6agteDl0bVWWLMB8xfcXNqOz6U1oqrs1G3kKf+ujfxXE7jY+2aeKh22FsZOGvsBHlkuH 37ENi6+UUQ3mQYAT3Pn4KNNB9LPNTJmALI3jLHH7S1wdch0OlQssys9NsxGdyO5N+xPZ ojxl8ozYMQqiKGV+6o9nOsfbNQQdXcleXK1NMkjXiLu0X32xMafm5aQwuCUCqbYNkyjY qlhXGN5omYcRuLbuLHC+KcUH7nuNSTZqetwNdhe8bu9YIm+1PWay48Ha1pWRQxjt1pVb zp0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=2VHZoADljCGEOGUHgO434bUX/zLC/5WfcXwqGXqaqn8=; b=SJzkBweckGjKHl9F/4O58YjUAulRpcB55bxiDuksi7uiudSP6ffrOXpD4YQd7FlA3C 41yxAoYmXgdkr7CBY7xX/QImm4KbUV52A9EJNfEe380nLoc/EkkKhrkG6f3WTUbkhOGg +wRLAkAXS74zVAVfrhJb7z0X7VZVyEm1//U7DA22seY6rea+9FD2yHnVhsgZtLx6fkli iNkN+YVDzWNyLBV4L9miidkvAhkzNd/DK10sm7HKvezQ0gNKJlkrBxCp88SyjeBqkFdC 1HMu6BCtwhwNyV1Vv3gV1roNNFOMRaw2FE4Hk8vt7HFIE0vr0f4hmB3Cc/Me6En8nNda 6imA== X-Gm-Message-State: AN3rC/5cyRw1Nk4/E01BGws6cHbeGn14c5MX8S5Cv00cA9EGPLmcXdgF dt8Ws0sBtxnbNqYdbMw= X-Received: by 10.55.137.193 with SMTP id l184mr30299842qkd.122.1493753016287; Tue, 02 May 2017 12:23:36 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 2 May 2017 12:22:58 -0700 Message-Id: <20170502192300.2124-24-rth@twiddle.net> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170502192300.2124-1-rth@twiddle.net> References: <20170502192300.2124-1-rth@twiddle.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::244 Subject: [Qemu-devel] [PATCH v6 23/25] tcg/mips: implement goto_ptr X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: cota@braap.org, Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 From: Aurelien Jarno Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Aurelien Jarno Message-Id: <20170430145254.25616-2-aurelien@aurel32.net> Signed-off-by: Richard Henderson --- tcg/mips/tcg-target.h | 2 +- tcg/mips/tcg-target.inc.c | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/tcg/mips/tcg-target.h b/tcg/mips/tcg-target.h index e3240cf..d75cb63 100644 --- a/tcg/mips/tcg-target.h +++ b/tcg/mips/tcg-target.h @@ -130,7 +130,7 @@ extern bool use_mips32r2_instructions; #define TCG_TARGET_HAS_muluh_i32 1 #define TCG_TARGET_HAS_mulsh_i32 1 #define TCG_TARGET_HAS_bswap32_i32 1 -#define TCG_TARGET_HAS_goto_ptr 0 +#define TCG_TARGET_HAS_goto_ptr 1 =20 #if TCG_TARGET_REG_BITS =3D=3D 64 #define TCG_TARGET_HAS_add2_i32 0 diff --git a/tcg/mips/tcg-target.inc.c b/tcg/mips/tcg-target.inc.c index 01ac7b2..9e5b9f4 100644 --- a/tcg/mips/tcg-target.inc.c +++ b/tcg/mips/tcg-target.inc.c @@ -1747,6 +1747,11 @@ static inline void tcg_out_op(TCGContext *s, TCGOpco= de opc, tcg_out_nop(s); s->tb_jmp_reset_offset[a0] =3D tcg_current_code_size(s); break; + case INDEX_op_goto_ptr: + /* jmp to the given host address (could be epilogue) */ + tcg_out_opc_reg(s, OPC_JR, 0, a0, 0); + tcg_out_nop(s); + break; case INDEX_op_br: tcg_out_brcond(s, TCG_COND_EQ, TCG_REG_ZERO, TCG_REG_ZERO, arg_label(a0)); @@ -2160,6 +2165,7 @@ static const TCGTargetOpDef mips_op_defs[] =3D { { INDEX_op_exit_tb, { } }, { INDEX_op_goto_tb, { } }, { INDEX_op_br, { } }, + { INDEX_op_goto_ptr, { "r" } }, =20 { INDEX_op_ld8u_i32, { "r", "r" } }, { INDEX_op_ld8s_i32, { "r", "r" } }, @@ -2451,6 +2457,13 @@ static void tcg_target_qemu_prologue(TCGContext *s) /* delay slot */ tcg_out_mov(s, TCG_TYPE_PTR, TCG_AREG0, tcg_target_call_iarg_regs[0]); =20 + /* + * Return path for goto_ptr. Set return value to 0, a-la exit_tb, + * and fall through to the rest of the epilogue. + */ + s->code_gen_epilogue =3D s->code_ptr; + tcg_out_mov(s, TCG_TYPE_REG, TCG_REG_V0, TCG_REG_ZERO); + /* TB epilogue */ tb_ret_addr =3D s->code_ptr; for (i =3D 0; i < ARRAY_SIZE(tcg_target_callee_save_regs); i++) { --=20 2.9.3