|
From: | Richard Henderson |
Subject: | Re: [Qemu-ppc] [PATCH v5 2/5] target-ppc: add vector extract instructions |
Date: | Thu, 1 Sep 2016 09:08:57 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 |
On 08/31/2016 11:36 PM, Rajalakshmi Srinivasaraghavan wrote:
+#if defined(HOST_WORDS_BIGENDIAN) +#define VEXTRACT(suffix, element) \ + void helper_vextract##suffix(ppc_avr_t *r, ppc_avr_t *b, uint32_t index) \ + { \ + r->u64[0] = r->u64[1] = 0; \ + memmove(&r->u8[8 - sizeof(r->element)], &b->u8[index], \ + sizeof(r->element[0])); \
Again, you must consider R == B. I made this same comment wrt v2, when you still had a memcpy here.
This is trivial: (1) Use memmove to set first sizeof(r->element[0]) bytes, (2) Use memset 0 to clean last (16 - sizeof(r->element[0]) bytes. You have some test cases for these insns, don't you? r~
[Prev in Thread] | Current Thread | [Next in Thread] |