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, 22 Jun 2016 15:12:52 +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>
On Sat, 11 Jun 2016, Andrew Senkevich wrote:
> +#define VECTOR_WRAPPER_fFF(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; \
> + VEC_TYPE mx; \
> + VEC_INT_TYPE mr, mr1; \
> + INIT_VEC_LOOP (mx, x, VEC_LEN); \
> + INIT_VEC_LOOP (((FLOAT **) &mr), r, VEC_LEN); \
> + INIT_VEC_LOOP (((FLOAT **) &mr1), r1, 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); \
> + return; \
You seem to have lots of duplicate copies of this VECTOR_WRAPPER_fFF
definition. Please unify them somehow.
Also, I don't see how this definition can work. It looks to me like: you
initialize the vectors of pointers with lots of copies of the same pointer
(as INIT_VEC_LOOP is about putting lots of copies of the same value in a
vector). Then you call the vector function. Then the TEST_VEC_LOOP calls
have a first argument that is, via some indirection, just r or r1, so they
would look successively at r[0], r[1] etc. - but only r[0] and r1[0]
actually exist. Given this, I don't understand why the implementation you
have would have passed the tests at all.
What I'd expect is: you define vector result variables locally in the
macro, like math/test-math-vector.h's copy of VECTOR_WRAPPER_fFF does.
You initialize the vectors of pointers to point to each successive element
of the vector result variables - not to have every element pointing to the
same place. Then everything after that would be as in the
math/test-math-vector.h version.
--
Joseph S. Myers
joseph@codesourcery.com