qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 47/65] target/hppa: Remove TARGET_REGISTER_BITS


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v2 47/65] target/hppa: Remove TARGET_REGISTER_BITS
Date: Fri, 20 Oct 2023 23:31:13 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.15.1

Hi Richard,

On 20/10/23 22:43, Richard Henderson wrote:
Rely only on TARGET_LONG_BITS, fixed at 64, and hppa_is_pa20.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
  target/hppa/cpu-param.h  |   1 -
  target/hppa/cpu.h        |  50 ++++-------
  target/hppa/helper.h     |  49 +++++------
  target/hppa/cpu.c        |   2 +-
  target/hppa/helper.c     |  34 +++-----
  target/hppa/int_helper.c |  17 ++--
  target/hppa/machine.c    |   9 --
  target/hppa/mem_helper.c |  10 +--
  target/hppa/op_helper.c  |  30 +++----
  target/hppa/sys_helper.c |   4 +-
  target/hppa/translate.c  | 184 ++++++++-------------------------------
  11 files changed, 119 insertions(+), 271 deletions(-)

A bit tedious to review, but very nice!

diff --git a/target/hppa/machine.c b/target/hppa/machine.c
index 0c0bba68c0..ab34b72910 100644
--- a/target/hppa/machine.c
+++ b/target/hppa/machine.c
@@ -21,21 +21,12 @@
  #include "cpu.h"
  #include "migration/cpu.h"
-#if TARGET_REGISTER_BITS == 64
  #define qemu_put_betr   qemu_put_be64
  #define qemu_get_betr   qemu_get_be64
  #define VMSTATE_UINTTR_V(_f, _s, _v) \
      VMSTATE_UINT64_V(_f, _s, _v)
  #define VMSTATE_UINTTR_ARRAY_V(_f, _s, _n, _v) \
      VMSTATE_UINT64_ARRAY_V(_f, _s, _n, _v)

Total 6 uses, let's use in place, removing the
definitions.

-#else
-#define qemu_put_betr   qemu_put_be32
-#define qemu_get_betr   qemu_get_be32
-#define VMSTATE_UINTTR_V(_f, _s, _v) \
-    VMSTATE_UINT32_V(_f, _s, _v)
-#define VMSTATE_UINTTR_ARRAY_V(_f, _s, _n, _v) \
-    VMSTATE_UINT32_ARRAY_V(_f, _s, _n, _v)
-#endif

IIUC for TARGET_REGISTER_BITS == 32 we need:

-- >8 --
 static const VMStateDescription vmstate_env = {
     .name = "env",
-    .version_id = 1,
-    .minimum_version_id = 1,
+    .version_id = 2,
+    .minimum_version_id = 2,
     .fields = vmstate_env_fields,
 };
---

(or better, keeping back-compat).

But to simplify I'd do it generically, regardless
of TARGET_REGISTER_BITS.

Regards,

Phil.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]