[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 3/6] target/ppc: rework vmul{e, o}{s, u}{b, h, w
From: |
Mark Cave-Ayland |
Subject: |
Re: [Qemu-devel] [PATCH 3/6] target/ppc: rework vmul{e, o}{s, u}{b, h, w} instructions to use Vsr* macros |
Date: |
Fri, 28 Dec 2018 13:46:23 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 |
On 25/12/2018 20:11, Richard Henderson wrote:
> On 12/23/18 10:38 PM, Mark Cave-Ayland wrote:
>> -#define VMUL_DO(name, mul_element, prod_element, cast, evenp) \
>> +#define VMUL_DO_EVN(name, mul_element, mul_access, prod_access, cast) \
>> void helper_v##name(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \
>> { \
>> int i; \
>> \
>> + for (i = 0; i < ARRAY_SIZE(r->mul_element); i += 2) { \
>> + r->prod_access(i >> 1) = (cast)a->mul_access(i) * \
>> + (cast)b->mul_access(i); \
>> + } \
>> + }
>> +
>> +#define VMUL_DO_ODD(name, mul_element, mul_access, prod_access, cast) \
>> + void helper_v##name(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \
>> + { \
>> + int i; \
>> + \
>> + for (i = 0; i < ARRAY_SIZE(r->mul_element); i += 2) { \
>> + r->prod_access(i >> 1) = (cast)a->mul_access(i + 1) * \
>> + (cast)b->mul_access(i + 1); \
>> } \
>> }
>
> FWIW,
>
> for (i = odd; i < ARRAY_SIZE; i += 2) {
> r->pacc(i >> 1) = (cast)a->macc(i) * b->macc(i);
> }
>
> is sufficient to unify these two. But what you have isn't wrong.
>
> Reviewed-by: Richard Henderson <address@hidden>
Ah indeed that's quite neat! Thinking about it for a few days, I've decided to
leave
it as-is for now, since it was useful to be able to test the odd/even variants
separately (as they were often used together in testing) and it's just that
tiny bit
easier to relate to the ISA documentation.
ATB,
Mark.
- [Qemu-devel] [PATCH 0/6] target/ppc: remove various endian hacks from int_helper.c, Mark Cave-Ayland, 2018/12/23
- [Qemu-devel] [PATCH 3/6] target/ppc: rework vmul{e, o}{s, u}{b, h, w} instructions to use Vsr* macros, Mark Cave-Ayland, 2018/12/23
- Re: [Qemu-devel] [PATCH 3/6] target/ppc: rework vmul{e, o}{s, u}{b, h, w} instructions to use Vsr* macros, Richard Henderson, 2018/12/25
- Re: [Qemu-devel] [PATCH 3/6] target/ppc: rework vmul{e, o}{s, u}{b, h, w} instructions to use Vsr* macros,
Mark Cave-Ayland <=
- [Qemu-devel] [PATCH 1/6] target/ppc: implement complete set of Vsr* macros, Mark Cave-Ayland, 2018/12/23
- [Qemu-devel] [PATCH 4/6] target/ppc: eliminate use of HI_IDX and LO_IDX macros from int_helper.c, Mark Cave-Ayland, 2018/12/23
- [Qemu-devel] [PATCH 6/6] target/ppc: remove various HOST_WORDS_BIGENDIAN hacks in int_helper.c, Mark Cave-Ayland, 2018/12/23
- [Qemu-devel] [PATCH 5/6] target/ppc: eliminate use of EL_IDX macros from int_helper.c, Mark Cave-Ayland, 2018/12/23
- [Qemu-devel] [PATCH 2/6] target/ppc: rework vmrg{l, h}{b, h, w} instructions to use Vsr* macros, Mark Cave-Ayland, 2018/12/23