From patchwork Fri May 27 01:00:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 9137527 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 CADD46075A for ; Fri, 27 May 2016 01:01:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BE2292807E for ; Fri, 27 May 2016 01:01:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B35F4282E1; Fri, 27 May 2016 01:01:31 +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 640CF2807E for ; Fri, 27 May 2016 01:01:31 +0000 (UTC) Received: from localhost ([::1]:41155 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b669a-00006P-Fn for patchwork-qemu-devel@patchwork.kernel.org; Thu, 26 May 2016 21:01:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40314) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6693-0008VU-5C for qemu-devel@nongnu.org; Thu, 26 May 2016 21:00:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b668w-00049p-8f for qemu-devel@nongnu.org; Thu, 26 May 2016 21:00:56 -0400 Received: from mail-qg0-x242.google.com ([2607:f8b0:400d:c04::242]:33032) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b668w-00049k-4D for qemu-devel@nongnu.org; Thu, 26 May 2016 21:00:50 -0400 Received: by mail-qg0-x242.google.com with SMTP id 90so2525785qgz.0 for ; Thu, 26 May 2016 18:00:49 -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=rv+UhiT698rQYtWcrCM4Y7+nvzL/LJAHLFMnn/DJdRc=; b=bypTh3oC4fymW4YPWgMLvktqY22K7NY7DNaRvoMpbpNU1NriG2x57RgzYbxLQ62nFE v7dL6OjLp0pU7nb9O6hUW4MjKgTekZKO6oMKTit6B3NG7fRb/FQZh2BSyU/57bUl8Tdi pV27sUJhKltbwlwg9QRde34uMRPnAnpvK0tQ6p/b/L/njfGiAsuujEles5o2W4Za+2Ui cq9ob8dnxkBWl9M9CBJBw+6PDLs5JnK6HThwW36/QNXU31qKdPyyUly2TYXxwRBUHcbX Z64u5lghHhm2XMs3BqltBgTCpXbLydyRbSsxRyuqjm5yz+vcegpH1OUdMx5hgm1uaN6L fBlA== 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=rv+UhiT698rQYtWcrCM4Y7+nvzL/LJAHLFMnn/DJdRc=; b=jXmdOr9j+V98WMCwJ4r4BFXYmrIeqbx72ruVFYGF+BSMUfEMtb1SHu1at9eMKWjhDn /xl8LX8tlCC/bkxEFf9NXAmsm6WikYEzmmYmsHjsZSan7qheluaxPHl+5yOSOgWhVziK 6AQA/SoRv5ZGW1ExjuWp4feZ7Rfbm9bANqP1hU2XPVU81tsbzepepTEvuieZeNky7ciY cbSK5ngg0FMKRVZ0OROtbdpIXrMuxQPdV3L3xHJR0b/u4PPxR6dmWZ/7ZCF+FE5ynH8o PHU6lW9FHoXvzXp/ygeAQ2IVoaavCYOeM+XWGYetkPbWhs/b57SidR0qPMB60TdfKccc xpKQ== X-Gm-Message-State: ALyK8tLxWD7Co3WVmP1UeCJCLDsm9Y7Rqj3PEYbIe677LTRzHejnlozZBe34qo1+E6UULw== X-Received: by 10.140.105.71 with SMTP id b65mr11070248qgf.66.1464310849646; Thu, 26 May 2016 18:00:49 -0700 (PDT) Received: from bigtime.com ([172.56.17.0]) by smtp.gmail.com with ESMTPSA id 77sm1872030qgn.29.2016.05.26.18.00.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 May 2016 18:00:49 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 26 May 2016 18:00:04 -0700 Message-Id: <1464310815-13554-2-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1464310815-13554-1-git-send-email-rth@twiddle.net> References: <1464310815-13554-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:400d:c04::242 Subject: [Qemu-devel] [PATCH v2 01/12] Introduce TCGOpcode for fence instruction 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: bobby.prani@gmail.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP This commit introduces the TCGOpcode for fence instruction. Signed-off-by: Pranith Kumar Message-Id: <20160524171856.1000-2-bobby.prani@gmail.com> Signed-off-by: Richard Henderson --- tcg/tcg-op.c | 6 ++++++ tcg/tcg-op.h | 2 ++ tcg/tcg-opc.h | 2 ++ 3 files changed, 10 insertions(+) diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index 54c0277..2a7af95 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -146,6 +146,12 @@ void tcg_gen_op6(TCGContext *ctx, TCGOpcode opc, TCGArg a1, TCGArg a2, tcg_emit_op(ctx, opc, pi); } +void tcg_gen_fence(void) +{ + /* ??? Enable only when MTTCG is enabled. */ + tcg_gen_op1(&tcg_ctx, INDEX_op_fence, 0); +} + /* 32 bit ops */ void tcg_gen_addi_i32(TCGv_i32 ret, TCGv_i32 arg1, int32_t arg2) diff --git a/tcg/tcg-op.h b/tcg/tcg-op.h index f217e80..2293720 100644 --- a/tcg/tcg-op.h +++ b/tcg/tcg-op.h @@ -261,6 +261,8 @@ static inline void tcg_gen_br(TCGLabel *l) tcg_gen_op1(&tcg_ctx, INDEX_op_br, label_arg(l)); } +void tcg_gen_fence(void); + /* Helper calls. */ /* 32 bit ops */ diff --git a/tcg/tcg-opc.h b/tcg/tcg-opc.h index 6d0410c..b772d90 100644 --- a/tcg/tcg-opc.h +++ b/tcg/tcg-opc.h @@ -42,6 +42,8 @@ DEF(br, 0, 0, 1, TCG_OPF_BB_END) # define IMPL64 TCG_OPF_64BIT #endif +DEF(fence, 0, 0, 0, TCG_OPF_SIDE_EFFECTS) + DEF(mov_i32, 1, 1, 0, TCG_OPF_NOT_PRESENT) DEF(movi_i32, 1, 0, 1, TCG_OPF_NOT_PRESENT) DEF(setcond_i32, 1, 2, 1, 0)