qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v4 10/10] tcg-mips: Adjust qemu_ld/st for mips64


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH v4 10/10] tcg-mips: Adjust qemu_ld/st for mips64
Date: Wed, 30 Nov 2016 09:42:18 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0

On 11/30/2016 09:22 AM, Aurelien Jarno wrote:
> On 2016-11-29 14:07, Jin Guojie wrote:
>> @@ -1312,7 +1340,12 @@ static void tcg_out_qemu_ld_slow_path(TCGContext *s, 
>> TCGLabelQemuLdst *l)
>>      reloc_pc16(s->code_ptr, l->raddr);
>>      tcg_out_opc_br(s, OPC_BEQ, TCG_REG_ZERO, TCG_REG_ZERO);
>>      /* delay slot */
>> -    tcg_out_mov(s, TCG_TYPE_REG, v0, TCG_REG_V0);
>> +    if (TCG_TARGET_REG_BITS == 64 && l->type == TCG_TYPE_I32) {
>> +        /* we always sign-extend 32-bit loads */
>> +        tcg_out_opc_sa(s, OPC_SLL, v0, TCG_REG_V0, 0);
>> +    } else {
>> +        tcg_out_opc_reg(s, OPC_OR, v0, TCG_REG_V0, TCG_REG_ZERO);
>> +    }
> 
> While thoses are equivalent, I think it would be clearer to keep the
> original version for the else case (ie tcg_out_mov) instead of replacing
> it by a OR instruction.

Did we exclude v0 from the registers that can be used?
Otherwise we do need to ensure that some insn gets placed in the delay slot.

Perhaps it would be cleaner to have a tcg_out_mov_delay, which either (1) does
not contain the dest == src check, or (2) emits a nop in that case.  There are
4 or 5 other places that contain a comment and use OR directly.


r~




reply via email to

[Prev in Thread] Current Thread [Next in Thread]