[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [PATCH 3/6] target/ppc: rework vmul{e, o}{s, u}{b, h, w}
From: |
Richard Henderson |
Subject: |
Re: [Qemu-ppc] [PATCH 3/6] target/ppc: rework vmul{e, o}{s, u}{b, h, w} instructions to use Vsr* macros |
Date: |
Wed, 26 Dec 2018 07:11:35 +1100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 |
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>
r~
- [Qemu-ppc] [PATCH 0/6] target/ppc: remove various endian hacks from int_helper.c, Mark Cave-Ayland, 2018/12/23
- [Qemu-ppc] [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-ppc] [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-ppc] [PATCH 3/6] target/ppc: rework vmul{e, o}{s, u}{b, h, w} instructions to use Vsr* macros,
Richard Henderson <=
- [Qemu-ppc] [PATCH 1/6] target/ppc: implement complete set of Vsr* macros, Mark Cave-Ayland, 2018/12/23
- [Qemu-ppc] [PATCH 5/6] target/ppc: eliminate use of EL_IDX macros from int_helper.c, Mark Cave-Ayland, 2018/12/23
- [Qemu-ppc] [PATCH 6/6] target/ppc: remove various HOST_WORDS_BIGENDIAN hacks in int_helper.c, Mark Cave-Ayland, 2018/12/23
- [Qemu-ppc] [PATCH 2/6] target/ppc: rework vmrg{l, h}{b, h, w} instructions to use Vsr* macros, Mark Cave-Ayland, 2018/12/23