From patchwork Sun Dec 11 13:36:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jin Guojie X-Patchwork-Id: 704835 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tc6kv0858z9t0X for ; Mon, 12 Dec 2016 00:48:55 +1100 (AEDT) Received: from localhost ([::1]:55763 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cG4Un-0001MT-0G for incoming@patchwork.ozlabs.org; Sun, 11 Dec 2016 08:48:53 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42887) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cG4Kb-0001ty-2y for qemu-devel@nongnu.org; Sun, 11 Dec 2016 08:38:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cG4Ka-0001Kx-4I for qemu-devel@nongnu.org; Sun, 11 Dec 2016 08:38:21 -0500 Received: from [114.242.206.163] (port=49181 helo=loongson.cn) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cG4KZ-0001IS-4m for qemu-devel@nongnu.org; Sun, 11 Dec 2016 08:38:20 -0500 Received: from controller.loongson.cn (unknown [192.168.1.3]) by mail.loongson.cn (Coremail) with SMTP id AQAAf_BxD28VWE1Yv3EAAA--.1284S8; Sun, 11 Dec 2016 21:44:51 +0800 (CST) From: Jin Guojie To: qemu-devel@nongnu.org Date: Sun, 11 Dec 2016 21:36:21 +0800 Message-Id: <1481463385-15898-7-git-send-email-jinguojie@loongson.cn> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1481463385-15898-1-git-send-email-jinguojie@loongson.cn> References: <1481463385-15898-1-git-send-email-jin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fC2KfnxnUUI43ZEXa7xR_ UUUUUUUUU== X-CM-SenderInfo: 5mlqw3prmlvqxorr0wxvrqhubq/ X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x [fuzzy] X-Received-From: 114.242.206.163 Subject: [Qemu-devel] [PATCH v6 06/10] tcg-mips: Adjust load/store functions for mips64 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: YunQiang Su , James Hogan , Jin Guojie , Aurelien Jarno , Richard Henderson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" tcg_out_ldst: using a generic ALIAS_PADD to avoid ifdefs tcg_out_ld: generates LD or LW tcg_out_st: generates SD or SW Tested-by: Aurelien Jarno Tested-by: James Hogan Tested-by: YunQiang Su Signed-off-by: Richard Henderson Signed-off-by: Jin Guojie --- tcg/mips/tcg-target.inc.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tcg/mips/tcg-target.inc.c b/tcg/mips/tcg-target.inc.c index 18368f0..5cc8df3 100644 --- a/tcg/mips/tcg-target.inc.c +++ b/tcg/mips/tcg-target.inc.c @@ -697,7 +697,7 @@ static void tcg_out_ldst(TCGContext *s, MIPSInsn opc, TCGReg data, if (ofs != lo) { tcg_out_movi(s, TCG_TYPE_PTR, TCG_TMP0, ofs - lo); if (addr != TCG_REG_ZERO) { - tcg_out_opc_reg(s, OPC_ADDU, TCG_TMP0, TCG_TMP0, addr); + tcg_out_opc_reg(s, ALIAS_PADD, TCG_TMP0, TCG_TMP0, addr); } addr = TCG_TMP0; } @@ -707,13 +707,21 @@ static void tcg_out_ldst(TCGContext *s, MIPSInsn opc, TCGReg data, static inline void tcg_out_ld(TCGContext *s, TCGType type, TCGReg arg, TCGReg arg1, intptr_t arg2) { - tcg_out_ldst(s, OPC_LW, arg, arg1, arg2); + MIPSInsn opc = OPC_LD; + if (TCG_TARGET_REG_BITS == 32 || type == TCG_TYPE_I32) { + opc = OPC_LW; + } + tcg_out_ldst(s, opc, arg, arg1, arg2); } static inline void tcg_out_st(TCGContext *s, TCGType type, TCGReg arg, TCGReg arg1, intptr_t arg2) { - tcg_out_ldst(s, OPC_SW, arg, arg1, arg2); + MIPSInsn opc = OPC_SD; + if (TCG_TARGET_REG_BITS == 32 || type == TCG_TYPE_I32) { + opc = OPC_SW; + } + tcg_out_ldst(s, opc, arg, arg1, arg2); } static inline bool tcg_out_sti(TCGContext *s, TCGType type, TCGArg val,