[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 08/30] tcg/loongarch64: Implement the memory barrier op
From: |
WANG Xuerui |
Subject: |
[PATCH v6 08/30] tcg/loongarch64: Implement the memory barrier op |
Date: |
Sun, 26 Sep 2021 01:30:10 +0800 |
Signed-off-by: WANG Xuerui <git@xen0n.name>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
tcg/loongarch64/tcg-target.c.inc | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc
index fbacaef862..f12955723d 100644
--- a/tcg/loongarch64/tcg-target.c.inc
+++ b/tcg/loongarch64/tcg-target.c.inc
@@ -234,3 +234,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 v6 00/30] LoongArch64 port of QEMU TCG, WANG Xuerui, 2021/09/25
- [PATCH v6 03/30] tcg/loongarch64: Add the tcg-target.h file, WANG Xuerui, 2021/09/25
- [PATCH v6 01/30] elf: Add machine type value for LoongArch, WANG Xuerui, 2021/09/25
- [PATCH v6 02/30] MAINTAINERS: Add tcg/loongarch64 entry with myself as maintainer, WANG Xuerui, 2021/09/25
- [PATCH v6 04/30] tcg/loongarch64: Add generated instruction opcodes and encoding helpers, WANG Xuerui, 2021/09/25
- [PATCH v6 05/30] tcg/loongarch64: Add register names, allocation order and input/output sets, WANG Xuerui, 2021/09/25
- [PATCH v6 08/30] tcg/loongarch64: Implement the memory barrier op,
WANG Xuerui <=
- [PATCH v6 11/30] tcg/loongarch64: Implement sign-/zero-extension ops, WANG Xuerui, 2021/09/25
- [PATCH v6 07/30] tcg/loongarch64: Implement necessary relocation operations, WANG Xuerui, 2021/09/25
- [PATCH v6 12/30] tcg/loongarch64: Implement not/and/or/xor/nor/andc/orc ops, WANG Xuerui, 2021/09/25
- [PATCH v6 09/30] tcg/loongarch64: Implement tcg_out_mov and tcg_out_movi, WANG Xuerui, 2021/09/25
- [PATCH v6 10/30] tcg/loongarch64: Implement goto_ptr, WANG Xuerui, 2021/09/25
- [PATCH v6 15/30] tcg/loongarch64: Implement clz/ctz ops, WANG Xuerui, 2021/09/25
- [PATCH v6 06/30] tcg/loongarch64: Define the operand constraints, WANG Xuerui, 2021/09/25
- [PATCH v6 26/30] tcg/loongarch64: Implement tcg_target_init, WANG Xuerui, 2021/09/25