[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 6/9] target-ppc: add lxvh8x instruction
From: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [PATCH v4 6/9] target-ppc: add lxvh8x instruction |
Date: |
Wed, 28 Sep 2016 09:12:29 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 |
On 09/27/2016 10:31 PM, Nikunj A Dadhania wrote:
> +DEF_HELPER_1(bswap16x4, i64, i64)
DEF_HELPER_FLAGS_1(bswap16x4, TCG_CALL_NO_RWG_SE, i64, i64)
> + uint64_t m = 0x00ff00ff00ff00ffull;
> + return ((x & m) << 8) | ((x >> 8) & m);
... although I suppose this is only 5 instructions, and could reasonably be
done inline too. Especially if you shared the one 64-bit constant across the
two bswaps.
> + if (ctx->le_mode) {
> + tcg_gen_qemu_ld_i64(xth, EA, ctx->mem_idx, MO_BEQ);
> + gen_helper_bswap16x4(xth, xth);
> + tcg_gen_addi_tl(EA, EA, 8);
> + tcg_gen_qemu_ld_i64(xtl, EA, ctx->mem_idx, MO_BEQ);
> + gen_helper_bswap16x4(xtl, xtl);
> + } else {
> + tcg_gen_qemu_ld_i64(xth, EA, ctx->mem_idx, MO_BEQ);
> + tcg_gen_addi_tl(EA, EA, 8);
> + tcg_gen_qemu_ld_i64(xtl, EA, ctx->mem_idx, MO_BEQ);
> + }
Better to not duplicate this.
tcg_gen_qemu_ld_i64(xth, EA, ctx->mem_idx, MO_BEQ);
tcg_gen_addi_tl(EA, EA, 8);
tcg_gen_qemu_ld_i64(xtl, EA, ctx->mem_idx, MO_BEQ);
if (ctx->le_mode) {
gen_helper_bswap16x4(xth, xth);
gen_helper_bswap16x4(xtl, xtl);
}
r~
- Re: [Qemu-devel] [PATCH v4 3/9] target-ppc: Implement mtvsrws instruction, (continued)
- [Qemu-devel] [PATCH v4 5/9] target-ppc: improve stxvw4x implementation, Nikunj A Dadhania, 2016/09/28
- [Qemu-devel] [PATCH v4 8/9] target-ppc: add lxvb16x instruction, Nikunj A Dadhania, 2016/09/28
- [Qemu-devel] [PATCH v4 7/9] target-ppc: add stxvh8x instruction, Nikunj A Dadhania, 2016/09/28
- [Qemu-devel] [PATCH v4 9/9] target-ppc: add stxvb16x instruction, Nikunj A Dadhania, 2016/09/28
- [Qemu-devel] [PATCH v4 6/9] target-ppc: add lxvh8x instruction, Nikunj A Dadhania, 2016/09/28
- Re: [Qemu-devel] [PATCH v4 6/9] target-ppc: add lxvh8x instruction,
Richard Henderson <=
- Re: [Qemu-devel] [PATCH v4 0/9] POWER9 TCG enablements - part4, Nikunj A Dadhania, 2016/09/28
- Re: [Qemu-devel] [Qemu-ppc] [PATCH v4 0/9] POWER9 TCG enablements - part4, Thomas Huth, 2016/09/28