[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH RFC v4 01/12] target/rx: TCG translation
From: |
Yoshinori Sato |
Subject: |
Re: [Qemu-devel] [PATCH RFC v4 01/12] target/rx: TCG translation |
Date: |
Wed, 27 Mar 2019 22:25:34 +0900 |
User-agent: |
Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (Gojō) APEL/10.8 EasyPG/1.0.0 Emacs/25.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) |
On Tue, 26 Mar 2019 00:50:53 +0900,
Richard Henderson wrote:
>
> On 3/25/19 2:38 AM, Yoshinori Sato wrote:
> >>> +static bool trans_EMUL_mr(DisasContext *ctx, arg_EMUL_mr *a)
> >>> +{
> >>> + TCGv val, mem;
> >>> + mem = tcg_temp_new();
> >>> + val = rx_load_source(ctx, mem, a->ld, a->mi, a->rs);
> >>> + tcg_gen_muls2_i32(cpu_regs[a->rd], cpu_regs[a->rd + 1],
> >>> + cpu_regs[a->rd], val);
> >>
> >> Both of these need to check for rd == 15 and return false.
> >
> > Specifying 15 for rd does not result in an invalid instruction.
> > I made it to output a log.
>
> Does the hardware wrap around and modify R0, then?
> Whatever you do, you cannot allow the guest to read
> beyond the end of the cpu_regs array.
Sorry. When I tried again,
I had a wraparound to R0.
I also checked translate.c because I confirmed other undefined behavior.
> >>> + gen_set_label(l1);
> >>> + tcg_gen_movi_i32(cpu_psw_c, 0);
> >>> + tcg_gen_movi_i32(cpu_psw_o, 0);
> >>
> >> Likewise.
> >
> > As this is a two-operand, rd does not change when the shift count is zero.
>
> The insn may be two operand, but the arg structure is three operand. You have
> written the entire rest of the function as if rd is relevant. If you add the
> tcg_gen_mov_i32 you complete that illusion. However, there will be no mov
> issued, because tcg_gen_mov_i32 checks for dest == src.
>
>
> r~
>
--
Yosinori Sato
- Re: [Qemu-devel] [PATCH RFC v4 02/12] target/rx: TCG helper, (continued)
- [Qemu-devel] [PATCH RFC v4 07/12] hw/timer: RX62N internal timer modules, Yoshinori Sato, 2019/03/20
- [Qemu-devel] [PATCH RFC v4 08/12] hw/char: RX62N serical communication interface (SCI), Yoshinori Sato, 2019/03/20
- [Qemu-devel] [PATCH RFC v4 01/12] target/rx: TCG translation, Yoshinori Sato, 2019/03/20
- Re: [Qemu-devel] [PATCH RFC v4 01/12] target/rx: TCG translation, Richard Henderson, 2019/03/21
- Re: [Qemu-devel] [PATCH RFC v4 01/12] target/rx: TCG translation, Yoshinori Sato, 2019/03/25
- Re: [Qemu-devel] [PATCH RFC v4 01/12] target/rx: TCG translation, Richard Henderson, 2019/03/25
- Re: [Qemu-devel] [PATCH RFC v4 01/12] target/rx: TCG translation, Yoshinori Sato, 2019/03/26
- Re: [Qemu-devel] [PATCH RFC v4 01/12] target/rx: TCG translation,
Yoshinori Sato <=
Re: [Qemu-devel] [PATCH RFC v4 00/12] Add RX archtecture support, no-reply, 2019/03/20
[Qemu-devel] [PATCH RFC v5 00/12] Add RX archtecture support, Yoshinori Sato, 2019/03/25
- [Qemu-devel] [PATCH RFC v5 12/12] include/hw/regiserfields.h: Add 8bit and 16bit registers, Yoshinori Sato, 2019/03/25
- [Qemu-devel] [PATCH RFC v5 06/12] hw/intc: RX62N interrupt controller (ICUa), Yoshinori Sato, 2019/03/25
- [Qemu-devel] [PATCH RFC v5 05/12] target/rx: Miscellaneous files, Yoshinori Sato, 2019/03/25
- [Qemu-devel] [PATCH RFC v5 08/12] hw/char: RX62N serical communication interface (SCI), Yoshinori Sato, 2019/03/25
- [Qemu-devel] [PATCH RFC v5 09/12] hw/rx: RX Target hardware definition, Yoshinori Sato, 2019/03/25
- [Qemu-devel] [PATCH RFC v5 02/12] target/rx: TCG helper, Yoshinori Sato, 2019/03/25
- [Qemu-devel] [PATCH RFC v5 11/12] MAINTAINERS: Add RX, Yoshinori Sato, 2019/03/25
- [Qemu-devel] [PATCH RFC v5 04/12] target/rx: RX disassembler, Yoshinori Sato, 2019/03/25