summaryrefslogtreecommitdiffstats
path: root/tcg/loongarch64
diff options
context:
space:
mode:
authorWANG Xuerui2021-12-21 06:40:42 +0100
committerRichard Henderson2021-12-21 22:17:06 +0100
commitfae2361dc996ad68591ac8871d2c14f3a174ee3c (patch)
treeb99dc46aec0559308cecf22136680b3795afa6b4 /tcg/loongarch64
parenttcg/loongarch64: Implement necessary relocation operations (diff)
downloadqemu-fae2361dc996ad68591ac8871d2c14f3a174ee3c.tar.gz
qemu-fae2361dc996ad68591ac8871d2c14f3a174ee3c.tar.xz
qemu-fae2361dc996ad68591ac8871d2c14f3a174ee3c.zip
tcg/loongarch64: Implement the memory barrier op
Signed-off-by: WANG Xuerui <git@xen0n.name> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20211221054105.178795-9-git@xen0n.name> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'tcg/loongarch64')
-rw-r--r--tcg/loongarch64/tcg-target.c.inc32
1 files changed, 32 insertions, 0 deletions
diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc
index a88ba9a253..615bed9096 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();
+ }
+}