This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: PPC64 libmvec sincos/sincosf ABI
- From: Bill Schmidt <wschmidt at linux dot ibm dot com>
- To: GT <tnggil at protonmail dot com>
- Cc: "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>
- Date: Thu, 8 Aug 2019 12:51:26 -0500
- Subject: Re: PPC64 libmvec sincos/sincosf ABI
- References: <m-AhGqPevr7I_c5jF1posRA_bT8Gb8ybwyCgHJP5MbdPs1O6Yv60386A3hgYDZtEaij4iuLbqulf-JSlXj8v6mci_MNQDnHMd1mKpd1I0nI=@protonmail.com> <87blx0isku.fsf@linux.ibm.com> <423c181a-129f-662b-96cd-0940e6bda939@linux.ibm.com> <o17n2W1DqXwe_xbYdJAHVu4M5Y5KjVg-HUwQeaB1HLGk7FUCBKIEvYYO-50725OnNY2gDtfpkfHxkdd3tJMWDHAjddPcFGDNPefYX3fN-qE=@protonmail.com> <f5a09578-252f-cba2-141a-331bde7bf2e8@linux.ibm.com> <FALJngSdhM-EZvTCpEasV3wqjd1tkJjZYFX9-1XLHNn6cHNsz56q7GXQ7nbmPzlNZ61EKiorvS926kzxtnRGV_OA3ZE_8sC01whmiJ4tAFA=@protonmail.com>
On 8/8/19 12:42 PM, GT wrote:
> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> On Thursday, August 8, 2019 4:11 PM, Bill Schmidt wschmidt@linux.ibm.com wrote:
>
>>> 1. I understood sincos to be included in implementation of libmvec on PPC64
>>> because x86_64 provides that capability. There is discussion of an initial
>>> implementation bug in x86_64 sincos at:
>>> https://sourceware.org/bugzilla/show_bug.cgi?id=20024
>>>
>>>
>>> The final comment in the thread declares the bug fixed in GLIBC 2.24.
>> Interesting. I believe you -- I'm still learning about this. It
>> appears that, although there is an interface provided in libmvec, there
>> isn't GCC code to generate calls to it. I'd like to be proven wrong
>> about that.
> Your note below regarding the missing logic for sincos in ix86_veclibabi_svml
> is proof that you are correct. Isn't it?
I hope so. :-)
>
>>> Compiled it with gcc version 8.3.1 using the command in the Example:
>>> gcc ./tst_sincos.c -O1 -ftree-loop-vectorize -ffast-math -lm -mavx
>>> Does not generate vectorized call. There is the following warning issued
>>> by gcc:
>>> ./tst_sincos.c: In function ‘main’:
>>> ./tst_sincos.c:15:5: warning: implicit declaration of function ‘sincos’ [-Wimplicit-function-declaration]
>>> sincos (a[i], &b[i], &c[i]);
>>> ^~~~~~
>>> ./tst_sincos.c:15:5: warning: incompatible implicit declaration of built-in function ‘sincos’
>>> ./tst_sincos.c:15:5: note: include ‘<math.h>’ or provide a declaration of ‘sincos’
>>> ./tst_sincos.c:2:1:
>>> +#include <math.h>
>>> ./tst_sincos.c:15:5:
>>> sincos (a[i], &b[i], &c[i]);
>>> ^~~~~~
>>>
>>> The same warning is issued even when not requesting vectorization:
>>> gcc ./tst_sincos.c -lm
>>> All the above was on an x86_64 system. Got the same warning on PPC64 POWER8.
>>> What is the issue with tst_sincos.c above? math.h is clearly included.
>> I agree that this is odd. I have no explanation for you.
> Florian has given the reason for the warnings as being that it is required to build
> with _GNU_SOURCE for sincos.
>
>> You aren't going to get the vectorized function calls having removed the
>> #pragma omp simd, I think.
> GCC flags -O1 and -ftree-loop-vectorize enable vectorization of loops even in the absence
> of simd pragmas. Example 2 explicitly states that. The failure to vectorize is specific to
> how sincos is being handled. Which goes back to ix86_veclibabi_svml.
Ah, I'm sorry. I missed that statement in example 2. So yes, I think
it's all clear, then; GCC just won't generate this.
>
> Thanks.
> Bert.
>