Page MenuHomeFreeBSD

lib/msun amd64: use AVX FMA instructions for fma(3) and fmaf(3) when available
ClosedPublic

Authored by kib on Sun, Sep 6, 6:02 AM.
Tags
None
Referenced Files
F174335663: D59462.id186076.diff
Fri, Oct 2, 12:08 PM
Unknown Object (File)
Thu, Oct 1, 1:57 PM
Unknown Object (File)
Thu, Oct 1, 1:57 PM
Unknown Object (File)
Sun, Sep 27, 9:32 AM
Unknown Object (File)
Sun, Sep 27, 7:27 AM
Unknown Object (File)
Sun, Sep 27, 4:22 AM
Unknown Object (File)
Sun, Sep 27, 4:02 AM
Unknown Object (File)
Sun, Sep 27, 1:58 AM
Subscribers

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

kib requested review of this revision.Sun, Sep 6, 6:02 AM
This revision is now accepted and ready to land.Sun, Sep 6, 3:31 PM

There could be some performance issues related to the SSE/AVX transition state machine, but checking the Intel Software Optimization Manual, it seems like executing 128 bit AVX instructions seems unproblematic in any steady-state scenario.

Brilliant work. Thanks!

Put added symbols into private namespace.
It does not matter for shared library, but helps static linking.

This revision now requires review to proceed.Sun, Sep 6, 9:17 PM

Switch to use libc/amd64/string ARCHLEVEL infra to control the selection.

Oh yeah, using the archlevel framework sounds like a good idea! I didn't even think about that, as it's specific to libc. Other libm functions may profit in the future.

In D59462#1365021, @fuz wrote:

Oh yeah, using the archlevel framework sounds like a good idea! I didn't even think about that, as it's specific to libc. Other libm functions may profit in the future.

Do you have any notes about the updated patch?

BTW, I was not able to come up with a C expression that can be used to initialize the function table, so I resorted to filling it in assembler same as is done for strings.

Add kargl@ patch from PR 298260

In D59462#1365088, @kib wrote:
In D59462#1365021, @fuz wrote:

Oh yeah, using the archlevel framework sounds like a good idea! I didn't even think about that, as it's specific to libc. Other libm functions may profit in the future.

Do you have any notes about the updated patch?

BTW, I was not able to come up with a C expression that can be used to initialize the function table, so I resorted to filling it in assembler same as is done for strings.

Oh the patch is fine, I just forgot to hit “approve.” I don't think the table can be initialised in C. I designed it this way to reduce the amounts of relocations and the table size, and I don't think C wants to do this stuff. We could do an inline assembly macro to build the table in C if you like.

This revision is now accepted and ready to land.Tue, Sep 8, 7:45 AM