From patchwork Fri Oct 2 12:24:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Hogan X-Patchwork-Id: 525491 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id A36ED140311 for ; Fri, 2 Oct 2015 23:17:17 +1000 (AEST) Received: from localhost ([::1]:59513 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zi0D5-0004iu-SY for incoming@patchwork.ozlabs.org; Fri, 02 Oct 2015 09:17:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54561) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZhzO5-0003QW-BG for qemu-devel@nongnu.org; Fri, 02 Oct 2015 08:24:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZhzO1-00079c-IW for qemu-devel@nongnu.org; Fri, 02 Oct 2015 08:24:33 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:2660) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZhzO1-00079V-D3 for qemu-devel@nongnu.org; Fri, 02 Oct 2015 08:24:29 -0400 Received: from KLMAIL01.kl.imgtec.org (unknown [192.168.5.35]) by Websense Email Security Gateway with ESMTPS id 12BD76F540B60; Fri, 2 Oct 2015 13:24:26 +0100 (IST) Received: from LEMAIL01.le.imgtec.org (192.168.152.62) by KLMAIL01.kl.imgtec.org (192.168.5.35) with Microsoft SMTP Server (TLS) id 14.3.195.1; Fri, 2 Oct 2015 13:24:28 +0100 Received: from jhogan-linux.le.imgtec.org (192.168.154.110) by LEMAIL01.le.imgtec.org (192.168.152.62) with Microsoft SMTP Server (TLS) id 14.3.210.2; Fri, 2 Oct 2015 13:24:27 +0100 From: James Hogan To: Date: Fri, 2 Oct 2015 13:24:15 +0100 Message-ID: <1443788657-14537-5-git-send-email-james.hogan@imgtec.com> X-Mailer: git-send-email 2.4.9 In-Reply-To: <1443788657-14537-1-git-send-email-james.hogan@imgtec.com> References: <1443788657-14537-1-git-send-email-james.hogan@imgtec.com> MIME-Version: 1.0 X-Originating-IP: [192.168.154.110] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 195.59.15.196 Cc: James Hogan , Leon Alrae , Aurelien Jarno , Richard Henderson Subject: [Qemu-devel] [PATCH v3 4/6] tcg/mips: Support r6 JR encoding X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org MIPSr6 encodes JR as JALR with zero as the link register, and the pre-r6 JR encoding is removed. Update TCG to use the new encoding when built for r6. We still use the old encoding for pre-r6, so as not to confuse return prediction stack hardware which may detect only particular encodings of the return instruction. Signed-off-by: James Hogan Reviewed-by: Richard Henderson Cc: Aurelien Jarno Reviewed-by: Aurelien Jarno --- Changes in v2: - Turn #define into enum (Richard). --- tcg/mips/tcg-target.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tcg/mips/tcg-target.c b/tcg/mips/tcg-target.c index 4305af967326..c08418c413d7 100644 --- a/tcg/mips/tcg-target.c +++ b/tcg/mips/tcg-target.c @@ -288,7 +288,7 @@ typedef enum { OPC_SRLV = OPC_SPECIAL | 0x06, OPC_ROTRV = OPC_SPECIAL | (0x01 << 6) | 0x06, OPC_SRAV = OPC_SPECIAL | 0x07, - OPC_JR = OPC_SPECIAL | 0x08, + OPC_JR_R5 = OPC_SPECIAL | 0x08, OPC_JALR = OPC_SPECIAL | 0x09, OPC_MOVZ = OPC_SPECIAL | 0x0A, OPC_MOVN = OPC_SPECIAL | 0x0B, @@ -320,6 +320,9 @@ typedef enum { OPC_WSBH = OPC_SPECIAL3 | 0x0a0, OPC_SEB = OPC_SPECIAL3 | 0x420, OPC_SEH = OPC_SPECIAL3 | 0x620, + + /* MIPS r6 doesn't have JR, JALR should be used instead */ + OPC_JR = use_mips32r6_instructions ? OPC_JALR : OPC_JR_R5, } MIPSInsn; /*