[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3] m68k: implement movep instruction
From: |
Laurent Vivier |
Subject: |
Re: [Qemu-devel] [PATCH v3] m68k: implement movep instruction |
Date: |
Tue, 6 Feb 2018 13:10:40 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 |
Le 06/02/2018 à 12:43, Pavel Dovgalyuk a écrit :
> 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 <address@hidden>
> Signed-off-by: Mihail Abakumov <address@hidden>
>
> --
>
> v3: - simplified movep function code
> - joined movep masks
>
> v2: - disabled movep for Coldfire
> - fixed gen_store/load usage
> ---
> target/m68k/cpu.c | 2 ++
> target/m68k/cpu.h | 1 +
> target/m68k/translate.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 49 insertions(+)
...
> + if (insn & 0x40) {
> + i = 4;
> + } else {
> + i = 2;
> + }
> +
> + if (insn & 0x80) {
> + for ( ; i > 0 ; i--) {
> + tcg_gen_shri_i32(dbuf, reg, (i - 1) * 8);
> + tcg_gen_qemu_st8(dbuf, abuf, IS_USER(s));
> + if (i > 1) {
> + tcg_gen_addi_i32(abuf, abuf, 2);
> + }
> + }
> + } else {
> + for ( ; i > 0 ; i--) {
> + tcg_gen_qemu_ld8u(dbuf, abuf, IS_USER(s));
> + tcg_gen_deposit_i32(reg, reg, dbuf, i * 8, 8);
it should be (i - 1).
Thanks,
Laurent