[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~
- [Qemu-devel] [PATCH v4 02/10] tcg-mips: Add mips64 opcodes, (continued)
- [Qemu-devel] [PATCH v4 02/10] tcg-mips: Add mips64 opcodes, Jin Guojie, 2016/11/29
- [Qemu-devel] [PATCH v4 04/10] tcg-mips: Add bswap32u and bswap64, Jin Guojie, 2016/11/29
- [Qemu-devel] [PATCH v4 09/10] tcg-mips: Adjust calling conventions for mips64, Jin Guojie, 2016/11/29
- [Qemu-devel] [PATCH v4 06/10] tcg-mips: Adjust load/store functions for mips64, Jin Guojie, 2016/11/29
- [Qemu-devel] [PATCH v4 08/10] tcg-mips: Add tcg unwind info, Jin Guojie, 2016/11/29
- [Qemu-devel] [PATCH v4 07/10] tcg-mips: Adjust prologue for mips64, Jin Guojie, 2016/11/29
- [Qemu-devel] [PATCH v4 01/10] tcg-mips: Move bswap code to a subroutine, Jin Guojie, 2016/11/29
- [Qemu-devel] [PATCH v4 03/10] tcg-mips: Support 64-bit opcodes, Jin Guojie, 2016/11/29
- [Qemu-devel] [PATCH v4 10/10] tcg-mips: Adjust qemu_ld/st for mips64, Jin Guojie, 2016/11/29
- Re: [Qemu-devel] [PATCH v4 00/10] tcg mips64 and mips r6 improvements, no-reply, 2016/11/29
- Re: [Qemu-devel] [PATCH v4 00/10] tcg mips64 and mips r6 improvements, Jin Guojie, 2016/11/30