This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PPC64 libmvec sincos/sincosf ABI


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.
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]