We can finally make translate.c common.

This is the only file using TCGv as well, so we need to set .tcgv_type
in arm_get_tb_cpu_state() accordingly, to not break bisection with this
series. Indeed, we will now have a different TCGv type at runtime when
calling gen_aa32_*_internal_*() compared to before for aarch64 targets.

Signed-off-by: Pierrick Bouvier <[email protected]>
---
 target/arm/tcg/hflags.c    | 1 +
 target/arm/tcg/translate.c | 1 +
 target/arm/tcg/meson.build | 7 ++++++-
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/target/arm/tcg/hflags.c b/target/arm/tcg/hflags.c
index 5c9b9bec3b2..2b06b75b581 100644
--- a/target/arm/tcg/hflags.c
+++ b/target/arm/tcg/hflags.c
@@ -693,5 +693,6 @@ TCGTBCPUState arm_get_tb_cpu_state(CPUState *cs)
         .pc = pc,
         .flags = flags.flags,
         .cs_base = flags.flags2,
+        .tcgv_type = is_a64(env) ? TCGV_TYPE_I64 : TCGV_TYPE_I32
     };
 }
diff --git a/target/arm/tcg/translate.c b/target/arm/tcg/translate.c
index 3cd05682ce8..1bd763025e8 100644
--- a/target/arm/tcg/translate.c
+++ b/target/arm/tcg/translate.c
@@ -20,6 +20,7 @@
  */
 #include "qemu/osdep.h"
 
+#define TARGET_ADDRESS_BITS 32
 #include "translate.h"
 #include "translate-a32.h"
 #include "qemu/log.h"
diff --git a/target/arm/tcg/meson.build b/target/arm/tcg/meson.build
index a2a636ef14a..9d50f8b5001 100644
--- a/target/arm/tcg/meson.build
+++ b/target/arm/tcg/meson.build
@@ -25,7 +25,6 @@ arm_ss.add(when: 'TARGET_AARCH64', if_false: 
files('stubs32.c'))
 
 arm_ss.add(files(
   'cpu32.c',
-  'translate.c',
   'm_helper.c',
   'mve_helper.c',
 ))
@@ -55,6 +54,10 @@ arm_common_ss.add(files(
 ))
 
 arm_common_system_ss.add(
+  decodetree.process('a32.decode', extra_args: '--static-decode=disas_a32'),
+  decodetree.process('a32-uncond.decode', extra_args: 
'--static-decode=disas_a32_uncond'),
+  decodetree.process('t32.decode', extra_args: '--static-decode=disas_t32'),
+  decodetree.process('t16.decode', extra_args: ['-w', '16', 
'--static-decode=disas_t16']),
   decodetree.process('vfp.decode', extra_args: '--decode=disas_vfp'),
   decodetree.process('vfp-uncond.decode', extra_args: 
'--decode=disas_vfp_uncond'),
   decodetree.process('mve.decode', extra_args: '--decode=disas_mve'),
@@ -71,6 +74,7 @@ arm_common_system_ss.add(
   'psci.c',
   'tlb_helper.c',
   'tlb-insns.c',
+  'translate.c',
   'translate-m-nocp.c',
   'translate-mve.c',
   'translate-neon.c',
@@ -84,6 +88,7 @@ arm_user_ss.add(files(
   'neon_helper.c',
   'op_helper.c',
   'tlb_helper.c',
+  'translate.c',
   'translate-m-nocp.c',
   'translate-mve.c',
   'translate-neon.c',
-- 
2.47.3


Reply via email to