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: Andrew Senkevich <andrew dot n dot senkevich at gmail dot com>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: "Carlos O'Donell" <carlos at redhat dot com>, libc-alpha <libc-alpha at sourceware dot org>
- Date: Mon, 27 Jun 2016 14:26:10 +0300
- 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>
2016-06-23 19:33 GMT+03:00 Andrew Senkevich <andrew.n.senkevich@gmail.com>:
> 2016-06-22 20:56 GMT+03:00 Joseph Myers <joseph@codesourcery.com>:
>> On Wed, 22 Jun 2016, Andrew Senkevich wrote:
>>
>>> 2016-06-22 18:12 GMT+03:00 Joseph Myers <joseph@codesourcery.com>:
>>> > 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.
>>>
>>> Unfolded TEST_VEC_LOOP looks successively at mr[0], mr[1] not at r[0], r[1].
>>> mr[0], mr[1] etc. are the same pointer, yes, but mx also contains
>>> equal values...
>>> Is it Ok?
>>
>> The whole point of TEST_VEC_LOOP is to make sure that the N floating-point
>> results are equal, given equal inputs (to fit vector tests into the scalar
>> test infrastructure).
>>
>> This means you need to use N separate pointers in the vector of pointers.
>
> Attached refactored version, ChangeLog is
>
> [BZ #20024]
> * sysdeps/x86/fpu/test-math-vector-sincos.h: New.
> * sysdeps/x86_64/fpu/multiarch/svml_d_sincos2_core_sse4.S: Fixed ABI
> of this implementation of vector function.
> * sysdeps/x86_64/fpu/multiarch/svml_d_sincos4_core_avx2.S: Likewise.
> * sysdeps/x86_64/fpu/multiarch/svml_d_sincos8_core_avx512.S: Likewise.
> * sysdeps/x86_64/fpu/multiarch/svml_s_sincosf16_core_avx512.S:
> Likewise.
> * sysdeps/x86_64/fpu/multiarch/svml_s_sincosf4_core_sse4.S: Likewise.
> * sysdeps/x86_64/fpu/multiarch/svml_s_sincosf8_core_avx2.S: Likewise.
> * sysdeps/x86_64/fpu/svml_d_sincos2_core.S: Likewise.
> * sysdeps/x86_64/fpu/svml_d_sincos4_core.S: Likewise.
> * sysdeps/x86_64/fpu/svml_d_sincos4_core_avx.S: Likewise.
> * sysdeps/x86_64/fpu/svml_d_sincos8_core.S: Likewise.
> * sysdeps/x86_64/fpu/svml_s_sincosf16_core.S: Likewise.
> * sysdeps/x86_64/fpu/svml_s_sincosf4_core.S: Likewise.
> * sysdeps/x86_64/fpu/svml_s_sincosf8_core.S: Likewise.
> * sysdeps/x86_64/fpu/svml_s_sincosf8_core_avx.S: Likewise.
> * sysdeps/x86_64/fpu/test-double-vlen2-wrappers.c: Use another wrapper
> for testing vector sincos with fixed ABI.
> * sysdeps/x86_64/fpu/test-double-vlen4-avx2-wrappers.c: Likewise.
> * sysdeps/x86_64/fpu/test-double-vlen4-wrappers.c: Likewise.
> * sysdeps/x86_64/fpu/test-double-vlen8-wrappers.c: Likewise.
> * sysdeps/x86_64/fpu/test-float-vlen16-wrappers.c: Likewise.
> * sysdeps/x86_64/fpu/test-float-vlen4-wrappers.c: Likewise.
> * sysdeps/x86_64/fpu/test-float-vlen8-avx2-wrappers.c: Likewise.
> * sysdeps/x86_64/fpu/test-float-vlen8-wrappers.c: Likewise.
> * sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx.c: New test.
> * sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx2.c: Likewise.
> * sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx512.c: Likewise.
> * sysdeps/x86_64/fpu/test-double-libmvec-sincos.c: Likewise.
> * sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx.c: Likewise.
> * sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx2.c: Likewise.
> * sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx512.c: Likewise.
> * sysdeps/x86_64/fpu/test-float-libmvec-sincosf.c: Likewise.
> * sysdeps/x86_64/fpu/Makefile: Added new tests.
Tested on x86_64 and x32 on all needed ISAs. Ok for trunk?
--
WBR,
Andrew