-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Make SIMD intrinsics available in const
-contexts
#147521
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
base: master
Are you sure you want to change the base?
Conversation
Enable const-testing for the ported SIMD intrinsics
Some changes occurred to the platform-builtins intrinsics. Make sure the cc @antoyo, @GuillaumeGomez, @bjorn3, @calebzulawski, @programmerjake The Miri subtree was changed cc @rust-lang/miri Some changes occurred to the intrinsics. Make sure the CTFE / Miri interpreter |
|
Cc @Amanieu |
let r: f32 = simd_reduce_mul_unordered(x); | ||
assert_eq!(r, -24_f32); | ||
let x = f32x4::from_array([1., -2., 3., 4.]); | ||
let r: f32 = simd_reduce_add_ordered(x, 0.); |
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 know this wasn't there originally, but maybe we should add a test that requires being added in the proper order to return the right result? something like 1.0e20f32 + 1.0 - 1.0e20 - 1.0 == -1.0
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.
other than that idea for a new test, lgtm
successor to #146568, this PR actually makes the SIMD intrinsics
const
, and modifies the tests to test the const-eval implementationsr? @tgross35 ig (although feel free to reassign, this is not anything targeted really)