From patchwork Mon Jun 5 16:52:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 9766981 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8D17060353 for ; Mon, 5 Jun 2017 17:08:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 72413251F4 for ; Mon, 5 Jun 2017 17:08:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6630627F8F; Mon, 5 Jun 2017 17:08:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 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 mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DC949251F4 for ; Mon, 5 Jun 2017 17:08:48 +0000 (UTC) Received: from localhost ([::1]:34424 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dHvUl-0002ga-Tj for patchwork-qemu-devel@patchwork.kernel.org; Mon, 05 Jun 2017 13:08:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56802) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dHvFS-0004Wz-EP for qemu-devel@nongnu.org; Mon, 05 Jun 2017 12:52:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dHvFR-0003pk-95 for qemu-devel@nongnu.org; Mon, 05 Jun 2017 12:52:58 -0400 Received: from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]:36153) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dHvFR-0003pW-3a for qemu-devel@nongnu.org; Mon, 05 Jun 2017 12:52:57 -0400 Received: by mail-qt0-x244.google.com with SMTP id s33so9907366qtg.3 for ; Mon, 05 Jun 2017 09:52:56 -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; bh=VzVFDvBVaMcxYMiHjdzFPZrytVEUjFfio2eFEkfAzuQ=; b=TmtSu6bC6N4YKNpgeN85hkuKzwVVvlaDzvBJ7cIFP2IoRjxsNkA7X8G8P5JOiHFuo4 zcIFKgtBc6bas6A0LmJMPcE4sGW4D2iX+HQHJ7W8gAmW4PFLZkG8vIxOAlXK63qfxiuK QLpjhvMgwRfRrx8ZK8ADnJuzIXZ97zcYnUE9aM0JFWSwj5b4VGcvVx7LEeHfyNatNVw5 inPxrmcoa2GbPjJpFpFYWleHHLnE2TrjRYqOlqNUIXYETOQKvgRsV7WEwCcpyR8tGSwZ Ko3zAsHxrl/nR8XI/rWLbSAgQsN1rkt4u3jJCTjH6oqWhMyEGFqfLjVLp5+DTrKzZdwu 7YqA== 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; bh=VzVFDvBVaMcxYMiHjdzFPZrytVEUjFfio2eFEkfAzuQ=; b=EQ06Qan6RDE/tQv9oNIhy+jTSBUSks0AFaBhl3YUxtuNEUfTG18VjZ67cGkfkaCl4W 9eXkH8YXnBx/coREmp7oWi6nwQBzQwvKkDBp04Rk7pr0YuZ9hDIJpiH1tbZwVcqNwFq+ w2ity3plP8DfOmcDe0ar+DvnURMHvLx7deU3qU+iotAXJZjtFTm/QoFsu673w4aL6fKL wd9Z3qScsz/FkBzrgTe1gsD4fS5+lxqkJIpLU5YGKIhfgpcuGyw7TVJdorWHyGYoVREu tm6ieDf5HpWeBcpg5Fjvn4jlZ4R3TyJwWPSTFxRDods40YPFsPdXQhy93uKu0MPSvMyh qvaw== X-Gm-Message-State: AODbwcBJSyvHktSiJM72Z6f6zAXgEyFeDutKvhdzvOBG2lfLiq5d/NPr NFVU8fPdnlWqJqsaOYc= X-Received: by 10.237.59.197 with SMTP id s5mr85844qte.192.1496681576336; Mon, 05 Jun 2017 09:52:56 -0700 (PDT) Received: from bigtime.twiddle.net.com ([2602:47:d954:1500:5e51:4fff:fe40:9c64]) by smtp.gmail.com with ESMTPSA id c6sm1637044qtb.56.2017.06.05.09.52.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Jun 2017 09:52:55 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 5 Jun 2017 09:52:21 -0700 Message-Id: <20170605165233.4135-15-rth@twiddle.net> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170605165233.4135-1-rth@twiddle.net> References: <20170605165233.4135-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::244 Subject: [Qemu-devel] [PULL 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: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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" } },