qemu-devel
[Top][All Lists]
Advanced

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

Re: [RFC PATCH 27/34] accel/tcg: Make translate-all.c target independent


From: Richard Henderson
Subject: Re: [RFC PATCH 27/34] accel/tcg: Make translate-all.c target independent
Date: Tue, 18 Jun 2024 08:21:19 -0700
User-agent: Mozilla Thunderbird

On 6/13/24 02:50, Anton Johansson wrote:
On 24/01/24, Richard Henderson wrote:
On 1/20/24 00:40, Anton Johansson wrote:
Makes translate-all.c independent of softmmu target by switching

      TARGET_LONG_BITS        -> target_long_bits()

      TARGET_INSN_START_WORDS -> tcg_ctx->insn_start_words,
                                 target_insn_start_words(),

      TCG_GUEST_DEFAULT_MO    -> target_default_memory_order()

      MO_TE                   -> target_endian_memory_order()

Signed-off-by: Anton Johansson <anjo@rev.ng>
---
   accel/tcg/translate-all.c | 38 ++++++++++++++++++--------------------
   1 file changed, 18 insertions(+), 20 deletions(-)

diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
index 9c981d1750..a3ae0c6910 100644
--- a/accel/tcg/translate-all.c
+++ b/accel/tcg/translate-all.c
@@ -65,7 +65,6 @@
   #include "internal-common.h"
   #include "internal-target.h"
   #include "perf.h"
-#include "tcg/insn-start-words.h"
   TBContext tb_ctx;
@@ -106,7 +105,7 @@ static int64_t decode_sleb128(const uint8_t **pp)
           val |= (int64_t)(byte & 0x7f) << shift;
           shift += 7;
       } while (byte & 0x80);
-    if (shift < TARGET_LONG_BITS && (byte & 0x40)) {
+    if (shift < target_long_bits() && (byte & 0x40)) {

You just make TARGET_PAGE_SIZE etc target independent, right?
So you don't need this?  Or is this because of user-only still.

Hi, Richard!

I missed this piece of feedback previously.  I don't see how
TARGET_PAGE_[SIZE|BITS] would be used here.  Are the values we're
encoding always TARGET_PAGE_BITS in size?

I was obviously tired here, since they're obviously unrelated.

However in this case I think TARGET_LONG_BITS is a red herring, and we should be using int64_t not target_long at all, and thus the shift count must be less than 64.


r~




reply via email to

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