-
Notifications
You must be signed in to change notification settings - Fork 13.3k
miri: implement some llvm.x86.sse.*
intrinsics and add tests
#113932
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
Implements LLVM intrisics needed to run most SSE functions from `core::arch::x86{,_64}`. Also adds miri tests for those functions (mostly copied from core_arch tests).
(rustbot has picked a reviewer for you, use r? to override) |
The Miri subtree was changed cc @rust-lang/miri |
Thanks for the PR! As a procedural matter, PRs that only change Miri are preferred to be submitted against the Miri repo, https://github.com/rust-lang/miri/. But if porting the PR over is too hard I'm also okay with reviewing it here. Miri has so far deliberately not implemented these intrinsics. It was just considered too much work. But I guess now you just did it. :) So that's quite cool. Regarding the review -- to me, |
) { | ||
i64::MIN | ||
} else { | ||
cvt.value as i64 |
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.
as
casts are dangerous and if you had made this a Miri PR, CI would have failed due to a clippy check. We always use checked casts to make sure this doesn't overflow.
@@ -928,6 +928,28 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> { | |||
this.write_scalar(Scalar::from_f64(res), dest)?; | |||
} | |||
|
|||
"llvm.prefetch" => { | |||
let [_, rw, loc, ty] = |
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.
It is never okay to throw away an argument with _
. At the least some to_<int type>
method should be called on it to ensure it has the right size.
Thanks for the feedback! I will open the PR in the miri repo. |
miri: implement some `llvm.x86.sse.*` intrinsics and add tests PR moved from rust-lang/rust#113932. Implements LLVM intrisics needed to run most SSE functions from `core::arch::x86{,_64}`. Also adds miri tests for those functions (mostly copied from core_arch tests). r? `@RalfJung` The first commit is the same that the commit in the PR I had opened in the Rust repository. I addressed review comments in additional commits to make it easier to review. I also fixed formatting and clippy warnings.
miri: implement some `llvm.x86.sse.*` intrinsics and add tests PR moved from rust-lang#113932. Implements LLVM intrisics needed to run most SSE functions from `core::arch::x86{,_64}`. Also adds miri tests for those functions (mostly copied from core_arch tests). r? `@RalfJung` The first commit is the same that the commit in the PR I had opened in the Rust repository. I addressed review comments in additional commits to make it easier to review. I also fixed formatting and clippy warnings.
miri: implement some `llvm.x86.sse.*` intrinsics and add tests PR moved from rust-lang/rust#113932. Implements LLVM intrisics needed to run most SSE functions from `core::arch::x86{,_64}`. Also adds miri tests for those functions (mostly copied from core_arch tests). r? `@RalfJung` The first commit is the same that the commit in the PR I had opened in the Rust repository. I addressed review comments in additional commits to make it easier to review. I also fixed formatting and clippy warnings.
miri: implement some `llvm.x86.sse.*` intrinsics and add tests PR moved from rust-lang/rust#113932. Implements LLVM intrisics needed to run most SSE functions from `core::arch::x86{,_64}`. Also adds miri tests for those functions (mostly copied from core_arch tests). r? `@RalfJung` The first commit is the same that the commit in the PR I had opened in the Rust repository. I addressed review comments in additional commits to make it easier to review. I also fixed formatting and clippy warnings.
Implements LLVM intrisics needed to run most SSE functions from
core::arch::x86{,_64}
.Also adds miri tests for those functions (mostly copied from core_arch tests).