target/m68k: Inline translator_ld[uw,l,q]() calls
PATCH 1/1 target/m68k: Inline translator_ld[uw,l,q]() calls
In preparation of removing the translator_ld[uw,l,q]() methods, inline them for the m68k target, expanding MO_TE -> MO_BE since this architecture is only available in big endianness.
Mechanical change using the following Coccinelle 'spatch' script:
@@
expression env, db, pc, do_swap;
@@
(
- translator_lduw(env, db, pc)
+ translator_lduw_end(env, db, pc, MO_BE)
|
- translator_ldl(env, db, pc)
+ translator_ldl_end(env, db, pc, MO_BE)
|
- translator_ldq(env, db, pc)
+ translator_ldq_end(env, db, pc, MO_BE)
)--- target/m68k/translate.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
target/m68k/translate.c +3 -3
@@ -347,7 +347,7 @@ static TCGv gen_ldst(DisasContext *s, int opsize, TCGv addr, TCGv val,static inline uint16_t read_im16 (CPUM68KState *env,DisasContext *s) {uint16_t im; - im =translator_lduw (env, &s->base, s->pc); + im =translator_lduw_end (env, &s->base, s->pc,MO_BE ); s->pc +=2 ;return im; }
@@ -1412,12 +1412,12 @@ static bool semihosting_test(DisasContext *s)if (s->pc %4 !=0 ) {return false; } - test =translator_lduw (s->env, &s->base, s->pc -4 ); + test =translator_lduw_end (s->env, &s->base, s->pc -4 ,MO_BE );if (test !=0x4e71 ) {return false; }/* "... and followed by an invalid sentinel instruction movec %sp,0." */ - test =translator_ldl (s->env, &s->base, s->pc); + test =translator_ldl_end (s->env, &s->base, s->pc,MO_BE );if (test !=0x4e7bf000 ) {return false; }
Signature · 1 line
2.52.0
Quoted 20 lines · Philippe Mathieu-Daudé
In preparation of removing the translator_ld[uw,l,q]() methods, inline them for the m68k target, expanding
MO_TE->MO_BEsince this architecture is only available in big endianness.Mechanical change using the following Coccinelle 'spatch' script:
@@ expression env, db, pc, do_swap; @@ ( - translator_lduw(env, db, pc) + translator_lduw_end(env, db, pc, MO_BE) | - translator_ldl(env, db, pc) + translator_ldl_end(env, db, pc, MO_BE) | - translator_ldq(env, db, pc) + translator_ldq_end(env, db, pc, MO_BE) )
Quoted 4 lines
Signed-off-by Philippe Mathieu-Daudé<[email protected]>--- target/m68k/translate.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
r~
Le 02/02/2026 à 22:40, Philippe Mathieu-Daudé a écrit :
Quoted 43 lines
In preparation of removing the translator_ld[uw,l,q]() methods, inline them for the m68k target, expanding
MO_TE->MO_BEsince this architecture is only available in big endianness.Mechanical change using the following Coccinelle 'spatch' script:
@@ expression env, db, pc, do_swap; @@ ( - translator_lduw(env, db, pc) + translator_lduw_end(env, db, pc, MO_BE) | - translator_ldl(env, db, pc) + translator_ldl_end(env, db, pc, MO_BE) | - translator_ldq(env, db, pc) + translator_ldq_end(env, db, pc, MO_BE) )Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/m68k/translate.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)target/m68k/translate.c +1
-2@@ -347,7 +347,7 @@ static TCGv gen_ldst(DisasContext *s, int opsize, TCGv addr, TCGv val,static inline uint16_t read_im16 (CPUM68KState *env,DisasContext *s) {uint16_t im; - im =translator_lduw (env, &s->base, s->pc); + im =translator_lduw_end (env, &s->base, s->pc,MO_BE ); s->pc +=2 ;return im; }@@ -1412,12 +1412,12 @@ static bool semihosting_test(DisasContext *s)if (s->pc %4 !=0 ) {return false; } - test =translator_lduw (s->env, &s->base, s->pc -4 );
target/m68k/translate.c static bool semihosting_test(DisasContext *s) · line 1423
Quoted 10 lines
target/m68k/translate.c +2
-1+ test =translator_lduw_end (s->env, &s->base, s->pc -4 ,MO_BE );if (test !=0x4e71 ) {return false; }/* "... and followed by an invalid sentinel instruction movec %sp,0." */ - test =translator_ldl (s->env, &s->base, s->pc); + test =translator_ldl_end (s->env, &s->base, s->pc,MO_BE );if (test !=0x4e7bf000 ) {return false; }
Quoted 20 lines · Philippe Mathieu-Daudé
In preparation of removing the translator_ld[uw,l,q]() methods, inline them for the m68k target, expanding
MO_TE->MO_BEsince this architecture is only available in big endianness.Mechanical change using the following Coccinelle 'spatch' script:
@@ expression env, db, pc, do_swap; @@ ( - translator_lduw(env, db, pc) + translator_lduw_end(env, db, pc, MO_BE) | - translator_ldl(env, db, pc) + translator_ldl_end(env, db, pc, MO_BE) | - translator_ldq(env, db, pc) + translator_ldq_end(env, db, pc, MO_BE) )
Quoted 4 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/m68k/translate.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Patch queued, thanks.