-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Mention Register Size in #[warn(asm_sub_register)]
#121940
Conversation
r? compiler |
That looks very reasonable but I don't know this area r? compiler |
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.
Thanks for working on this! Generally LGTM. I have minor suggestions / questions.
_ => None, | ||
}, | ||
Self::reg_byte => None, | ||
Self::xmm_reg => None, | ||
Self::ymm_reg => match ty.size().bits() { | ||
256 => None, | ||
_ => Some(('x', "xmm0")), | ||
_ => Some(('x', "xmm0", 128).into()), |
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.
Do you think it would be a good idea to turn the wildcard _
into 128
and to add an explicit _ => unreachable!()
or bug!("unreachable")
? Similarly for the other cases in this file?
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.
Thanks for the suggestion.
But making this change panics on a few UI tests. It makes sense because the default size for any value using the YMM
register class and less than 256 bits long is 128 bits.
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.
Ah, yes! You are absolutely right 🤦
@bors r+ rollup |
…mease Mention Register Size in `#[warn(asm_sub_register)]` Fixes rust-lang#121593 Displays the register size information obtained from `suggest_modifier()` and `default_modifier()`.
…iaskrgr Rollup of 11 pull requests Successful merges: - rust-lang#104353 (Add CStr::bytes iterator) - rust-lang#114038 (unix time module now return result) - rust-lang#119676 (rustdoc-search: search types by higher-order functions) - rust-lang#120699 (Document `TRACK_DIAGNOSTIC` calls.) - rust-lang#121899 (Document how removing a type's field can be bad and what to do instead) - rust-lang#121940 (Mention Register Size in `#[warn(asm_sub_register)]`) - rust-lang#122397 (Various cleanups around the const eval query providers) - rust-lang#122405 (Add methods to create StableMIR constant) - rust-lang#122416 (Various style improvements to `rustc_lint::levels`) - rust-lang#122440 (const-eval: organize and extend tests for required-consts) - rust-lang#122461 (fix unsoundness in Step::forward_unchecked for signed integers) r? `@ghost` `@rustbot` modify labels: rollup
@bors rollup=iffy |
@rustbot ready |
…mease Mention Register Size in `#[warn(asm_sub_register)]` Fixes rust-lang#121593 Displays the register size information obtained from `suggest_modifier()` and `default_modifier()`.
…kingjubilee Rollup of 13 pull requests Successful merges: - rust-lang#121281 (regression test for rust-lang#103626) - rust-lang#121940 (Mention Register Size in `#[warn(asm_sub_register)]`) - rust-lang#122217 (Handle str literals written with `'` lexed as lifetime) - rust-lang#122379 (transmute: caution against int2ptr transmutation) - rust-lang#122460 (Rework rmake support library API) - rust-lang#122797 (Fix compile of wasm64-unknown-unknown target) - rust-lang#122875 (CFI: Support self_cell-like recursion) - rust-lang#122879 (CFI: Strip auto traits off Virtual calls) - rust-lang#122895 (add some ice tests 5xxxx to 9xxxx) - rust-lang#122907 (Uniquify `ReError` on input mode in canonicalizer) - rust-lang#122923 (In `pretty_print_type()`, print `async fn` futures' paths instead of spans.) - rust-lang#122942 (Add test in higher ranked subtype) - rust-lang#122963 (core/panicking: fix outdated comment) r? `@ghost` `@rustbot` modify labels: rollup
…mease Mention Register Size in `#[warn(asm_sub_register)]` Fixes rust-lang#121593 Displays the register size information obtained from `suggest_modifier()` and `default_modifier()`.
Mention Register Size in `#[warn(asm_sub_register)]` Fixes rust-lang#121593 Displays the register size information obtained from `suggest_modifier()` and `default_modifier()`.
💔 Test failed - checks-actions |
Looks like a network issue. @bors retry |
…mease Mention Register Size in `#[warn(asm_sub_register)]` Fixes rust-lang#121593 Displays the register size information obtained from `suggest_modifier()` and `default_modifier()`.
…kingjubilee Rollup of 7 pull requests Successful merges: - rust-lang#120419 (Expand sys/os for UEFI) - rust-lang#121940 (Mention Register Size in `#[warn(asm_sub_register)]`) - rust-lang#122762 (fix typo of endianness) - rust-lang#122797 (Fix compile of wasm64-unknown-unknown target) - rust-lang#122875 (CFI: Support self_cell-like recursion) - rust-lang#122879 (CFI: Strip auto traits off Virtual calls) - rust-lang#122969 (Simplify an iterator search in borrowck diag) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#121940 - veera-sivarajan:bugfix-121593, r=fmease Mention Register Size in `#[warn(asm_sub_register)]` Fixes rust-lang#121593 Displays the register size information obtained from `suggest_modifier()` and `default_modifier()`.
Thanks, this is great. :) Would probably be good to have tests for these warnings as well. |
ones aside from the tests for the warnings that already exist? 🤔 |
Uh... I must have been blind when I looked at the PR diff as I saw no test changes. Please ignore me... |
…mease Mention Register Size in `#[warn(asm_sub_register)]` Fixes rust-lang#121593 Displays the register size information obtained from `suggest_modifier()` and `default_modifier()`.
…kingjubilee Rollup of 7 pull requests Successful merges: - rust-lang#120419 (Expand sys/os for UEFI) - rust-lang#121940 (Mention Register Size in `#[warn(asm_sub_register)]`) - rust-lang#122762 (fix typo of endianness) - rust-lang#122797 (Fix compile of wasm64-unknown-unknown target) - rust-lang#122875 (CFI: Support self_cell-like recursion) - rust-lang#122879 (CFI: Strip auto traits off Virtual calls) - rust-lang#122969 (Simplify an iterator search in borrowck diag) r? `@ghost` `@rustbot` modify labels: rollup
…ifierinfo, r=petrochenkov Reduce Size of `ModifierInfo` I added `ModifierInfo` in rust-lang#121940 and had used a `u64` for the `size` field even though the largest value it holds is `512`. This PR changes the type of the `size` field to `u16`.
Rollup merge of rust-lang#123740 - veera-sivarajan:reduce-size-of-modifierinfo, r=petrochenkov Reduce Size of `ModifierInfo` I added `ModifierInfo` in rust-lang#121940 and had used a `u64` for the `size` field even though the largest value it holds is `512`. This PR changes the type of the `size` field to `u16`.
Fixes #121593
Displays the register size information obtained from
suggest_modifier()
anddefault_modifier()
.