From patchwork Fri May 26 21:16:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 767577 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 3wZK0f6bnZz9s75 for ; Sat, 27 May 2017 07:25:06 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="NTM0lpnB"; dkim-atps=neutral Received: from localhost ([::1]:38553 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dEMjI-0001ss-Eh for incoming@patchwork.ozlabs.org; Fri, 26 May 2017 17:25:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40591) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dEMbW-0000iu-SC for qemu-devel@nongnu.org; Fri, 26 May 2017 17:17:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dEMbW-0008NA-0t for qemu-devel@nongnu.org; Fri, 26 May 2017 17:17:02 -0400 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:33347) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dEMbV-0008N1-SX for qemu-devel@nongnu.org; Fri, 26 May 2017 17:17:01 -0400 Received: by mail-qt0-x242.google.com with SMTP id a46so2853915qte.0 for ; Fri, 26 May 2017 14:17:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=VzVFDvBVaMcxYMiHjdzFPZrytVEUjFfio2eFEkfAzuQ=; b=NTM0lpnB1Mk/yGTumpgYBs//FNryFJyj44q1saBwhNp33GjicJ/tCYyllp8ITWl/bt pbV9hlpjnV589lUH51Guv0/4ZT6FMUSStXkuDA9FXDABRy22A+spH93AOpzJ9oW9oeiK RbvnRz1DZboiNpukoa9AIaeJUEC+B2/t107IBD1MOPm8stzFXMOguCsAKAh8vm0365Xh B8e5Jn+Ktrply9bSRO47AY5nOmI8604BvVPp78fIqSmtmQN3bevi5RchvTJ9k2NFaFNR fhIKaI2yxunyr6DykXWRxfZHILL4PKIMJ91EK6Rp8ABvmUZj+VRia0C4J2eMts9b2/SH m1Ug== 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:subject:date:message-id :in-reply-to:references; bh=VzVFDvBVaMcxYMiHjdzFPZrytVEUjFfio2eFEkfAzuQ=; b=s69RxIE5HbeRZZv0dTyCyJckzV8A0CMEI5S07tmeQqT6CGa8pWhmDK6eyG0U4f2BsH jAhSbAtIiWEtYmmp2AzAKWVBGi2mUFyxsBRy93ugchOsXHFywbdX9+HJU4y4a/GY/6WV 8wWWyVQwjeHZYNAiylEpXekHL/Y1sNmyVzillygVZQA9p0X2xqDPLFlv4gSvZ5x0vuOh KhXPy7UVGv0Uwv2+BKkzguy6ZkF6NgRAITzGJYMpp3lnJNmIH+h8WJvjWNoG9TZB89Ww 4A5L5fEEp7gTuulrcDqB7YMnoY2FL6/1crBEYfnNw4oRl5nfg+vtgPyz3UsWmuvmGQmf 68hA== X-Gm-Message-State: AODbwcAGQrrTPp8zM93gtKnyE3jNP4qjEUMp9uxttBFxJaaqJumkQGa3 5Y1UiI3+gpH9A/B5a/E= X-Received: by 10.200.53.154 with SMTP id k26mr4799926qtb.86.1495833421228; Fri, 26 May 2017 14:17:01 -0700 (PDT) Received: from bigtime.twiddle.net.com ([2602:47:d954:1500:5e51:4fff:fe40:9c64]) by smtp.gmail.com with ESMTPSA id u19sm1262380qtc.64.2017.05.26.14.17.00 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 May 2017 14:17:00 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 26 May 2017 14:16:26 -0700 Message-Id: <20170526211638.32301-15-rth@twiddle.net> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170526211638.32301-1-rth@twiddle.net> References: <20170526211638.32301-1-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::242 Subject: [Qemu-devel] [PATCH v7 14/26] tcg/sparc: 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: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- tcg/sparc/tcg-target.h | 2 +- tcg/sparc/tcg-target.inc.c | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/tcg/sparc/tcg-target.h b/tcg/sparc/tcg-target.h index 9348ddd..854a0af 100644 --- a/tcg/sparc/tcg-target.h +++ b/tcg/sparc/tcg-target.h @@ -123,7 +123,7 @@ extern bool use_vis3_instructions; #define TCG_TARGET_HAS_muls2_i32 1 #define TCG_TARGET_HAS_muluh_i32 0 #define TCG_TARGET_HAS_mulsh_i32 0 -#define TCG_TARGET_HAS_goto_ptr 0 +#define TCG_TARGET_HAS_goto_ptr 1 #define TCG_TARGET_HAS_extrl_i64_i32 1 #define TCG_TARGET_HAS_extrh_i64_i32 1 diff --git a/tcg/sparc/tcg-target.inc.c b/tcg/sparc/tcg-target.inc.c index 3785d77..18afce2 100644 --- a/tcg/sparc/tcg-target.inc.c +++ b/tcg/sparc/tcg-target.inc.c @@ -1003,7 +1003,11 @@ static void tcg_target_qemu_prologue(TCGContext *s) /* delay slot */ tcg_out_nop(s); - /* No epilogue required. We issue ret + restore directly in the TB. */ + /* Epilogue for goto_ptr. */ + s->code_gen_epilogue = s->code_ptr; + tcg_out_arithi(s, TCG_REG_G0, TCG_REG_I7, 8, RETURN); + /* delay slot */ + tcg_out_movi_imm13(s, TCG_REG_O0, 0); #ifdef CONFIG_SOFTMMU build_trampolines(s); @@ -1288,6 +1292,10 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, tcg_out_nop(s); s->tb_jmp_reset_offset[a0] = tcg_current_code_size(s); break; + case INDEX_op_goto_ptr: + tcg_out_arithi(s, TCG_REG_G0, a0, 0, JMPL); + tcg_out_nop(s); + break; case INDEX_op_br: tcg_out_bpcc(s, COND_A, BPCC_PT, arg_label(a0)); tcg_out_nop(s); @@ -1513,6 +1521,7 @@ static const TCGTargetOpDef sparc_op_defs[] = { { INDEX_op_exit_tb, { } }, { INDEX_op_goto_tb, { } }, { INDEX_op_br, { } }, + { INDEX_op_goto_ptr, { "r" } }, { INDEX_op_ld8u_i32, { "r", "r" } }, { INDEX_op_ld8s_i32, { "r", "r" } },