This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Can I use -Ofast without libmvec
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: sellcey at cavium dot com,Steve Ellcey <sellcey at cavium dot com>,"H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: gcc <gcc at gcc dot gnu dot org>
- Date: Thu, 22 Mar 2018 19:52:40 +0100
- Subject: Re: Can I use -Ofast without libmvec
- References: <1521742138.18659.59.camel@cavium.com> <CAMe9rOqLG=kGcEY76na2ZyEZPKLi0ngQafovT+=CXE8ex6GYWw@mail.gmail.com> <1521744513.18659.63.camel@cavium.com>
On March 22, 2018 7:48:33 PM GMT+01:00, Steve Ellcey <sellcey@cavium.com> wrote:
>On Thu, 2018-03-22 at 11:42 -0700, H.J. Lu wrote:
>> On Thu, Mar 22, 2018 at 11:08 AM, Steve Ellcey <sellcey@cavium.com>
>> 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)?
>> Have you tried -lm?
>
>It isn't a question of not working. Everything works and links and
>runs, but I would just like to know if there is any way to compile my
>program in such a way that GCC does not generate calls to the libmvect
>routines.
>
>I am doing some performance analysis and would like to know how much
>(or little) having these vectorized routines help in various
>benchmarks.
Not from the GCC side I think. Maybe look into the glibc headers if there's some macro tricks you can pull off.
Richard.
>Steve Ellcey