[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 08/30] tcg/loongarch: Implement the memory barrier op
From: |
WANG Xuerui |
Subject: |
[PATCH 08/30] tcg/loongarch: Implement the memory barrier op |
Date: |
Mon, 20 Sep 2021 16:04:29 +0800 |
Signed-off-by: WANG Xuerui <git@xen0n.name>
---
tcg/loongarch/tcg-target.c.inc | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/tcg/loongarch/tcg-target.c.inc b/tcg/loongarch/tcg-target.c.inc
index 8be34f8275..71564e3246 100644
--- a/tcg/loongarch/tcg-target.c.inc
+++ b/tcg/loongarch/tcg-target.c.inc
@@ -248,3 +248,35 @@ static bool patch_reloc(tcg_insn_unit *code_ptr, int type,
g_assert_not_reached();
}
}
+
+#include "tcg-insn-defs.c.inc"
+
+/*
+ * TCG intrinsics
+ */
+
+static void tcg_out_mb(TCGContext *s, TCGArg a0)
+{
+ /* Baseline LoongArch only has the full barrier, unfortunately. */
+ tcg_out_opc_dbar(s, 0);
+}
+
+/*
+ * Entry-points
+ */
+
+static void tcg_out_op(TCGContext *s, TCGOpcode opc,
+ const TCGArg args[TCG_MAX_OP_ARGS],
+ const int const_args[TCG_MAX_OP_ARGS])
+{
+ TCGArg a0 = args[0];
+
+ switch (opc) {
+ case INDEX_op_mb:
+ tcg_out_mb(s, a0);
+ break;
+
+ default:
+ g_assert_not_reached();
+ }
+}
--
2.33.0
- [PATCH 17/30] tcg/loongarch: Implement neg/add/sub ops, (continued)
- [PATCH 17/30] tcg/loongarch: Implement neg/add/sub ops, WANG Xuerui, 2021/09/20
- [PATCH 11/30] tcg/loongarch: Implement sign-/zero-extension ops, WANG Xuerui, 2021/09/20
- [PATCH 20/30] tcg/loongarch: Implement setcond ops, WANG Xuerui, 2021/09/20
- [PATCH 15/30] tcg/loongarch: Implement clz/ctz ops, WANG Xuerui, 2021/09/20
- [PATCH 18/30] tcg/loongarch: Implement mul/mulsh/muluh/div/divu/rem/remu ops, WANG Xuerui, 2021/09/20
- [PATCH 08/30] tcg/loongarch: Implement the memory barrier op,
WANG Xuerui <=
- [PATCH 24/30] tcg/loongarch: Implement tcg_target_qemu_prologue, WANG Xuerui, 2021/09/20
- [PATCH 28/30] configure, meson.build: Mark support for 64-bit LoongArch hosts, WANG Xuerui, 2021/09/20
- Re: [PATCH 28/30] configure, meson.build: Mark support for 64-bit LoongArch hosts, Richard Henderson, 2021/09/20
- Re: [PATCH 28/30] configure, meson.build: Mark support for 64-bit LoongArch hosts, Richard Henderson, 2021/09/21
- Re: [PATCH 28/30] configure, meson.build: Mark support for 64-bit LoongArch hosts, WANG Xuerui, 2021/09/21
- Re: [PATCH 28/30] configure, meson.build: Mark support for 64-bit LoongArch hosts, WANG Xuerui, 2021/09/21