m68k: implement movep instruction
PATCH v2 1/1 m68k: implement movep instruction
This patch implements movep instruction. It moves data between a data register and alternate bytes within the address space starting at the location specified and incrementing by two.
It was designed for the original 68000 and used in firmwares for interfacing the 8-bit peripherals through the 16-bit data bus. Without this patch opcode for this instruction is recognized as some bitop.
--
v2: - disabled movep for Coldfire
- fixed gen_store/load usage
--- target/m68k/cpu.c | 3 +++ target/m68k/cpu.h | 1 + target/m68k/translate.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+)
target/m68k/cpu.c +3 -0
@@ -113,6 +113,7 @@ static void m68000_cpu_initfn(Object *obj)m68k_set_feature (env,M68K_FEATURE_M68000 );m68k_set_feature (env,M68K_FEATURE_USP );m68k_set_feature (env,M68K_FEATURE_WORD_INDEX ); +m68k_set_feature (env,M68K_FEATURE_MOVEP ); }static void m68020_cpu_initfn (Object *obj)
@@ -135,6 +136,7 @@ static void m68020_cpu_initfn(Object *obj)m68k_set_feature (env,M68K_FEATURE_BKPT );m68k_set_feature (env,M68K_FEATURE_RTD );m68k_set_feature (env,M68K_FEATURE_CHK2 ); +m68k_set_feature (env,M68K_FEATURE_MOVEP ); }#define m68030_cpu_initfn m68020_cpu_initfn
@@ -145,6 +147,7 @@ static void m68040_cpu_initfn(Object *obj)m68020_cpu_initfn (obj);m68k_set_feature (env,M68K_FEATURE_M68040 ); +m68k_set_feature (env,M68K_FEATURE_MOVEP ); }static void m68060_cpu_initfn (Object *obj)
target/m68k/cpu.h +1 -0
@@ -492,6 +492,7 @@ enum m68k_features {M68K_FEATURE_RTD ,M68K_FEATURE_CHK2 ,M68K_FEATURE_M68040 ,/* instructions specific to MC68040 */ + M68K_FEATURE_MOVEP, };static inline int m68k_feature (CPUM68KState *env,int feature)
target/m68k/translate.c +53 -0
68 lines not on this page · raw message
Le 06/02/2018 à 12:19, Pavel Dovgalyuk a écrit :
Quoted 42 lines
This patch implements movep instruction. It moves data between a data register and alternate bytes within the address space starting at the location specified and incrementing by two.
It was designed for the original 68000 and used in firmwares for interfacing the 8-bit peripherals through the 16-bit data bus. Without this patch opcode for this instruction is recognized as some bitop.
Signed-off-by Pavel Dovgalyuk <[email protected]>Signed-off-by Mihail Abakumov <[email protected]>--
v2: - disabled movep for Coldfire
- fixed gen_store/load usage--- target/m68k/cpu.c | 3 +++ target/m68k/cpu.h | 1 + target/m68k/translate.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+)target/m68k/cpu.c +2
-0@@ -113,6 +113,7 @@ static void m68000_cpu_initfn(Object *obj)m68k_set_feature (env,M68K_FEATURE_M68000 );m68k_set_feature (env,M68K_FEATURE_USP );m68k_set_feature (env,M68K_FEATURE_WORD_INDEX ); +m68k_set_feature (env,M68K_FEATURE_MOVEP ); }static void m68020_cpu_initfn (Object *obj)@@ -135,6 +136,7 @@ static void m68020_cpu_initfn(Object *obj)m68k_set_feature (env,M68K_FEATURE_BKPT );m68k_set_feature (env,M68K_FEATURE_RTD );m68k_set_feature (env,M68K_FEATURE_CHK2 ); +m68k_set_feature (env,M68K_FEATURE_MOVEP ); }#define m68030_cpu_initfn m68020_cpu_initfn
target/m68k/cpu.c static void m68040_cpu_initfn(Object *obj) · line 150
Quoted 4 lines
target/m68k/cpu.c +1
-0@@ -145,6 +147,7 @@ static void m68040_cpu_initfn(Object *obj)m68020_cpu_initfn (obj);m68k_set_feature (env,M68K_FEATURE_M68040 ); +m68k_set_feature (env,M68K_FEATURE_MOVEP );
You don't need to add it here as it comes with m68020_cpu_initfn().
Thanks,
Laurent