-
Notifications
You must be signed in to change notification settings - Fork 13k
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
make memcmp return a value of c_int_width instead of i32 #90791
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @joshtriplett (or someone else) soon. Please see the contribution instructions for more information. |
This comment has been minimized.
This comment has been minimized.
1434ae4
to
3e0a0b6
Compare
This comment has been minimized.
This comment has been minimized.
Ok, thanks to your pointers I got this actually working and confirmed that this works for the test program. I think I need to do this in two parts to pass CI? The first part will make the compiler handle different c_int_widths, and then I can uncomment the Also, I'm unsure what to do for the "default" case for the match statement... currently this outputs the following if you use a bad value for
Lastly, are there any tests I should write, or any other things I can do to help get this through? |
3e0a0b6
to
abb4d28
Compare
This comment has been minimized.
This comment has been minimized.
abb4d28
to
4ba643a
Compare
You can use |
4ba643a
to
b3c287b
Compare
Fixed, thanks! |
@joshtriplett Hi, just checking if there's anything else I need to do on this to get it merged in? |
This comment was marked as resolved.
This comment was marked as resolved.
r? @rust-lang/compiler |
The codegen changes look reasonable to me, although I'm not an expert in that area. |
I'm testing these changes in my rust fork for mos arch (8bit 6502 CPU) and everything works fine. /~https://github.com/mrk-its/rust/tree/mos_target |
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'm going to request that Vadim's review comments are addressed. I don't believe this PR should land as is.
@drmorr0 any updates on this? |
@Dylan-DPC I have not had a chance to revisit this yet, I'm hoping to get to it soon-ish, though. |
b3c287b
to
6c811ce
Compare
This comment has been minimized.
This comment has been minimized.
d22ded4
to
4de3090
Compare
This comment has been minimized.
This comment has been minimized.
4de3090
to
9692b53
Compare
This comment has been minimized.
This comment has been minimized.
9692b53
to
b33bf18
Compare
This comment has been minimized.
This comment has been minimized.
b33bf18
to
1aa9676
Compare
1aa9676
to
aa67016
Compare
Ok I think this is ready; I'm trying to get my test environment back up so that I can confirm it's generating the right thing but some other stuff has broken in the interim. |
Thanks! |
📌 Commit aa67016 has been approved by |
☀️ Test successful - checks-actions |
Finished benchmarking commit (15a242a): comparison url. Summary: This benchmark run did not return any relevant results. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression |
This is an attempt to fix #32610 and #78022, namely, that
memcmp
always returns ani32
regardless of the platform. I'm running into some issues and was hoping I could get some help.Here's what I've been attempting so far:
library/core/src/slice/cmp.rs
andcompiler/rustc_codegen_llvm/src/context.rs
; this is becausetarget_c_int_width
isn't passed through and recognized as a valid config option yet. I'm building with./x.py build --stage 0 library/core library/proc_macro compiler/rustc
#[cfg(c_int_width = ...)]
params tocmp.rs
andcontext.rs
and build the stage 1 compiler by running./x.py build --keep-stage 0 --stage 1 library/core library/proc_macro compiler/rustc
. This step now runs successfully.RUSTFLAGS="--emit llvm-ir" cargo build --release
, and look at the resulting llvm IR, which still shows:Any ideas what I'm missing here? Alternately, if this is totally the wrong approach I'm open to other suggestions.
cc @Rahix