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

Improve SIMD casts #92425

Merged
merged 5 commits into from
Jan 19, 2022
Merged

Improve SIMD casts #92425

merged 5 commits into from
Jan 19, 2022

Conversation

calebzulawski
Copy link
Member

  • Allows simd_cast intrinsic to take usize and isize
  • Adds simd_as intrinsic, which is the same as simd_cast except for saturating float-to-int conversions (matching the behavior of as).

cc @workingjubilee

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Dec 30, 2021
@rust-highfive
Copy link
Collaborator

r? @estebank

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 30, 2021
@bors
Copy link
Contributor

bors commented Jan 3, 2022

☔ The latest upstream changes (presumably #92518) made this pull request unmergeable. Please resolve the merge conflicts.

@workingjubilee
Copy link
Member

r? @workingjubilee

Copy link
Member

@workingjubilee workingjubilee left a comment

Choose a reason for hiding this comment

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

Brain finally thawed and allowed me to review things. Thank you for your patience. Only minimal remarks.

compiler/rustc_codegen_llvm/src/builder.rs Outdated Show resolved Hide resolved
Comment on lines +222 to +223
assert!(matches!(self.cx().type_kind(float_ty), TypeKind::Float | TypeKind::Double));
assert_eq!(self.cx().type_kind(int_ty), TypeKind::Integer);
Copy link
Member

Choose a reason for hiding this comment

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

Hm, isn't this redundant with the checks performed by calling float_width and then matching on that? I suppose it doesn't exactly hurt to try to catch it in a single place here but...

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, it should error there, but I figure it's good to ensure that everything is the way we expect before going on.

compiler/rustc_codegen_ssa/src/traits/builder.rs Outdated Show resolved Hide resolved
calebzulawski and others added 2 commits January 17, 2022 22:29
Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com>
@workingjubilee
Copy link
Member

That's fine. It will probably be more useful with a specific diagnostic message, but probably an ICE will eventually hit that path and inform what that message should have been. With that, everything looks like it should be in order! And in theory this is entirely additive so,

@bors r+ rollup=always

@bors
Copy link
Contributor

bors commented Jan 18, 2022

📌 Commit 49d36d7 has been approved by workingjubilee

@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 Jan 18, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 18, 2022
…askrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#90782 (Implement raw-dylib support for windows-gnu)
 - rust-lang#91150 (Let qpath contain NtTy: `<$:ty as $:ty>::…`)
 - rust-lang#92425 (Improve SIMD casts)
 - rust-lang#92692 (Simplify and unify rustdoc sidebar styles)
 - rust-lang#92780 (Directly use ConstValue for single literals in blocks)
 - rust-lang#92924 (Delete pretty printer tracing)
 - rust-lang#93018 (Remove some unused `Ord` derives based on `Span`)
 - rust-lang#93026 (fix typo in `max` description for f32/f64)
 - rust-lang#93035 (Fix stdarch submodule pointing to commit outside tree)

Failed merges:

 - rust-lang#92861 (Rustdoc mobile: put out-of-band info on its own line)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 7889f96 into rust-lang:master Jan 19, 2022
@rustbot rustbot added this to the 1.60.0 milestone Jan 19, 2022
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.

6 participants