Skip to content

Replace manual implementation with carrying_mul_add - #147666

Merged
bors merged 1 commit into
rust-lang:masterfrom
Kivooeo:full_mud_add-followup
Oct 15, 2025
Merged

Replace manual implementation with carrying_mul_add#147666
bors merged 1 commit into
rust-lang:masterfrom
Kivooeo:full_mud_add-followup

Conversation

@Kivooeo

Copy link
Copy Markdown
Member

cc #146277 (comment)

r? scottmcm

@rustbotrustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Oct 14, 2025

@scottmcmscottmcm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! It's essentially the same in LLVM, but it'll go through the intrinsic now so other backends can hopefully do the right thing if they need something else.

r=me when CI is green

View changes since this review

(carry as $bigty);
((v >> <$ty>::BITS) as $ty, v as $ty)
let (lo, hi) = self.carrying_mul_add(other, other2, carry);
(hi, lo)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Oh, interesting that this method had picked the opposite order. I guess we were all taught math in big-endian, even if it's kinda worse 🙃

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Yeah, it was not obvious at first, so it took some time to understand why tests are not passing

@Kivooeo

Copy link
Copy Markdown
MemberAuthor

r=me when CI is green

Oh, I can't do it 😅 so I'm worry you will need to r+ it yourself or delegate rights for this one

@Zalathar

Copy link
Copy Markdown
Member

@bors r=scottmcm

@bors

bors commented Oct 14, 2025

Copy link
Copy Markdown
Collaborator

📌 Commit 714843d has been approved by scottmcm

It is now in the queue for this repository.

@borsbors 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 Oct 14, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 14, 2025
…cottmcm
Replace manual implementation with `carrying_mul_add`
cc rust-lang#146277 (comment)
r? scottmcm
bors added a commit that referenced this pull request Oct 14, 2025
Rollup of 7 pull requests
Successful merges:
- #146187 (Unstably constify `ptr::drop_in_place` and related methods)
- #146503 (std: improve handling of timed condition variable waits on macOS)
- #147421 (Add check if span is from macro expansion)
- #147630 (Bitset cleanups)
- #147666 (Replace manual implementation with `carrying_mul_add`)
- #147669 (fix missing link to `std::char` in `std` docs)
- #147673 (pretty print u128 with display)
r? `@ghost`
`@rustbot` modify labels: rollup
jdonszelmann added a commit to jdonszelmann/rust that referenced this pull request Oct 14, 2025
…cottmcm
Replace manual implementation with `carrying_mul_add`
cc rust-lang#146277 (comment)
r? scottmcm
bors added a commit that referenced this pull request Oct 14, 2025
Rollup of 7 pull requests
Successful merges:
- #146187 (Unstably constify `ptr::drop_in_place` and related methods)
- #146503 (std: improve handling of timed condition variable waits on macOS)
- #147421 (Add check if span is from macro expansion)
- #147630 (Bitset cleanups)
- #147666 (Replace manual implementation with `carrying_mul_add`)
- #147669 (fix missing link to `std::char` in `std` docs)
- #147673 (pretty print u128 with display)
r? `@ghost`
`@rustbot` modify labels: rollup
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 14, 2025
…cottmcm
Replace manual implementation with `carrying_mul_add`
cc rust-lang#146277 (comment)
r? scottmcm
This was referenced Oct 14, 2025
bors added a commit that referenced this pull request Oct 14, 2025
Rollup of 12 pull requests
Successful merges:
- #146187 (Unstably constify `ptr::drop_in_place` and related methods)
- #146503 (std: improve handling of timed condition variable waits on macOS)
- #147526 (Move computation of allocator shim contents to cg_ssa)
- #147630 (Bitset cleanups)
- #147638 (bpf: return results larger than one register indirectly)
- #147666 (Replace manual implementation with `carrying_mul_add`)
- #147669 (fix missing link to `std::char` in `std` docs)
- #147673 (pretty print u128 with display)
- #147677 (Fewer exceptions in `span()` on parsed attributes)
- #147680 (Fix ICE caused by associated_item_def_ids on wrong type in resolve diag)
- #147682 (convert `rustc_main` to the new attribute parsing infrastructure)
- #147683 (only check duplicates on old/unparsed attributes)
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit 49be94c into rust-lang:masterOct 15, 2025
10 checks passed
@rustbotrustbot added this to the 1.92.0 milestone Oct 15, 2025
rust-timer added a commit that referenced this pull request Oct 15, 2025
Rollup merge of #147666 - Kivooeo:full_mud_add-followup, r=scottmcm
Replace manual implementation with `carrying_mul_add`
cc #146277 (comment)
r? scottmcm
github-actionsBot pushed a commit to rust-lang/miri that referenced this pull request Oct 15, 2025
Rollup of 12 pull requests
Successful merges:
- rust-lang/rust#146187 (Unstably constify `ptr::drop_in_place` and related methods)
- rust-lang/rust#146503 (std: improve handling of timed condition variable waits on macOS)
- rust-lang/rust#147526 (Move computation of allocator shim contents to cg_ssa)
- rust-lang/rust#147630 (Bitset cleanups)
- rust-lang/rust#147638 (bpf: return results larger than one register indirectly)
- rust-lang/rust#147666 (Replace manual implementation with `carrying_mul_add`)
- rust-lang/rust#147669 (fix missing link to `std::char` in `std` docs)
- rust-lang/rust#147673 (pretty print u128 with display)
- rust-lang/rust#147677 (Fewer exceptions in `span()` on parsed attributes)
- rust-lang/rust#147680 (Fix ICE caused by associated_item_def_ids on wrong type in resolve diag)
- rust-lang/rust#147682 (convert `rustc_main` to the new attribute parsing infrastructure)
- rust-lang/rust#147683 (only check duplicates on old/unparsed attributes)
r? `@ghost`
`@rustbot` modify labels: rollup
github-actionsBot pushed a commit to rust-lang/rust-analyzer that referenced this pull request Nov 3, 2025
Rollup of 12 pull requests
Successful merges:
- rust-lang/rust#146187 (Unstably constify `ptr::drop_in_place` and related methods)
- rust-lang/rust#146503 (std: improve handling of timed condition variable waits on macOS)
- rust-lang/rust#147526 (Move computation of allocator shim contents to cg_ssa)
- rust-lang/rust#147630 (Bitset cleanups)
- rust-lang/rust#147638 (bpf: return results larger than one register indirectly)
- rust-lang/rust#147666 (Replace manual implementation with `carrying_mul_add`)
- rust-lang/rust#147669 (fix missing link to `std::char` in `std` docs)
- rust-lang/rust#147673 (pretty print u128 with display)
- rust-lang/rust#147677 (Fewer exceptions in `span()` on parsed attributes)
- rust-lang/rust#147680 (Fix ICE caused by associated_item_def_ids on wrong type in resolve diag)
- rust-lang/rust#147682 (convert `rustc_main` to the new attribute parsing infrastructure)
- rust-lang/rust#147683 (only check duplicates on old/unparsed attributes)
r? `@ghost`
`@rustbot` modify labels: rollup
github-actionsBot pushed a commit to model-checking/verify-rust-std that referenced this pull request Nov 30, 2025
…cottmcm
Replace manual implementation with `carrying_mul_add`
cc rust-lang#146277 (comment)
r? scottmcm
Kobzol pushed a commit to Kobzol/rustc_codegen_gcc that referenced this pull request Dec 21, 2025
Rollup of 12 pull requests
Successful merges:
- rust-lang/rust#146187 (Unstably constify `ptr::drop_in_place` and related methods)
- rust-lang/rust#146503 (std: improve handling of timed condition variable waits on macOS)
- rust-lang/rust#147526 (Move computation of allocator shim contents to cg_ssa)
- rust-lang/rust#147630 (Bitset cleanups)
- rust-lang/rust#147638 (bpf: return results larger than one register indirectly)
- rust-lang/rust#147666 (Replace manual implementation with `carrying_mul_add`)
- rust-lang/rust#147669 (fix missing link to `std::char` in `std` docs)
- rust-lang/rust#147673 (pretty print u128 with display)
- rust-lang/rust#147677 (Fewer exceptions in `span()` on parsed attributes)
- rust-lang/rust#147680 (Fix ICE caused by associated_item_def_ids on wrong type in resolve diag)
- rust-lang/rust#147682 (convert `rustc_main` to the new attribute parsing infrastructure)
- rust-lang/rust#147683 (only check duplicates on old/unparsed attributes)
r? `@ghost`
`@rustbot` modify labels: rollup
Kobzol pushed a commit to Kobzol/rustc_codegen_cranelift that referenced this pull request Dec 29, 2025
Rollup of 12 pull requests
Successful merges:
- rust-lang/rust#146187 (Unstably constify `ptr::drop_in_place` and related methods)
- rust-lang/rust#146503 (std: improve handling of timed condition variable waits on macOS)
- rust-lang/rust#147526 (Move computation of allocator shim contents to cg_ssa)
- rust-lang/rust#147630 (Bitset cleanups)
- rust-lang/rust#147638 (bpf: return results larger than one register indirectly)
- rust-lang/rust#147666 (Replace manual implementation with `carrying_mul_add`)
- rust-lang/rust#147669 (fix missing link to `std::char` in `std` docs)
- rust-lang/rust#147673 (pretty print u128 with display)
- rust-lang/rust#147677 (Fewer exceptions in `span()` on parsed attributes)
- rust-lang/rust#147680 (Fix ICE caused by associated_item_def_ids on wrong type in resolve diag)
- rust-lang/rust#147682 (convert `rustc_main` to the new attribute parsing infrastructure)
- rust-lang/rust#147683 (only check duplicates on old/unparsed attributes)
r? `@ghost`
`@rustbot` modify labels: rollup
christian-schilling pushed a commit to christian-schilling/rustc_codegen_cranelift that referenced this pull request Jan 27, 2026
Rollup of 12 pull requests
Successful merges:
- rust-lang/rust#146187 (Unstably constify `ptr::drop_in_place` and related methods)
- rust-lang/rust#146503 (std: improve handling of timed condition variable waits on macOS)
- rust-lang/rust#147526 (Move computation of allocator shim contents to cg_ssa)
- rust-lang/rust#147630 (Bitset cleanups)
- rust-lang/rust#147638 (bpf: return results larger than one register indirectly)
- rust-lang/rust#147666 (Replace manual implementation with `carrying_mul_add`)
- rust-lang/rust#147669 (fix missing link to `std::char` in `std` docs)
- rust-lang/rust#147673 (pretty print u128 with display)
- rust-lang/rust#147677 (Fewer exceptions in `span()` on parsed attributes)
- rust-lang/rust#147680 (Fix ICE caused by associated_item_def_ids on wrong type in resolve diag)
- rust-lang/rust#147682 (convert `rustc_main` to the new attribute parsing infrastructure)
- rust-lang/rust#147683 (only check duplicates on old/unparsed attributes)
r? `@ghost`
`@rustbot` modify labels: rollup
christian-schilling pushed a commit to christian-schilling/rustc_codegen_cranelift that referenced this pull request Jan 27, 2026
Rollup of 12 pull requests
Successful merges:
- rust-lang/rust#146187 (Unstably constify `ptr::drop_in_place` and related methods)
- rust-lang/rust#146503 (std: improve handling of timed condition variable waits on macOS)
- rust-lang/rust#147526 (Move computation of allocator shim contents to cg_ssa)
- rust-lang/rust#147630 (Bitset cleanups)
- rust-lang/rust#147638 (bpf: return results larger than one register indirectly)
- rust-lang/rust#147666 (Replace manual implementation with `carrying_mul_add`)
- rust-lang/rust#147669 (fix missing link to `std::char` in `std` docs)
- rust-lang/rust#147673 (pretty print u128 with display)
- rust-lang/rust#147677 (Fewer exceptions in `span()` on parsed attributes)
- rust-lang/rust#147680 (Fix ICE caused by associated_item_def_ids on wrong type in resolve diag)
- rust-lang/rust#147682 (convert `rustc_main` to the new attribute parsing infrastructure)
- rust-lang/rust#147683 (only check duplicates on old/unparsed attributes)
r? `@ghost`
`@rustbot` modify labels: rollup
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-libsRelevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@Kivooeo@Zalathar@bors@scottmcm@rustbot