[Interest] Qt Application - Disabling AVX/AVX2

coroberti . coroberti at gmail.com
Thu Apr 23 07:42:25 CEST 2020


Kind regards,
Robert Iakobashvili
............................

On Wed, Apr 22, 2020 at 6:40 PM coroberti . <coroberti at gmail.com> wrote:
>
> On Wed, Apr 22, 2020 at 6:35 PM Allan Sandfeld Jensen <kde at carewolf.com> wrote:
> >
> > On Mittwoch, 22. April 2020 17:29:56 CEST coroberti . wrote:
> > > On Wed, Apr 22, 2020 at 6:17 PM Thiago Macieira
> > >
> > > <thiago.macieira at intel.com> wrote:
> > > > On Tuesday, 21 April 2020 14:26:13 PDT coroberti . wrote:
> > > > > Hi,
> > > > > Is it enough to define:
> > > > >
> > > > > QMAKE_CFLAGS -= -arch:AVX -arch:AVX2
> > > > > QMAKE_CXXFLAGS -=  -arch:AVX -arch:AVX2
> > > > >
> > > > > to ensure that compilation by QtCreator with Qt-5.14-MSVC Windows
> > > > > will not compile with such optimization flags even if avx and avx2
> > > > > instructions have not been disabled in Qt-library itself?
> > > >
> > > > Since those options aren't added to the CFLAGS or CXXFLAGS in the first
> > > > place, by default what you're tryng to do is a no-op.
> > > > Why do you think there are AVX instructions in your binary? And how did
> > > > you
> > > > turn them on in the first place?
> > > > Thiago Macieira - thiago.macieira (AT) intel.com
> > > >
> > > >   Software Architect - Intel System Software Products
> > >
> > > Thank you for your reply.
> > >
> > > Building 5.14.2, I was alerted by report from config that avx
> > > instructions are enabled.
> > >
> > > Clear, I need to investigate it more.
> > >
> > Probably support for them is enabled, but not turned on. That is what we do in
> > qtbase, build only some files with AVX enabled and switch to them on at
> > runtime.
> >
> > 'Allan
> >
> Thanks, Allan.
>
> Perhaps, like Microsoft, AVX optimized functions will be used only if
> runtime support by CPU detected.
>
> Kind regards,
> Robert

I've seen it.
It's not just a good job, it's a fantastically great job done in qtbase.

It even navigates thru the mess of compiler versions/issues.

Thanks, Thiago and Allan!

Kind regards,
Robert
............................


More information about the Interest mailing list