From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32968) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZTfZ5-0006wV-RW for qemu-devel@nongnu.org; Sun, 23 Aug 2015 20:24:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZTfZ3-0000it-6D for qemu-devel@nongnu.org; Sun, 23 Aug 2015 20:24:43 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:37009) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZTfZ3-0000ip-3Y for qemu-devel@nongnu.org; Sun, 23 Aug 2015 20:24:41 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id F3101209B7 for ; Sun, 23 Aug 2015 20:24:40 -0400 (EDT) From: "Emilio G. Cota" Date: Sun, 23 Aug 2015 20:23:49 -0400 Message-Id: <1440375847-17603-21-git-send-email-cota@braap.org> In-Reply-To: <1440375847-17603-1-git-send-email-cota@braap.org> References: <1440375847-17603-1-git-send-email-cota@braap.org> Subject: [Qemu-devel] [RFC 20/38] tcg/i386: implement fences List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, mttcg@listserver.greensocs.com Cc: mark.burton@greensocs.com, a.rigo@virtualopensystems.com, guillaume.delbergue@greensocs.com, pbonzini@redhat.com, alex.bennee@linaro.org, Frederic Konrad Signed-off-by: Emilio G. Cota --- tcg/i386/tcg-target.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tcg/i386/tcg-target.c b/tcg/i386/tcg-target.c index 887f22f..6600c45 100644 --- a/tcg/i386/tcg-target.c +++ b/tcg/i386/tcg-target.c @@ -1123,6 +1123,13 @@ static void tcg_out_jmp(TCGContext *s, tcg_insn_unit *dest) tcg_out_branch(s, 0, dest); } +static inline void tcg_out_fence(TCGContext *s, uint8_t op) +{ + tcg_out8(s, 0x0f); + tcg_out8(s, 0xae); + tcg_out8(s, op); +} + #if defined(CONFIG_SOFTMMU) /* helper signature: helper_ret_ld_mmu(CPUState *env, target_ulong addr, * int mmu_idx, uintptr_t ra) @@ -2088,6 +2095,16 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode opc, } break; + case INDEX_op_fence_load: + tcg_out_fence(s, 0xe8); + break; + case INDEX_op_fence_full: + tcg_out_fence(s, 0xf0); + break; + case INDEX_op_fence_store: + tcg_out_fence(s, 0xf8); + 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. */ @@ -2226,6 +2243,9 @@ static const TCGTargetOpDef x86_op_defs[] = { { INDEX_op_qemu_ld_i64, { "r", "r", "L", "L" } }, { INDEX_op_qemu_st_i64, { "L", "L", "L", "L" } }, #endif + { INDEX_op_fence_load, { } }, + { INDEX_op_fence_store, { } }, + { INDEX_op_fence_full, { } }, { -1 }, }; -- 1.9.1