This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH x86-64][BZ #20024] Fixed vector sincos/sincosf ABI
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Andrew Senkevich <andrew dot n dot senkevich at gmail dot com>
- Cc: Carlos O'Donell <carlos at redhat dot com>, libc-alpha <libc-alpha at sourceware dot org>
- Date: Wed, 29 Jun 2016 21:59:14 +0000
- Subject: Re: [PATCH x86-64][BZ #20024] Fixed vector sincos/sincosf ABI
- Authentication-results: sourceware.org; auth=none
- References: <CAMXFM3tO0RGFjbrQaEV80rTCWmUy8LQjkZ7gRd9j+Q3YQ2+nAQ at mail dot gmail dot com> <alpine dot DEB dot 2 dot 20 dot 1606022247540 dot 9542 at digraph dot polyomino dot org dot uk> <CAMXFM3vREvMPjBU23ZGV6eyNs-exwHGG6C2WE6N1MHf=CqbkvA at mail dot gmail dot com> <alpine dot DEB dot 2 dot 20 dot 1606061404540 dot 15183 at digraph dot polyomino dot org dot uk> <57560F10 dot 4040907 at redhat dot com> <CAMXFM3snbXbRLRuCTRgtnp4QLsfvtWYSZx=mT6qdFC+HYPYTkQ at mail dot gmail dot com> <alpine dot DEB dot 2 dot 20 dot 1606221501480 dot 29819 at digraph dot polyomino dot org dot uk> <CAMXFM3szjuStPa3VgQ2ivkxbLX0fYTSYP6fU_qzN4eqNoCcqEg at mail dot gmail dot com> <alpine dot DEB dot 2 dot 20 dot 1606221754240 dot 29819 at digraph dot polyomino dot org dot uk> <CAMXFM3ttTxYHOp-doov0Op2AztD1YSwcDYPiHTCScv_fDaS5Kg at mail dot gmail dot com>
On Thu, 23 Jun 2016, Andrew Senkevich wrote:
> +#define VECTOR_WRAPPER_fFF_2(scalar_func, vector_func) \
> +extern void vector_func (VEC_TYPE, VEC_INT_TYPE, VEC_INT_TYPE); \
> +void scalar_func (FLOAT x, FLOAT * r, FLOAT * r1) \
> +{ \
> + int i; \
> + FLOAT r_loc[VEC_LEN], r1_loc[VEC_LEN]; \
> + VEC_TYPE mx; \
> + VEC_INT_TYPE mr, mr1; \
> + INIT_VEC_LOOP (mx, x, VEC_LEN); \
> + INIT_VEC_PTRS_LOOP (((FLOAT **) &mr), r_loc, VEC_LEN); \
> + INIT_VEC_PTRS_LOOP (((FLOAT **) &mr1), r1_loc, VEC_LEN); \
> + vector_func (mx, mr, mr1); \
> + char *mr_ptr = (char *) &mr; \
> + char *mr1_ptr = (char *) &mr1; \
> + TEST_VEC_LOOP (*((FLOAT **) mr_ptr), VEC_LEN); \
> + TEST_VEC_LOOP (*((FLOAT **) mr1_ptr), VEC_LEN); \
> + *r = *((FLOAT **) mr_ptr)[0]; \
> + *r1 = *((FLOAT **) mr1_ptr)[0]; \
I still think this is much more complicated than necessary.
Rather than having variables mr_ptr and mr1_ptr at all, and having a load
of pointer casts, I'd expect you just to pass r_loc and r1_loc - the
arrays in which the results have been stored - directly to TEST_VEC_LOOP.
And then store the results in *r and *r1 taken from r_loc[0] and
r1_loc[0], without all the unnecessary indirection.
--
Joseph S. Myers
joseph@codesourcery.com