[Development] Implicit VFMADD support (Was: Updating x86 SIMD support in Qt)

Konstantin Shegunov kshegunov at gmail.com
Mon Jan 24 19:36:41 CET 2022


On Mon, Jan 24, 2022 at 7:32 PM Thiago Macieira <thiago.macieira at intel.com>
wrote:

> Today, only in the two files with "_avx2" in the name, unless you raise
> the
> CPU architecture yourself while configuring Qt. My proposal is to get that
> on
> Linux by default with the v3 extra build.
>

Yes, this I got from the discussion. However the code in question isn't in
*_avx2. In any case I don't have an objection or an opinion even (about the
original discussion), that default should work for my case, though.

For *your* code, you need to explicitly enable FMA yourself. The changes
> proposed in this thread do not affect user code.
>

*My* code, is supposed to fix Qt code at some point, so that's why I'm
asking. I know I have to do it myself for user code, that's not an issue.


> Both glibc, macOS libSystem, and Windows' ucrtbase have implementations
> using
> the FMA instruction and will detect at runtime which one to use (this was
> the
> *only* place in ucrtbase I found AVX2/FMA code). You're out of luck if
> you're
> using MinGW, though.
>

I suppose that could work, but I'd rather avoid doing the call if I can
help it.


> All compilers tested will use the FMA instruction if you enabled the CPU
> feature, otherwise they'll make a call to the math lbrary's fma() function.


Compare: https://gcc.godbolt.org/z/c5385d5GY (no FMA)
> to: https://gcc.godbolt.org/z/jf3zhsjPf (with FMA)
>

Yes, I already looked at the assembly, which is exactly why I'm asking
about it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20220124/0d1da386/attachment.htm>


More information about the Development mailing list