[PATCH] m68k: link.l is only available with 68020+

Laurent Vivier posted 1 patch 1 month, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20251227210250.411882-1-laurent@vivier.eu
Maintainers: Laurent Vivier <laurent@vivier.eu>
target/m68k/cpu.c       | 3 ++-
target/m68k/cpu.h       | 2 ++
target/m68k/translate.c | 2 +-
3 files changed, 5 insertions(+), 2 deletions(-)
[PATCH] m68k: link.l is only available with 68020+
Posted by Laurent Vivier 1 month, 1 week ago
Base 68000 only supports word size.

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 target/m68k/cpu.c       | 3 ++-
 target/m68k/cpu.h       | 2 ++
 target/m68k/translate.c | 2 +-
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c
index f1b673119d6b..b55e604b11d1 100644
--- a/target/m68k/cpu.c
+++ b/target/m68k/cpu.c
@@ -235,7 +235,7 @@ static void m68010_cpu_initfn(Object *obj)
 
 /*
  * Adds BFCHG, BFCLR, BFEXTS, BFEXTU, BFFFO, BFINS, BFSET, BFTST, CAS, CAS2,
- *      CHK2, CMP2, DIVSL, DIVUL, EXTB, PACK, TRAPcc, UNPK.
+ *      CHK2, CMP2, DIVSL, DIVUL, EXTB, LINKL, PACK, TRAPcc, UNPK.
  *
  * 68020/30 only:
  *      CALLM, cpBcc, cpDBcc, cpGEN, cpRESTORE, cpSAVE, cpScc, cpTRAPcc
@@ -260,6 +260,7 @@ static void m68020_cpu_initfn(Object *obj)
     m68k_set_feature(env, M68K_FEATURE_MSP);
     m68k_set_feature(env, M68K_FEATURE_UNALIGNED_DATA);
     m68k_set_feature(env, M68K_FEATURE_TRAPCC);
+    m68k_set_feature(env, M68K_FEATURE_LINKL);
 }
 
 /*
diff --git a/target/m68k/cpu.h b/target/m68k/cpu.h
index d9db6a486a80..7911ab9de30a 100644
--- a/target/m68k/cpu.h
+++ b/target/m68k/cpu.h
@@ -555,6 +555,8 @@ enum m68k_features {
     M68K_FEATURE_MOVEFROMSR_PRIV,
     /* Exception frame with format+vector (from 68010) */
     M68K_FEATURE_EXCEPTION_FORMAT_VEC,
+    /* LINK.L (680[2346]0, and CPU32) */
+    M68K_FEATURE_LINKL,
 };
 
 static inline bool m68k_feature(CPUM68KState *env, int feature)
diff --git a/target/m68k/translate.c b/target/m68k/translate.c
index eb1ba150745e..78efa3e597c4 100644
--- a/target/m68k/translate.c
+++ b/target/m68k/translate.c
@@ -5829,7 +5829,7 @@ void register_m68k_insns (CPUM68KState *env)
     BASE(move_to_sr, 46c0, ffc0);
 #endif
     INSN(nbcd,      4800, ffc0, M68K);
-    INSN(linkl,     4808, fff8, M68K);
+    INSN(linkl,     4808, fff8, LINKL);
     BASE(pea,       4840, ffc0);
     BASE(swap,      4840, fff8);
     INSN(bkpt,      4848, fff8, BKPT);
-- 
2.52.0
Re: [PATCH] m68k: link.l is only available with 68020+
Posted by Richard Henderson 1 month, 1 week ago
On 12/28/25 08:02, Laurent Vivier wrote:
> Base 68000 only supports word size.
> 
> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
> ---
>   target/m68k/cpu.c       | 3 ++-
>   target/m68k/cpu.h       | 2 ++
>   target/m68k/translate.c | 2 +-
>   3 files changed, 5 insertions(+), 2 deletions(-)
> 
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~
Re: [PATCH] m68k: link.l is only available with 68020+
Posted by William Hooper 1 month, 1 week ago
On Sat, 27 Dec 2025 at 22:02, Laurent Vivier <laurent@vivier.eu> wrote:
> Base 68000 only supports word size.
> 
> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
> ---
>  target/m68k/cpu.c       | 3 ++-
>  target/m68k/cpu.h       | 2 ++
>  target/m68k/translate.c | 2 +-
>  3 files changed, 5 insertions(+), 2 deletions(-)

Reviewed-by: William Hooper <wsh@wshooper.org>