Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Constexpr fma #734

Merged
merged 3 commits into from
May 30, 2022
Merged

Constexpr fma #734

merged 3 commits into from
May 30, 2022

Conversation

mborland
Copy link
Member

@mborland mborland commented Jan 6, 2022

Implements: fma, fmaf, and fmal

@jzmaddock
Copy link
Collaborator

On the one hand this looks trivial.... on the other hand do we not run the risk of compile-time and runtime fma's returning subtly differing values?

@mborland
Copy link
Member Author

mborland commented Jan 7, 2022

If the compiler doesn't optimize this to an FMA asm call and the builtin is not available then you are correct that it could be off by one rounding. C++20 allows for constexpr asm if you would prefer that I hard code it for major architectures.

@NAThompson
Copy link
Collaborator

@jzmaddock : Is an fma for multiprecision infeasible or just a PITA?

@mborland mborland mentioned this pull request May 27, 2022
@mborland
Copy link
Member Author

@NAThompson This is clean and good for review. The implementation is trivial, but with the documented compiler flag the results are exact. Here is the prototype for ima support in Boost.Multiprecision.

1 similar comment
@mborland
Copy link
Member Author

@NAThompson This is clean and good for review. The implementation is trivial, but with the documented compiler flag the results are exact. Here is the prototype for ima support in Boost.Multiprecision.

@NAThompson
Copy link
Collaborator

Cool; this looks good. Is the failed job a known issue?

@mborland
Copy link
Member Author

Cool; this looks good. Is the failed job a known issue?

It's a sanitizer issue in autodiff that seems to be popping up consistently.

@NAThompson NAThompson merged commit 3107aba into boostorg:develop May 30, 2022
@mborland mborland deleted the fma branch May 31, 2022 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants