]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
target/loongarch: Enable the disassembler for host tcg
authorRichard Henderson <richard.henderson@linaro.org>
Thu, 1 Dec 2022 00:22:09 +0000 (16:22 -0800)
committerRichard Henderson <richard.henderson@linaro.org>
Tue, 24 Jan 2023 01:36:36 +0000 (15:36 -1000)
Reuse the decodetree based disassembler from
target/loongarch/ for tcg/loongarch64/.

The generation of decode-insns.c.inc into ./libcommon.fa.p/ could
eventually result in conflict, if any other host requires the same
trick, but this is good enough for now.

Reviewed-by: WANG Xuerui <git@xen0n.name>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
disas.c
target/loongarch/meson.build

diff --git a/disas.c b/disas.c
index 3b31315f40388ad8012252db7faf30ffea1e8215..b087c12c4727e1654001511363774d1316bd6a7e 100644 (file)
--- a/disas.c
+++ b/disas.c
@@ -198,6 +198,8 @@ static void initialize_debug_host(CPUDebug *s)
     s->info.cap_insn_split = 6;
 #elif defined(__hppa__)
     s->info.print_insn = print_insn_hppa;
+#elif defined(__loongarch__)
+    s->info.print_insn = print_insn_loongarch;
 #endif
 }
 
index 6376f9e84bca7d0e49c6eb0d35923bf402306db8..690633969fc3b737ffe8558e03cb9fcacfb8465c 100644 (file)
@@ -3,7 +3,6 @@ gen = decodetree.process('insns.decode')
 loongarch_ss = ss.source_set()
 loongarch_ss.add(files(
   'cpu.c',
-  'disas.c',
 ))
 loongarch_tcg_ss = ss.source_set()
 loongarch_tcg_ss.add(gen)
@@ -24,6 +23,8 @@ loongarch_softmmu_ss.add(files(
   'iocsr_helper.c',
 ))
 
+common_ss.add(when: 'CONFIG_LOONGARCH_DIS', if_true: [files('disas.c'), gen])
+
 loongarch_ss.add_all(when: 'CONFIG_TCG', if_true: [loongarch_tcg_ss])
 
 target_arch += {'loongarch': loongarch_ss}