-
Notifications
You must be signed in to change notification settings - Fork 74
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
Add fmae
which uses fmuladd
#116
Conversation
So this isn't exactly accurate. The reason why, without this change the performance is worse, is IIUC because LLVM has to emulates the infinite precision of the First, thank you for doing this, since I mainly test on an AVX1 machine and this is what I was seeing, and now we know that
|
3d7712b
to
b719209
Compare
fmuladd
for fma
and document this behaviorfmae
which uses fmuladd
@gnzlbg I've changed this PR as you said and implemented the |
src/api/math/float/fmae.rs
Outdated
/// fused multiply subtract (`self * y - z`). | ||
/// Simply negating the second parameter of this function | ||
/// will make the compiler generate it. | ||
/// While fused-multiply add ([fma]) has infinite precision, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need to put fma in ticks `` for the doc link to work properly.
b6d5cd4
to
8ad06a1
Compare
I've been fuzzing |
It seems that rustdoc trips on trying to generate the links - let's just remove the |
8ad06a1
to
0230670
Compare
@gnzlbg Alright, the links shouldn' be a problem since rustdoc will place these functions one next to another in the end. I have removed the mention of LLVM will simply do its best to pick the right instruction, based on how Also, some bikeshedding: Rust's |
Oversight probably. Please open an issue about this. The floating-point methods are not in the initial round for stabilization so not much discussion has been going on about these. |
Fixes #112.
When it comes to performance, the performance in my updated
stencil
benchmark withavx2
enabled is the same. But whenavx2
is disabled, theavx
fallback is much faster (before this pull request, I saw some 10x performance reduction on AVX 1).So there are no downsides to this change, only performance improvements.
Also added some documentation for crate users.
I didn't rename the
extern "C" fn
s, only changed thelink_name
attribute.