[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 08/13] tcg: Add opcodes for vector vmrgh inst
From: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [PATCH v4 08/13] tcg: Add opcodes for vector vmrgh instructions |
Date: |
Thu, 27 Jun 2019 13:35:12 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 |
On 6/27/19 12:56 PM, Stefan Brankovic wrote:
> +void HELPER(gvec_vmrgh8)(void *d, void *a, void *b, uint32_t desc)
> +{
> + intptr_t oprsz = simd_oprsz(desc);
> + intptr_t i;
> +
> + for (i = 0; i < (oprsz / 2); i += sizeof(uint8_t)) {
> + uint8_t aa = *(uint8_t *)(a + 8 * sizeof(uint8_t) + i);
> + uint8_t bb = *(uint8_t *)(b + 8 * sizeof(uint8_t) + i);
> + *(uint8_t *)(d + 2 * i) = bb;
> + *(uint8_t *)(d + 2 * i + sizeof(uint8_t)) = aa;
> + }
> + clear_high(d, oprsz, desc);
> +}
I tried this while developing the ARM SVE code.
The problem is that the vector element numbering differs for each host. So
while you may be able to get the correct results out of x86, you'll the the
wrong answers when you run this same code on a big-endian host.
The same goes for the INDEX_OP_vmrgh_vec opcode you introduced.
r~
- [Qemu-devel] [PATCH v4 03/13] target/ppc: Optimize emulation of vgbbd instruction, (continued)
- [Qemu-devel] [PATCH v4 03/13] target/ppc: Optimize emulation of vgbbd instruction, Stefan Brankovic, 2019/06/27
- [Qemu-devel] [PATCH v4 05/13] target/ppc: Optimize emulation of vclzw instruction, Stefan Brankovic, 2019/06/27
- [Qemu-devel] [PATCH v4 06/13] target/ppc: Optimize emulation of vclzh and vclzb instructions, Stefan Brankovic, 2019/06/27
- [Qemu-devel] [PATCH v4 09/13] tcg/i386: Implement vector vmrgh instructions, Stefan Brankovic, 2019/06/27
- [Qemu-devel] [PATCH v4 10/13] target/ppc: convert vmrgh instructions to vector operations, Stefan Brankovic, 2019/06/27
- [Qemu-devel] [PATCH v4 07/13] target/ppc: Refactor emulation of vmrgew and vmrgow instructions, Stefan Brankovic, 2019/06/27
- [Qemu-devel] [PATCH v4 11/13] tcg: Add opcodes for verctor vmrgl instructions, Stefan Brankovic, 2019/06/27
- [Qemu-devel] [PATCH v4 12/13] tcg/i386: Implement vector vmrgl instructions, Stefan Brankovic, 2019/06/27
- [Qemu-devel] [PATCH v4 13/13] target/ppc: convert vmrgl instructions to vector operations, Stefan Brankovic, 2019/06/27
- [Qemu-devel] [PATCH v4 08/13] tcg: Add opcodes for vector vmrgh instructions, Stefan Brankovic, 2019/06/27
- Re: [Qemu-devel] [PATCH v4 00/13] target/ppc, tcg, tcg/i386: Optimize emulation of some Altivec instructions, Howard Spoelstra, 2019/06/27