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

fix CTFE/Miri simd_insert/extract on array-style repr(simd) types #90999

Merged
merged 2 commits into from
Nov 20, 2021

Conversation

RalfJung
Copy link
Member

The changed test would previously fail since place_index would just return the only field of f32x4, i.e., the array -- rather than indexing into the array which is what we have to do.

The new helper methods will also be needed for rust-lang/miri#1912.

r? @oli-obk

@rust-highfive
Copy link
Collaborator

Some changes occured to the CTFE / Miri engine

cc @rust-lang/miri

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 18, 2021
@rust-log-analyzer

This comment has been minimized.

@@ -7,7 +7,8 @@

#[repr(simd)] struct i8x1(i8);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you check whether #[repr(simd)] struct i8x1([i8; 1]); won't end up with an immediate? Not that this type makes much sense, but probably good to be exhaustive.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point, I have added that case to the test as well.

let place = self.mplace_index(&dest, i)?;
let value =
if i == index { *elem } else { self.mplace_index(&input, i)?.into() };
self.copy_op(&value, &place.into())?;
Copy link
Member Author

Choose a reason for hiding this comment

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

FWIW, this will assert that the types are equal, thus taking care of the remaining assertions that I removed.

@oli-obk
Copy link
Contributor

oli-obk commented Nov 18, 2021

@bors r+

@bors
Copy link
Contributor

bors commented Nov 18, 2021

📌 Commit 0304e16 has been approved by oli-obk

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 18, 2021
@apiraino apiraino added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Nov 18, 2021
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Nov 18, 2021
fix CTFE/Miri simd_insert/extract on array-style repr(simd) types

The changed test would previously fail since `place_index` would just return the only field of `f32x4`, i.e., the array -- rather than *indexing into* the array which is what we have to do.

The new helper methods will also be needed for rust-lang/miri#1912.

r? `@oli-obk`
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Nov 19, 2021
fix CTFE/Miri simd_insert/extract on array-style repr(simd) types

The changed test would previously fail since `place_index` would just return the only field of `f32x4`, i.e., the array -- rather than *indexing into* the array which is what we have to do.

The new helper methods will also be needed for rust-lang/miri#1912.

r? ``@oli-obk``
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Nov 19, 2021
fix CTFE/Miri simd_insert/extract on array-style repr(simd) types

The changed test would previously fail since `place_index` would just return the only field of `f32x4`, i.e., the array -- rather than *indexing into* the array which is what we have to do.

The new helper methods will also be needed for rust-lang/miri#1912.

r? ```@oli-obk```
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Nov 19, 2021
fix CTFE/Miri simd_insert/extract on array-style repr(simd) types

The changed test would previously fail since `place_index` would just return the only field of `f32x4`, i.e., the array -- rather than *indexing into* the array which is what we have to do.

The new helper methods will also be needed for rust-lang/miri#1912.

r? ````@oli-obk````
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Nov 19, 2021
fix CTFE/Miri simd_insert/extract on array-style repr(simd) types

The changed test would previously fail since `place_index` would just return the only field of `f32x4`, i.e., the array -- rather than *indexing into* the array which is what we have to do.

The new helper methods will also be needed for rust-lang/miri#1912.

r? `````@oli-obk`````
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 20, 2021
…askrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#88361 (Makes docs for references a little less confusing)
 - rust-lang#90089 (Improve display of enum variants)
 - rust-lang#90956 (Add a regression test for rust-lang#87573)
 - rust-lang#90999 (fix CTFE/Miri simd_insert/extract on array-style repr(simd) types)
 - rust-lang#91026 (rustdoc doctest: detect `fn main` after an unexpected semicolon)
 - rust-lang#91035 (Put back removed empty line)
 - rust-lang#91044 (Turn all 0x1b_u8 into '\x1b' or b'\x1b')
 - rust-lang#91054 (rustdoc: Fix some unescaped HTML tags in docs)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit cf69f9e into rust-lang:master Nov 20, 2021
@rustbot rustbot added this to the 1.58.0 milestone Nov 20, 2021
bors added a commit to rust-lang/miri that referenced this pull request Nov 21, 2021
portable SIMD: basic binops

First steps towards #1912. Requires rust-lang/rust#90999.
@RalfJung RalfJung deleted the miri_simd branch November 28, 2021 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants