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 <a...@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?

//Anton

Reply via email to