[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v38 05/22] target/avr: Add instruction translation - Arithmet
From: |
Aleksandar Markovic |
Subject: |
Re: [PATCH v38 05/22] target/avr: Add instruction translation - Arithmetic and Logic Instructions |
Date: |
Tue, 10 Dec 2019 21:44:09 +0100 |
On Sun, Dec 8, 2019 at 7:40 PM Michael Rolnik <address@hidden> wrote:
> +
> +/*
> + * Performs the logical AND between the contents of register Rd and register
> + * Rr and places the result in the destination register Rd.
> + */
> +static bool trans_AND(DisasContext *ctx, arg_AND *a)
> +{
> + TCGv Rd = cpu_r[a->rd];
> + TCGv Rr = cpu_r[a->rr];
> + TCGv R = tcg_temp_new_i32();
> +
> + tcg_gen_and_tl(R, Rd, Rr); /* Rd = Rd and Rr */
> + tcg_gen_movi_tl(cpu_Vf, 0); /* Vf = 0 */
> + tcg_gen_setcondi_tl(TCG_COND_EQ, cpu_Zf, R, 0); /* Zf = R == 0 */
> + gen_ZNSf(R);
> + tcg_gen_mov_tl(Rd, R);
> +
> + tcg_temp_free_i32(R);
> +
> + return true;
> +}
> +
> +
In the v37 comment I suggested to you make "update status register"
portions more compact (but also to mark it with an one-line comment),
but you overdid it and extended this compacting all the way to the
main part of the handler. And now it is still hard to discern the core
of the handler ("and" operation) and the update-status-register
portion.
Yours,
Aleksandar
- Re: [PATCH v38 11/22] target/avr: Add instruction disassembly function, (continued)
- Re: [PATCH v38 11/22] target/avr: Add instruction disassembly function, Aleksandar Markovic, 2019/12/09
- Re: [PATCH v38 11/22] target/avr: Add instruction disassembly function, Michael Rolnik, 2019/12/10
- Re: [PATCH v38 11/22] target/avr: Add instruction disassembly function, Aleksandar Markovic, 2019/12/12
- Re: [PATCH v38 11/22] target/avr: Add instruction disassembly function, Michael Rolnik, 2019/12/17
- Re: [PATCH v38 11/22] target/avr: Add instruction disassembly function, Aleksandar Markovic, 2019/12/17
[PATCH v38 07/22] target/avr: Add instruction translation - Data Transfer Instructions, Michael Rolnik, 2019/12/08
[PATCH v38 12/22] target/avr: Add limited support for USART peripheral, Michael Rolnik, 2019/12/08
[PATCH v38 16/22] target/avr: Add section about AVR into QEMU documentation, Michael Rolnik, 2019/12/08
[PATCH v38 05/22] target/avr: Add instruction translation - Arithmetic and Logic Instructions, Michael Rolnik, 2019/12/08
- Re: [PATCH v38 05/22] target/avr: Add instruction translation - Arithmetic and Logic Instructions,
Aleksandar Markovic <=
[PATCH v38 08/22] target/avr: Add instruction translation - Bit and Bit-test Instructions, Michael Rolnik, 2019/12/08
[PATCH v38 18/22] target/avr: Add machine none test, Michael Rolnik, 2019/12/08
[PATCH v38 22/22] target/avr: Update MAINTAINERS file, Michael Rolnik, 2019/12/08
[PATCH v38 19/22] target/avr: Update build system, Michael Rolnik, 2019/12/08
[PATCH v38 20/22] target/avr: Add boot serial test, Michael Rolnik, 2019/12/08
[PATCH v38 13/22] target/avr: Add limited support for 16 bit timer peripheral, Michael Rolnik, 2019/12/08
[PATCH v38 14/22] target/avr: Add dummy mask device, Michael Rolnik, 2019/12/08