-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Don't set fast-math for the SIMD operations we set it for previously #84274
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
Conversation
r? @estebank (rust-highfive has picked a reviewer for you, use r? to override) |
This needs changes to |
This comment has been minimized.
This comment has been minimized.
Another note: I'm not sure what the design philosophy of |
This comment has been minimized.
This comment has been minimized.
sym::simd_fma => ("fma", bx.type_func(&[vec_ty, vec_ty, vec_ty], vec_ty)), | ||
let (intr_name, fn_ty, approx) = match name { | ||
sym::simd_ceil => ("ceil", bx.type_func(&[vec_ty], vec_ty), false), | ||
sym::simd_fabs => ("abs", bx.type_func(&[vec_ty], vec_ty), false), |
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.
sym::simd_fabs => ("abs", bx.type_func(&[vec_ty], vec_ty), false), | |
sym::simd_fabs => ("fabs", bx.type_func(&[vec_ty], vec_ty), false), |
abs is for integers only.
In Looking at how these intrinsics are used in |
Another question is why |
There are two reasons, one is that implementing the intrinsics in the compiler allows them to be exposed as generics (the |
@workingjubilee this thread may be of interest to you... |
This comment has been minimized.
This comment has been minimized.
`fast-math` implies things like functions not being able to accept as an argument or return as a result, say, `inf` which made these functions confusingly named or behaving incorrectly, depending on how you interpret it. Since the time when these intrinsics have been implemented the intrinsics user's (stdsimd) approach has changed significantly and so now it is required that these intrinsics operate normally rather than in "whatever" way. Fixes rust-lang#84268
We have been implementing quite a lot of testing for functions, especially on edge cases and for floats, which is what caught this peculiarity, and we have been paying quite a lot of attention to the compilation outputs (both LLVM IR and assembly), so we definitely are doing that review as we go. As Caleb mentioned, our intention is to define abstraction layers so as to factor out and thereby reduce the scope of the task from "implement all of LLVM IR" or "handle every possible machine architecture" or "worry about all possible vector lengths" as much as possible for everyone involved. For |
So, @calebzulawski, from what I am gathering, looking at the LangRef, I don't think it would be a problem for |
I think there should be some version of the simd functions without |
afn
(approximate function) flag for simd ops
This was adjusted to expose intrinsics with no flags set at all. If there's ever a need for less precise options, they will need to happen as new intrinsics. This also no longer needs any changes to sibling projects. |
Can you please update the PR description to be in line with the updated implementation? @bors r+ rollup=never (may cause runtime perf regressions) |
📌 Commit 487e273 has been approved by |
☀️ Test successful - checks-actions |
fast-math
implies things like functions not being able to accept as anargument or return as a result, say,
inf
which made these functionsconfusingly named or behaving incorrectly, depending on how you
interpret it. Since the time when these intrinsics have been implemented
the intrinsics user's (stdsimd) approach has changed significantly and
so now it is required that these intrinsics operate normally rather than
in "whatever" way.
Fixes #84268