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

Restore simd_extract and simd_insert intrinsics #1942

Merged
merged 10 commits into from
Nov 29, 2022

Conversation

adpaco-aws
Copy link
Contributor

Description of changes:

Restores the SIMD "construction" intrinsics simd_extract and simd_insert.

As in #1853, we must perform some type-checks that depend on the back-end. These type-checking errors are now caught and we include a couple of test cases to ensure that they remain that way.

Resolved issues:

Towards #1148

Testing:

  • How is this change tested? Existing regression. Adds two new tests, converts a "fixme".

  • Is this a refactor change? Not completely, the main novelty here are the type-checks.

Checklist

  • Each commit message has a non-empty body, explaining why the change was made
  • Methods or procedures are documented
  • Regression or unit tests are included, or existing tests cover the modified code
  • My PR is restricted to a single feature or bugfix

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.

@adpaco-aws adpaco-aws requested a review from a team as a code owner November 28, 2022 20:31
Copy link
Contributor

@tedinski tedinski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is probably good to merge, my one concern might be a "followup PR" kind of thing if it's a problem at all...

Comment on lines +36 to +37
let m = unsafe { simd_insert(y, 0, 1_i64) };
let n = unsafe { simd_insert(y, 1, 5_i64) };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we know if this limitation (needing that cast) will cause problems in how it gets used in real code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @tedinski, sorry for the late reply.

Just wanted to make clear that this is just mimicking rustc's current behavior. Some SIMD intrinsics require additional type-checking done by the backend, as in here. This would prevent us from accepting that, in principle, cannot be compiled with rustc (this was the case for this test).

@tedinski tedinski merged commit 30a06cc into model-checking:main Nov 29, 2022
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.

2 participants