[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 12/22] target-mips: add ALIGN, DALIGN, BITSWA
From: |
Leon Alrae |
Subject: |
Re: [Qemu-devel] [PATCH v2 12/22] target-mips: add ALIGN, DALIGN, BITSWAP and DBITSWAP instructions |
Date: |
Thu, 12 Jun 2014 09:35:41 +0100 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 |
On 11/06/2014 17:39, Richard Henderson wrote:
> On 06/11/2014 08:19 AM, Leon Alrae wrote:
>> * add missing zero register case
>
> What missing zero register case?
>
>> + if (rd == 0) {
>> + /* Treat as NOP. */
>> + break;
>> + }
>
> This is normally handled by gen_store_gpr...
>
>> + if (rt == 0) {
>> + tcg_gen_movi_tl(cpu_gpr[rd], 0);
>> + } else {
>> + gen_helper_dbitswap(cpu_gpr[rd], cpu_gpr[rt]);
>> + }
>> + break;
>
> ... and this is normally handed by gen_load_gpr.
>
> Open-coding these tests just clutters the code, making it harder to read.
> C.f.
> the 1500 lines removed during a cleanup of target-alpha for exactly this sort
> of thing.
Yes, it clutters the code a bit. However, by looking at the other
instructions I got the impression that preferable approach is to avoid
generating unnecessary code if we can. This seems to be sensible so I'm
trying to stick to it. So in bitswap example I think there is no point
in calling the helper if we know that the result will be 0.
Regards,
Leon
- [Qemu-devel] [PATCH v2 11/22] target-mips: Status.UX/SX/KX enable 32-bit address wrapping, (continued)
- [Qemu-devel] [PATCH v2 11/22] target-mips: Status.UX/SX/KX enable 32-bit address wrapping, Leon Alrae, 2014/06/11
- [Qemu-devel] [PATCH v2 09/22] target-mips: redefine Integer Multiply and Divide instructions, Leon Alrae, 2014/06/11
- [Qemu-devel] [PATCH v2 13/22] target-mips: add Compact Branches, Leon Alrae, 2014/06/11
- [Qemu-devel] [PATCH v2 12/22] target-mips: add ALIGN, DALIGN, BITSWAP and DBITSWAP instructions, Leon Alrae, 2014/06/11
- Re: [Qemu-devel] [PATCH v2 12/22] target-mips: add ALIGN, DALIGN, BITSWAP and DBITSWAP instructions, Aurelien Jarno, 2014/06/19
- [Qemu-devel] [PATCH v2 14/22] target-mips: add Addressing and PC-relative instructions, Leon Alrae, 2014/06/11
[Qemu-devel] [PATCH v2 18/22] target-mips: do not allow Status.FR=0 mode in 64-bit FPU, Leon Alrae, 2014/06/11