Skip to contentSkip to conversation

target/microblaze: Compile it once

PATCH In review Philippe Mathieu-Daudé 3 participants 23 messages Apr 23 – Apr 24 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

cover target/microblaze: Compile it once

Compiling target/microblaze/ is now almost trivial.

The first 2 patches should be backported to the stable release IMO.

Philippe Mathieu-Daudé (9):
tcg: Include missing 'tcg/tcg-op-common.h' header in 'tcg-op-mem.h' target/microblaze: Fix endianness used to disassemble target/microblaze: Replace translator_ldl_swap() ->
translator_ldl_end()
target/microblaze: Introduce common system/user meson source set target/microblaze: Compile helper.c as common unit target/microblaze: Compile op_helper.c as common unit target/microblaze: Compile cpu.c as common unit target/microblaze: Include missing cpu-mmu-index.h header in
translate.c
target/microblaze: Compile translate.c as common unit

 include/tcg/tcg-op-mem.h      |  2 ++
 target/microblaze/cpu.h       |  7 -------
 target/microblaze/cpu.c       |  6 +++---
 target/microblaze/op_helper.c |  2 +-
 target/microblaze/translate.c | 11 +++++++----
 target/microblaze/meson.build | 12 ++++++------
 6 files changed, 19 insertions(+), 21 deletions(-)
Signature · 1 line
2.53.0
#1 lore raw

PATCH 1/9 tcg: Include missing 'tcg/tcg-op-common.h' header in 'tcg-op-mem.h'

"tcg-op-mem.h" uses methods declared in "tcg/tcg-op-common.h". Include the latter to avoid when including the former:

include/tcg/tcg-op-mem.h:34:5: error: call to undeclared function 'tcg_gen_qemu_ld_i32_chk'

   34 |     tcg_gen_qemu_ld_i32_chk(v, tcgv_va_temp(a), i, m, TCG_TYPE_VA);
      |     ^
  $ git grep -w tcg_gen_qemu_ld_i32_chk
  include/tcg/tcg-op-common.h:328:void tcg_gen_qemu_ld_i32_chk(TCGv_i32, TCGTemp *, TCGArg, MemOp, TCGType);
  include/tcg/tcg-op-mem.h:35:    tcg_gen_qemu_ld_i32_chk(v, tcgv_va_temp(a), i, m, TCG_TYPE_VA);
  tcg/tcg-op-ldst.c:286:void tcg_gen_qemu_ld_i32_chk(TCGv_i32 val, TCGTemp *addr, TCGArg idx,
Fixes 69cdc5babf9 ("include/tcg/tcg-op: extract memory operations to tcg-op-mem.h")
---
 include/tcg/tcg-op-mem.h | 2 ++
 1 file changed, 2 insertions(+)
include/tcg/tcg-op-mem.h +2 -0
index 36931d1dd57..ea35a02fb40 100644
@@ -12,6 +12,8 @@
 #error TCG_ADDRESS_BITS must be defined
 #endif
 
+#include "tcg/tcg-op-common.h"
+
 #if TCG_ADDRESS_BITS == 32
 typedef TCGv_i32 TCGv_va;
 #define TCG_TYPE_VA TCG_TYPE_I32
Signature · 1 line
2.53.0
#2 lore raw

Re: [PATCH 1/9] tcg: Include missing 'tcg/tcg-op-common.h' header in 'tcg-op-mem.h'

Quoted 12 lines · Philippe Mathieu-Daudé

"tcg-op-mem.h" uses methods declared in "tcg/tcg-op-common.h". Include the latter to avoid when including the former:

   include/tcg/tcg-op-mem.h:34:5: error: call to undeclared function 'tcg_gen_qemu_ld_i32_chk'
    34 |     tcg_gen_qemu_ld_i32_chk(v, tcgv_va_temp(a), i, m, TCG_TYPE_VA);
       |     ^

   $ git grep -w tcg_gen_qemu_ld_i32_chk
   include/tcg/tcg-op-common.h:328:void tcg_gen_qemu_ld_i32_chk(TCGv_i32, TCGTemp *, TCGArg, MemOp, TCGType);
   include/tcg/tcg-op-mem.h:35:    tcg_gen_qemu_ld_i32_chk(v, tcgv_va_temp(a), i, m, TCG_TYPE_VA);
   tcg/tcg-op-ldst.c:286:void tcg_gen_qemu_ld_i32_chk(TCGv_i32 val, TCGTemp *addr, TCGArg idx,
Quoted 2 lines
Fixes 69cdc5babf9 ("include/tcg/tcg-op: extract memory operations to tcg-op-mem.h")

Pardon? This isn't in master.

I recall this is one of Pierrick's patches, but we should fix it before committing.

r~

#3 lore raw

Re: [PATCH 1/9] tcg: Include missing 'tcg/tcg-op-common.h' header in 'tcg-op-mem.h'

Quoted 13 lines · Richard Henderson
Quoted 12 lines · Philippe Mathieu-Daudé

"tcg-op-mem.h" uses methods declared in "tcg/tcg-op-common.h". Include the latter to avoid when including the former:

   include/tcg/tcg-op-mem.h:34:5: error: call to undeclared function 'tcg_gen_qemu_ld_i32_chk' 34 |     tcg_gen_qemu_ld_i32_chk(v, tcgv_va_temp(a), i, m, TCG_TYPE_VA);
       |     ^

   $ git grep -w tcg_gen_qemu_ld_i32_chk
   include/tcg/tcg-op-common.h:328:void tcg_gen_qemu_ld_i32_chk(TCGv_i32, TCGTemp *, TCGArg, MemOp, TCGType);
   include/tcg/tcg-op-mem.h:35:    tcg_gen_qemu_ld_i32_chk(v, tcgv_va_temp(a), i, m, TCG_TYPE_VA);
   tcg/tcg-op-ldst.c:286:void tcg_gen_qemu_ld_i32_chk(TCGv_i32 val, TCGTemp *addr, TCGArg idx,
Quoted 4 lines
Quoted 2 lines
Fixes 69cdc5babf9 ("include/tcg/tcg-op: extract memory operations to tcg-op-mem.h")

Pardon?  This isn't in master.

Hmm I meant a8af0fb24da in Peter's tree:
https://lore.kernel.org/qemu-devel/[email protected]/

Quoted 2 lines

I recall this is one of Pierrick's patches, but we should fix it before committing.

I'll mention it in the other thread then.

Thanks,

Phil.

#4 lore raw

PATCH 2/9 target/microblaze: Fix endianness used to disassemble

In reply to Philippe Mathieu-Daudé

MicroBlaze CPU model has a "little-endian" property, pointing to the @endi internal field. Commit c36ec3a9655 ("hw/microblaze:
Explicit CPU endianness") took care of having all MicroBlaze boards with an explicit default endianness (similarly with commit 91fc6d8101d for linux-user binaries), so later commit 415aae543ed ("target/microblaze: Consider endianness while translating code") could infer the endianness at runtime from the @endi field, and not a compile time via the TARGET_BIG_ENDIAN definition. Doing so, we forgot to propagate that runtime change to the disassemble_info structure. Do it now to display the opcodes in correct endianness order.

Fixes 415aae543ed ("target/microblaze: Consider endianness while translating code")
---
 target/microblaze/cpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
target/microblaze/cpu.c +2 -2
index ec513ae82d4..639f46b525e 100644
@@ -237,8 +237,8 @@ static void mb_disas_set_info(const CPUState *cpu, disassemble_info *info)
 {
     info->mach = bfd_arch_microblaze;
     info->print_insn = print_insn_microblaze;
-    info->endian = TARGET_BIG_ENDIAN ? BFD_ENDIAN_BIG
-                                     : BFD_ENDIAN_LITTLE;
+    info->endian = MICROBLAZE_CPU(cpu)->cfg.endi ? BFD_ENDIAN_LITTLE
+                                                 : BFD_ENDIAN_BIG;
 }
 
 static void mb_cpu_realizefn(DeviceState *dev, Error **errp)
Signature · 1 line
2.53.0
Reviewed-by on v1 2/9
#5 lore raw

Re: [PATCH 2/9] target/microblaze: Fix endianness used to disassemble

Quoted 12 lines · Philippe Mathieu-Daudé

MicroBlaze CPU model has a "little-endian" property, pointing to the @endi internal field. Commit c36ec3a9655 ("hw/microblaze:
Explicit CPU endianness") took care of having all MicroBlaze boards with an explicit default endianness (similarly with commit 91fc6d8101d for linux-user binaries), so later commit 415aae543ed ("target/microblaze: Consider endianness while translating code") could infer the endianness at runtime from the @endi field, and not a compile time via the TARGET_BIG_ENDIAN definition. Doing so, we forgot to propagate that runtime change to the disassemble_info structure. Do it now to display the opcodes in correct endianness order.

Quoted 6 lines
Fixes 415aae543ed ("target/microblaze: Consider endianness while translating code")
---
  target/microblaze/cpu.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

r~

#6 lore raw

PATCH 3/9 target/microblaze: Replace translator_ldl_swap() -> translator_ldl_end()

In reply to Philippe Mathieu-Daudé

In preparation of removing the translator_ld[uw,l,q]() methods, inline them for the microblaze targets, using mo_endian(ctx) -- which we introduced in commit 2c9e8ddd7699 -- instead of MO_TE.

---
 target/microblaze/cpu.h       | 7 -------
 target/microblaze/translate.c | 4 ++--
 2 files changed, 2 insertions(+), 9 deletions(-)
target/microblaze/cpu.h +0 -7
index 5765786e6dc..ad5a4a8e7bf 100644
@@ -412,13 +412,6 @@ void mb_translate_code(CPUState *cs, TranslationBlock *tb,
 /* Ensure there is no overlap between the two masks. */
 QEMU_BUILD_BUG_ON(MSR_TB_MASK & IFLAGS_TB_MASK);
 
-static inline bool mb_cpu_is_big_endian(CPUState *cs)
-{
-    MicroBlazeCPU *cpu = MICROBLAZE_CPU(cs);
-
-    return !cpu->cfg.endi;
-}
-
 #if !defined(CONFIG_USER_ONLY)
 bool mb_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
                      MMUAccessType access_type, int mmu_idx,
target/microblaze/translate.c +2 -2
index 5e8bb4ed77b..af6a30b7760 100644
@@ -1646,8 +1646,8 @@ static void mb_tr_translate_insn(DisasContextBase *dcb, CPUState *cs)
 
     dc->tb_flags_to_set = 0;
 
-    ir = translator_ldl_swap(cpu_env(cs), &dc->base, dc->base.pc_next,
-                             mb_cpu_is_big_endian(cs) != TARGET_BIG_ENDIAN);
+    ir = translator_lduw_end(cpu_env(cs), &dc->base, dc->base.pc_next,
+                             mo_endian(dc));
     if (!decode(dc, ir)) {
         trap_illegal(dc, true);
     }
Signature · 1 line
2.53.0
#7 lore raw

Re: [PATCH 3/9] target/microblaze: Replace translator_ldl_swap() -> translator_ldl_end()

Quoted 3 lines · Philippe Mathieu-Daudé

In preparation of removing the translator_ld[uw,l,q]() methods, inline them for the microblaze targets, using mo_endian(ctx) -- which we introduced in commit 2c9e8ddd7699 -- instead of MO_TE.

"Remove mb_cpu_is_big_endian() which is now unused."

Quoted 40 lines
---
  target/microblaze/cpu.h       | 7 -------
  target/microblaze/translate.c | 4 ++--
  2 files changed, 2 insertions(+), 9 deletions(-)
target/microblaze/cpu.h +0 -7
index 5765786e6dc..ad5a4a8e7bf 100644
@@ -412,13 +412,6 @@ void mb_translate_code(CPUState *cs, TranslationBlock *tb,
  /* Ensure there is no overlap between the two masks. */
  QEMU_BUILD_BUG_ON(MSR_TB_MASK & IFLAGS_TB_MASK);
 
-static inline bool mb_cpu_is_big_endian(CPUState *cs)
-{
-    MicroBlazeCPU *cpu = MICROBLAZE_CPU(cs);
-
-    return !cpu->cfg.endi;
-}
-
  #if !defined(CONFIG_USER_ONLY)
  bool mb_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
                       MMUAccessType access_type, int mmu_idx,
target/microblaze/translate.c +2 -2
index 5e8bb4ed77b..af6a30b7760 100644
@@ -1646,8 +1646,8 @@ static void mb_tr_translate_insn(DisasContextBase *dcb, CPUState *cs)
 
      dc->tb_flags_to_set = 0;
 
-    ir = translator_ldl_swap(cpu_env(cs), &dc->base, dc->base.pc_next,
-                             mb_cpu_is_big_endian(cs) != TARGET_BIG_ENDIAN);
+    ir = translator_lduw_end(cpu_env(cs), &dc->base, dc->base.pc_next,
+                             mo_endian(dc));
      if (!decode(dc, ir)) {
          trap_illegal(dc, true);
      }
Reviewed-by on v1 3/9
#8 lore raw

Re: [PATCH 3/9] target/microblaze: Replace translator_ldl_swap() -> translator_ldl_end()

In reply to Philippe Mathieu-Daudé
Quoted 9 lines · Philippe Mathieu-Daudé

In preparation of removing the translator_ld[uw,l,q]() methods, inline them for the microblaze targets, using mo_endian(ctx) -- which we introduced in commit 2c9e8ddd7699 -- instead of MO_TE.

---
  target/microblaze/cpu.h       | 7 -------
  target/microblaze/translate.c | 4 ++--
  2 files changed, 2 insertions(+), 9 deletions(-)

r~

#9 lore raw

PATCH 4/9 target/microblaze: Introduce common system/user meson source set

In reply to Philippe Mathieu-Daudé

Introduce a source set common to system / user.
No logical change intended.

---
 target/microblaze/meson.build | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
target/microblaze/meson.build +7 -2
index b86b37d9238..7f7d27d4efa 100644
@@ -1,5 +1,10 @@
 gen = decodetree.process('insns.decode')
 
+microblaze_common_ss = ss.source_set()
+microblaze_common_ss.add(files(
+  'gdbstub.c',
+))
+
 microblaze_ss = ss.source_set()
 microblaze_ss.add(gen)
 microblaze_ss.add(files(
@@ -10,10 +15,10 @@ microblaze_ss.add(files(
 ))
 
 microblaze_user_ss = ss.source_set()
-microblaze_user_ss.add(files('gdbstub.c'))
+microblaze_user_ss.add_all(microblaze_common_ss)
 
 microblaze_common_system_ss = ss.source_set()
-microblaze_common_system_ss.add(files('gdbstub.c'))
+microblaze_common_system_ss.add_all(microblaze_common_ss)
 
 microblaze_system_ss = ss.source_set()
 microblaze_system_ss.add(files(
Signature · 1 line
2.53.0
#11 lore raw

PATCH 5/9 target/microblaze: Compile helper.c as common unit

In reply to Philippe Mathieu-Daudé

Nothing in helper.c prevents it to be built as common unit.

---
 target/microblaze/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target/microblaze/meson.build +1 -1
index 7f7d27d4efa..94c76de39bd 100644
@@ -3,13 +3,13 @@ gen = decodetree.process('insns.decode')
 microblaze_common_ss = ss.source_set()
 microblaze_common_ss.add(files(
   'gdbstub.c',
+  'helper.c',
 ))
 
 microblaze_ss = ss.source_set()
 microblaze_ss.add(gen)
 microblaze_ss.add(files(
   'cpu.c',
-  'helper.c',
   'op_helper.c',
   'translate.c',
 ))
Signature · 1 line
2.53.0
#13 lore raw

PATCH 6/9 target/microblaze: Compile op_helper.c as common unit

In reply to Philippe Mathieu-Daudé

In order do build op_helper.c as a common unit we simply need to use the common version of "accel/tcg/cpu-ldst.h".

---
 target/microblaze/op_helper.c | 2 +-
 target/microblaze/meson.build | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
target/microblaze/op_helper.c +1 -1
index 31da2c7c3ae..84c60c2636e 100644
@@ -23,7 +23,7 @@
 #include "cpu.h"
 #include "exec/helper-proto.h"
 #include "qemu/host-utils.h"
-#include "accel/tcg/cpu-ldst.h"
+#include "accel/tcg/cpu-ldst-common.h"
 #include "fpu/softfloat.h"
 
 void helper_put(uint32_t id, uint32_t ctrl, uint32_t data)
target/microblaze/meson.build +1 -1
index 94c76de39bd..add3e6ca9f9 100644
@@ -4,13 +4,13 @@ microblaze_common_ss = ss.source_set()
 microblaze_common_ss.add(files(
   'gdbstub.c',
   'helper.c',
+  'op_helper.c',
 ))
 
 microblaze_ss = ss.source_set()
 microblaze_ss.add(gen)
 microblaze_ss.add(files(
   'cpu.c',
-  'op_helper.c',
   'translate.c',
 ))
 
Signature · 1 line
2.53.0
Reviewed-by on v1 6/9
#14 lore raw

Re: [PATCH 6/9] target/microblaze: Compile op_helper.c as common unit

Quoted 8 lines · Philippe Mathieu-Daudé

In order do build op_helper.c as a common unit we simply need to use the common version of "accel/tcg/cpu-ldst.h".

---
  target/microblaze/op_helper.c | 2 +-
  target/microblaze/meson.build | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)

r~

#15 lore raw

PATCH 7/9 target/microblaze: Compile cpu.c as common unit

In reply to Philippe Mathieu-Daudé

In order do build cpu.c as a common unit we simply need to use the common version of "accel/tcg/cpu-ldst.h".

---
 target/microblaze/cpu.c       | 2 +-
 target/microblaze/meson.build | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
target/microblaze/cpu.c +1 -1
index 639f46b525e..04d31536888 100644
@@ -27,7 +27,7 @@
 #include "cpu.h"
 #include "qemu/module.h"
 #include "hw/core/qdev-properties.h"
-#include "accel/tcg/cpu-ldst.h"
+#include "accel/tcg/cpu-ldst-common.h"
 #include "exec/gdbstub.h"
 #include "exec/translation-block.h"
 #include "fpu/softfloat-helpers.h"
target/microblaze/meson.build +1 -1
index add3e6ca9f9..2ce50f35397 100644
@@ -2,6 +2,7 @@ gen = decodetree.process('insns.decode')
 
 microblaze_common_ss = ss.source_set()
 microblaze_common_ss.add(files(
+  'cpu.c',
   'gdbstub.c',
   'helper.c',
   'op_helper.c',
@@ -10,7 +11,6 @@ microblaze_common_ss.add(files(
 microblaze_ss = ss.source_set()
 microblaze_ss.add(gen)
 microblaze_ss.add(files(
-  'cpu.c',
   'translate.c',
 ))
 
Signature · 1 line
2.53.0
Reviewed-by on v1 7/9
#16 lore raw

Re: [PATCH 7/9] target/microblaze: Compile cpu.c as common unit

Quoted 8 lines · Philippe Mathieu-Daudé

In order do build cpu.c as a common unit we simply need to use the common version of "accel/tcg/cpu-ldst.h".

---
  target/microblaze/cpu.c       | 2 +-
  target/microblaze/meson.build | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)

r~

#17 lore raw

PATCH 8/9 target/microblaze: Include missing cpu-mmu-index.h header in translate.c

In reply to Philippe Mathieu-Daudé

translate.c calls cpu_mmu_index(), itself defined in "accel/tcg/cpu-mmu-index.h". This header is pulled in indirectly via "accel/tcg/cpu-ldst.h", but since we'll remove the latter in the next commit, make the inclusion explicit, otherwise we'd get:

../target/microblaze/translate.c:1620:21: error: call to undeclared function 'cpu_mmu_index'
1620 | dc->mem_index = cpu_mmu_index(cs, false);
| ^

---
 target/microblaze/translate.c | 1 +
 1 file changed, 1 insertion(+)
target/microblaze/translate.c +1 -0
index af6a30b7760..6321b739ab4 100644
@@ -21,6 +21,7 @@
 #include "qemu/osdep.h"
 #include "cpu.h"
 #include "accel/tcg/cpu-ldst.h"
+#include "accel/tcg/cpu-mmu-index.h"
 #include "tcg/tcg-op.h"
 #include "exec/helper-proto.h"
 #include "exec/helper-gen.h"
Signature · 1 line
2.53.0
Reviewed-by on v1 8/9
#18 lore raw

Re: [PATCH 8/9] target/microblaze: Include missing cpu-mmu-index.h header in translate.c

Quoted 6 lines · Philippe Mathieu-Daudé

translate.c calls cpu_mmu_index(), itself defined in "accel/tcg/cpu-mmu-index.h". This header is pulled in indirectly via "accel/tcg/cpu-ldst.h", but since we'll remove the latter in the next commit, make the inclusion explicit, otherwise we'd get:

Quoted 8 lines

../target/microblaze/translate.c:1620:21: error: call to undeclared function 'cpu_mmu_index'

    1620 |     dc->mem_index = cpu_mmu_index(cs, false);
         |                     ^
---
  target/microblaze/translate.c | 1 +
  1 file changed, 1 insertion(+)

Another solution would be to expose mb_cpu_mmu_index. Anyway,

r~

Quoted 13 lines
target/microblaze/translate.c +1 -0
index af6a30b7760..6321b739ab4 100644
@@ -21,6 +21,7 @@
  #include "qemu/osdep.h"
  #include "cpu.h"
  #include "accel/tcg/cpu-ldst.h"
+#include "accel/tcg/cpu-mmu-index.h"
  #include "tcg/tcg-op.h"
  #include "exec/helper-proto.h"
  #include "exec/helper-gen.h"
#19 lore raw

PATCH 9/9 target/microblaze: Compile translate.c as common unit

In reply to Philippe Mathieu-Daudé

In order do build translate.c as a common unit we need to replace:

"accel/tcg/cpu-ldst.h" -> "accel/tcg/cpu-ldst-common.h"

and:

  #include "tcg/tcg-op.h" -> #include "tcg/tcg-op-common.h"
                          -> #include "tcg/tcg-op-mem.h"

taking care to define TCG_ADDRESS_BITS, which is fixed for these 32-bit targets.

Remove the now empty microblaze_ss[] source set.

---
 target/microblaze/translate.c | 6 ++++--
 target/microblaze/meson.build | 7 +------
 2 files changed, 5 insertions(+), 8 deletions(-)
target/microblaze/translate.c +4 -2
index 6321b739ab4..f973c392aa2 100644
@@ -20,9 +20,11 @@
 
 #include "qemu/osdep.h"
 #include "cpu.h"
-#include "accel/tcg/cpu-ldst.h"
+#include "accel/tcg/cpu-ldst-common.h"
 #include "accel/tcg/cpu-mmu-index.h"
-#include "tcg/tcg-op.h"
+#define TCG_ADDRESS_BITS 32
+#include "tcg/tcg-op-common.h"
+#include "tcg/tcg-op-mem.h"
 #include "exec/helper-proto.h"
 #include "exec/helper-gen.h"
 #include "exec/translator.h"
target/microblaze/meson.build +1 -6
index 2ce50f35397..9c1ecd1cf1c 100644
@@ -1,16 +1,12 @@
 gen = decodetree.process('insns.decode')
 
 microblaze_common_ss = ss.source_set()
+microblaze_common_ss.add(gen)
 microblaze_common_ss.add(files(
   'cpu.c',
   'gdbstub.c',
   'helper.c',
   'op_helper.c',
-))
-
-microblaze_ss = ss.source_set()
-microblaze_ss.add(gen)
-microblaze_ss.add(files(
   'translate.c',
 ))
 
@@ -26,7 +22,6 @@ microblaze_system_ss.add(files(
   'machine.c',
 ))
 
-target_arch += {'microblaze': microblaze_ss}
 target_user_arch += {'microblaze': microblaze_user_ss}
 target_system_arch += {'microblaze': microblaze_system_ss}
 target_common_system_arch += {'microblaze': microblaze_common_system_ss}
Signature · 1 line
2.53.0
Reviewed-by on v1 9/9
#20 lore raw

Re: [PATCH 9/9] target/microblaze: Compile translate.c as common unit

Quoted 13 lines · Philippe Mathieu-Daudé

In order do build translate.c as a common unit we need to replace:

   "accel/tcg/cpu-ldst.h" -> "accel/tcg/cpu-ldst-common.h"

and:

   #include "tcg/tcg-op.h" -> #include "tcg/tcg-op-common.h"
                           -> #include "tcg/tcg-op-mem.h"

taking care to define TCG_ADDRESS_BITS, which is fixed for these 32-bit targets.

Quoted 7 lines

Remove the now empty microblaze_ss[] source set.

---
  target/microblaze/translate.c | 6 ++++--
  target/microblaze/meson.build | 7 +------
  2 files changed, 5 insertions(+), 8 deletions(-)

r~

Reviewed-by on the v1 series
#21 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 17 lines · Philippe Mathieu-Daudé

Compiling target/microblaze/ is now almost trivial.

The first 2 patches should be backported to the stable release IMO.

Philippe Mathieu-Daudé (9):
tcg: Include missing 'tcg/tcg-op-common.h' header in 'tcg-op-mem.h' target/microblaze: Fix endianness used to disassemble target/microblaze: Replace translator_ldl_swap() ->
translator_ldl_end()
target/microblaze: Introduce common system/user meson source set target/microblaze: Compile helper.c as common unit target/microblaze: Compile op_helper.c as common unit target/microblaze: Compile cpu.c as common unit target/microblaze: Include missing cpu-mmu-index.h header in
translate.c
target/microblaze: Compile translate.c as common unit

Quoted 8 lines
  include/tcg/tcg-op-mem.h      |  2 ++
  target/microblaze/cpu.h       |  7 -------
  target/microblaze/cpu.c       |  6 +++---
  target/microblaze/op_helper.c |  2 +-
  target/microblaze/translate.c | 11 +++++++----
  target/microblaze/meson.build | 12 ++++++------
  6 files changed, 19 insertions(+), 21 deletions(-)

Great!

For series:

#22 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 4 lines · Philippe Mathieu-Daudé

Philippe Mathieu-Daudé (9):
tcg: Include missing 'tcg/tcg-op-common.h' header in 'tcg-op-mem.h' target/microblaze: Fix endianness used to disassemble target/microblaze: Replace translator_ldl_swap() ->

Quoted 8 lines

translator_ldl_end()
target/microblaze: Introduce common system/user meson source set target/microblaze: Compile helper.c as common unit target/microblaze: Compile op_helper.c as common unit target/microblaze: Compile cpu.c as common unit target/microblaze: Include missing cpu-mmu-index.h header in
translate.c
target/microblaze: Compile translate.c as common unit

Series queued, thanks.