On Thu, Mar 22, 2018 at 7:47 PM, Jakub Jelinek <ja...@redhat.com> wrote:
> On Thu, Mar 22, 2018 at 11:08:58AM -0700, Steve Ellcey wrote:
>> I have a question about the math vector library routines in libmvec.
>> If I compile a program on x86 with -Ofast, something like:
>>
>> void foo(double * __restrict x, double * __restrict y, double * __restrict z)
>> {
>>       for (int i = 0; i < 1000; i++) x[i] = sin(y[i]);
>> }
>>
>> I get a call to the vector sin routine _ZGVbN2v_sin.  That is fine, but
>> is there some way to compile with -Ofast and not use the libmvec vector
>> routines?  I have tried -fopenmp, -fopenmp-simd, -fno-openmp, and -fno-
>> openmp-simd and I always get a call to _ZGVbN2v_sin.  Is there anyway
>> to stop the use of the vectorized calls (without turning off -Ofast)?
>
> Why do you want to avoid that?  You could use -Ofast -U__FAST_MATH__, because 
> then
> glibc headers won't use the simd attribute, but you won't get the finite
> stuff either etc.
> Or you can use use
> double my_sin (double) __asm ("sin");
> and use my_sin instead of sin.

Or you can

#define __simd__ foobaz

and deal with "unknown attribute foobaz" warnings.

Richard.

>         Jakub

Reply via email to