-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Update rustc_codegen_gcc rotate operation document
#145278
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
|
Some changes occurred in compiler/rustc_codegen_gcc |
rustc_codegen_gcc roate operation documentrustc_codegen_gcc rotate operation document
|
r? rustc_codegen_gcc |
|
Failed to set assignee to
|
|
r? antoyo |
|
@GuillaumeGomez i noticed you and @antoyo are the only members of https://github.com/rust-lang/team/blob/main/teams/wg-gcc-backend.toml. Is there anything blocking you from r:ing and not just approving? |
|
Just waiting for @antoyo to have a look. |
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 your contribution.
The next time you want to make changes only in rustc_codegen_gcc, please make a PR directly in the subtree repository.
|
@bors r+ |
…toyo Update `rustc_codegen_gcc` rotate operation document ## Description This PR resolves a TODO comment in the `rustc_codegen_gcc` backend by documenting that the rotate operations (`rotate_left` and `rotate_right`) already implement the optimized branchless algorithm from comment. The existing implementation already uses the optimal branchless rotation pattern: - For left rotation: `(x << n) | (x >> (-n & (width-1)))` - For right rotation: `(x >> n) | (x << (-n & (width-1)))` This pattern avoids branches and generates efficient machine code across different platforms, which was the goal mentioned in the original TODO. ## Changes - Removed the TODO comment that suggested implementing the algorithm from https://blog.regehr.org/archives/1063
Rollup of 11 pull requests Successful merges: - #145278 (Update `rustc_codegen_gcc` rotate operation document) - #148825 (Add SystemTime::{MIN, MAX}) - #148837 (Use `let...else` instead of `match foo { ... _ => return };` and `if let ... else return`) - #149177 (Add proper suggestion for associated function with unknown field) - #149843 (Inherit attributes in delegation) - #149860 (Fix: Prevent macro-expanded extern crates from shadowing extern arguments) - #149874 (Weak for Arc pointer is marked as DynSend/DynSync) - #149903 (Remove unused code in `cfg_old`) - #149911 (bootstrap: Don't pass an unused `--color` to compiletest) - #149916 (Add a sanity check in case of any duplicate nodes) - #149924 (`declare_lint_pass` for `INLINE_ALWAYS_MISMATCHING_TARGET_FEATURES`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 10 pull requests Successful merges: - #145278 (Update `rustc_codegen_gcc` rotate operation document) - #148837 (Use `let...else` instead of `match foo { ... _ => return };` and `if let ... else return`) - #149177 (Add proper suggestion for associated function with unknown field) - #149843 (Inherit attributes in delegation) - #149860 (Fix: Prevent macro-expanded extern crates from shadowing extern arguments) - #149874 (Weak for Arc pointer is marked as DynSend/DynSync) - #149903 (Remove unused code in `cfg_old`) - #149911 (bootstrap: Don't pass an unused `--color` to compiletest) - #149916 (Add a sanity check in case of any duplicate nodes) - #149924 (`declare_lint_pass` for `INLINE_ALWAYS_MISMATCHING_TARGET_FEATURES`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #145278 - notJoon:doc/rotate-operation, r=antoyo Update `rustc_codegen_gcc` rotate operation document ## Description This PR resolves a TODO comment in the `rustc_codegen_gcc` backend by documenting that the rotate operations (`rotate_left` and `rotate_right`) already implement the optimized branchless algorithm from comment. The existing implementation already uses the optimal branchless rotation pattern: - For left rotation: `(x << n) | (x >> (-n & (width-1)))` - For right rotation: `(x >> n) | (x << (-n & (width-1)))` This pattern avoids branches and generates efficient machine code across different platforms, which was the goal mentioned in the original TODO. ## Changes - Removed the TODO comment that suggested implementing the algorithm from https://blog.regehr.org/archives/1063
Description
This PR resolves a TODO comment in the
rustc_codegen_gccbackend by documenting that the rotate operations (rotate_leftandrotate_right) already implement the optimized branchless algorithm from comment.The existing implementation already uses the optimal branchless rotation pattern:
(x << n) | (x >> (-n & (width-1)))(x >> n) | (x << (-n & (width-1)))This pattern avoids branches and generates efficient machine code across different platforms, which was the goal mentioned in the original TODO.
Changes