[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [Qemu-devel] [PATCH 24/28] target-ppc: Altivec 2.07: Vect
From: |
Richard Henderson |
Subject: |
Re: [Qemu-ppc] [Qemu-devel] [PATCH 24/28] target-ppc: Altivec 2.07: Vector Polynomial Multiply Sum |
Date: |
Mon, 24 Feb 2014 10:11:05 -0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 |
On 02/12/2014 01:23 PM, Tom Musta wrote:
> +#define PMSUM(name, srcfld, trgfld, trgtyp) \
> +void helper_##name(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \
> +{ \
> + int i, j; \
> + trgtyp prod[sizeof(ppc_avr_t)/sizeof(a->srcfld[0])]; \
> + \
> + VECTOR_FOR_INORDER_I(i, srcfld) { \
> + prod[i] = 0; \
> + for (j = 0; j < sizeof(a->srcfld[0]) * 8; j++) { \
> + if (a->srcfld[i] & (1ull<<j)) { \
> + prod[i] ^= ((trgtyp)b->srcfld[i] << j); \
> + } \
> + } \
> + } \
> + \
> + VECTOR_FOR_INORDER_I(i, trgfld) { \
> + r->trgfld[i] = prod[2*i] ^ prod[2*i+1]; \
> + } \
> +}
> +
> +PMSUM(vpmsumb, u8, u16, uint16_t)
> +PMSUM(vpmsumh, u16, u32, uint32_t)
> +PMSUM(vpmsumw, u32, u64, uint64_t)
Given that we've now got three targets actually implementing poly multiply
(four if anyone ever gets around to implementing the sparc64-2011 insn),
perhaps it's time to implement this generically?
Perhaps declared in host-utils.c and implemented in util/?
Cleanup for another patchset, of course.
r~
- [Qemu-ppc] [PATCH 14/28] target-ppc: Altivec 2.07: Vector Min/Max Doubleword Instructions, (continued)
- [Qemu-ppc] [PATCH 14/28] target-ppc: Altivec 2.07: Vector Min/Max Doubleword Instructions, Tom Musta, 2014/02/12
- [Qemu-ppc] [PATCH 15/28] target-ppc: Altivec 2.07: Pack Doubleword Instructions, Tom Musta, 2014/02/12
- [Qemu-ppc] [PATCH 17/28] target-ppc: Altivec 2.07: Vector Merge Instructions, Tom Musta, 2014/02/12
- [Qemu-ppc] [PATCH 16/28] target-ppc: Altivec 2.07: Unpack Signed Word Instructions, Tom Musta, 2014/02/12
- [Qemu-ppc] [PATCH 20/28] target-ppc: Altivec 2.07: Quadword Addition and Subtracation, Tom Musta, 2014/02/12
- [Qemu-ppc] [PATCH 21/28] target-ppc: Altivec 2.07: vbpermq Instruction, Tom Musta, 2014/02/12
- [Qemu-ppc] [PATCH 22/28] target-ppc: Altivec 2.07: Doubleword Compares, Tom Musta, 2014/02/12
- [Qemu-ppc] [PATCH 23/28] target-ppc: Altivec 2.07: Vector Gather Bits by Bytes, Tom Musta, 2014/02/12
- [Qemu-ppc] [PATCH 24/28] target-ppc: Altivec 2.07: Vector Polynomial Multiply Sum, Tom Musta, 2014/02/12
- Re: [Qemu-ppc] [Qemu-devel] [PATCH 24/28] target-ppc: Altivec 2.07: Vector Polynomial Multiply Sum,
Richard Henderson <=
- [Qemu-ppc] [PATCH 25/28] target-ppc: Altivec 2.07: Binary Coded Decimal Instructions, Tom Musta, 2014/02/12
- [Qemu-ppc] [PATCH 26/28] target-ppc: Altivec 2.07: AES Instructions, Tom Musta, 2014/02/12
[Qemu-ppc] [PATCH 27/28] target-ppc: Altivec 2.07: Vector SHA Sigma Instructions, Tom Musta, 2014/02/12
[Qemu-ppc] [PATCH 28/28] target-ppc: Altivec 2.07: Vector Permute and Exclusive OR, Tom Musta, 2014/02/12