From patchwork Wed Sep 7 21:10:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 9319945 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 479D360752 for ; Wed, 7 Sep 2016 21:21:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4672529421 for ; Wed, 7 Sep 2016 21:21:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3B7A62942E; Wed, 7 Sep 2016 21:21:16 +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 CA05729421 for ; Wed, 7 Sep 2016 21:21:15 +0000 (UTC) Received: from localhost ([::1]:43103 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhkHT-0000xk-04 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 07 Sep 2016 17:21:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52422) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhk8B-0000VP-0m for qemu-devel@nongnu.org; Wed, 07 Sep 2016 17:11:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bhk8A-0002mx-3M for qemu-devel@nongnu.org; Wed, 07 Sep 2016 17:11:38 -0400 Received: from mail-yw0-x242.google.com ([2607:f8b0:4002:c05::242]:34233) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhk89-0002mt-Us for qemu-devel@nongnu.org; Wed, 07 Sep 2016 17:11:38 -0400 Received: by mail-yw0-x242.google.com with SMTP id j1so1172292ywb.1 for ; Wed, 07 Sep 2016 14:11:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=w5Wm/TPdApJ72C9C6oB43o6US2JainG9T4B7f317iE0=; b=yr0JXOaTNfJQouysG0tmqFb0lrw66dAx50y4HEHEmaZccpOFyj5PXMh33OEokTaFyT BapPbZA0kh4tgGus/vjinqMFkfVsDoyekFegT/TcV7K3nZgNtH4tcsSsGV9oizb1ul8U CCNC9NiUIX906MOAztTsVa8tn90yzv3es/J4VpK4PeOVfTUtbc0Abydy47T7SEfPctRG STGkQqTUDn7mPU+JW3BFl4xZV2ZhVwustU8Qi5AX150C3FB2RCzQ3e6iXuW1vMHVh0Y2 axYCj0a+1LNwtL+yG4koTtLcXyBm233E1Nl8hT3kwmFfBBOwLGp8+xCtANBkDK3PIk0p eRTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=w5Wm/TPdApJ72C9C6oB43o6US2JainG9T4B7f317iE0=; b=IkN/hJIc59SHQdo+/4xUKHG0zTrrmlfwZqFAd+tMAMtM+ZOwKzPbafcXCvRp4tF6nJ Ndsw9BcXZsWrG1StW57mvveS9W5gw2kYWDXf2SVjFwOPOGbtWZzfsuetx1S8vwoFFSqb 2ekSAfyHnBa+hmlzY3jnTUulWJ7JYkwHHKOF0bBAw8Ns8Rw97dYkVJb4YWW9zCSKznJz VZit17rWBcT23y0uSIPtaOPq8NxeH0vIDk/BKCAyJadGvGxE6WxVhZ1MJTqex0Yz41yW OP1jy/Oaq29/LMNhTUevrxjpmbkd8HR0LyZzw9CG3MZOQuDARj7BtQfcyJ8Qowhh3jx5 MH8w== X-Gm-Message-State: AE9vXwO0IOYNPBA/S3XcsnFhN7ZCjjQUZD+9Elkeq9Kle9dNlvJ0dSc1aXFWWJ6SBpz0aQ== X-Received: by 10.129.161.67 with SMTP id y64mr15606121ywg.47.1473282697682; Wed, 07 Sep 2016 14:11:37 -0700 (PDT) Received: from bigtime.com (174-24-157-40.tukw.qwest.net. [174.24.157.40]) by smtp.gmail.com with ESMTPSA id 17sm15558301ywk.17.2016.09.07.14.11.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Sep 2016 14:11:37 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 7 Sep 2016 14:10:42 -0700 Message-Id: <1473282648-23487-13-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1473282648-23487-1-git-send-email-rth@twiddle.net> References: <1473282648-23487-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4002:c05::242 Subject: [Qemu-devel] [PULL 12/18] tcg/sparc: Add support for fence 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, Pranith Kumar Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Pranith Kumar Signed-off-by: Pranith Kumar Message-Id: <20160714202026.9727-10-bobby.prani@gmail.com> Signed-off-by: Richard Henderson --- tcg/sparc/tcg-target.inc.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tcg/sparc/tcg-target.inc.c b/tcg/sparc/tcg-target.inc.c index 10e4126..bca25e2 100644 --- a/tcg/sparc/tcg-target.inc.c +++ b/tcg/sparc/tcg-target.inc.c @@ -249,6 +249,8 @@ static const int tcg_target_call_oarg_regs[] = { #define STWA (INSN_OP(3) | INSN_OP3(0x14)) #define STXA (INSN_OP(3) | INSN_OP3(0x1e)) +#define MEMBAR (INSN_OP(2) | INSN_OP3(0x28) | INSN_RS1(15) | (1 << 13)) + #ifndef ASI_PRIMARY_LITTLE #define ASI_PRIMARY_LITTLE 0x88 #endif @@ -835,6 +837,12 @@ static void tcg_out_call(TCGContext *s, tcg_insn_unit *dest) tcg_out_nop(s); } +static void tcg_out_mb(TCGContext *s, TCGArg a0) +{ + /* Note that the TCG memory order constants mirror the Sparc MEMBAR. */ + tcg_out32(s, MEMBAR | (a0 & TCG_MO_ALL)); +} + #ifdef CONFIG_SOFTMMU static tcg_insn_unit *qemu_ld_trampoline[16]; static tcg_insn_unit *qemu_st_trampoline[16]; @@ -1465,6 +1473,10 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, tcg_out_arithc(s, a0, TCG_REG_G0, a1, const_args[1], c); break; + case INDEX_op_mb: + tcg_out_mb(s, a0); + break; + case INDEX_op_mov_i32: /* Always emitted via tcg_out_mov. */ case INDEX_op_mov_i64: case INDEX_op_movi_i32: /* Always emitted via tcg_out_movi. */ @@ -1566,6 +1578,7 @@ static const TCGTargetOpDef sparc_op_defs[] = { { INDEX_op_qemu_st_i32, { "sZ", "A" } }, { INDEX_op_qemu_st_i64, { "SZ", "A" } }, + { INDEX_op_mb, { } }, { -1 }, };