Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upUse LLVM intrinsics for saturating add/sub #58003
Conversation
rust-highfive
assigned
nagisa
Jan 30, 2019
rust-highfive
added
the
S-waiting-on-review
label
Jan 30, 2019
This comment has been minimized.
This comment has been minimized.
The PR looks good, although I think I’d like a codegen test, especially for our own lowering. Alas we do not have @bors r+ |
This comment has been minimized.
This comment has been minimized.
|
bors
added
S-waiting-on-bors
and removed
S-waiting-on-review
labels
Jan 30, 2019
This comment has been minimized.
This comment has been minimized.
|
This comment has been minimized.
This comment has been minimized.
|
This comment has been minimized.
This comment has been minimized.
Oh, and recalling one such similar PR, we had a fairly big perf. regression there: #56009. I wonder how this will fare... |
This comment has been minimized.
This comment has been minimized.
added a commit
that referenced
this pull request
Jan 31, 2019
This comment has been minimized.
This comment has been minimized.
|
bors
added
S-waiting-on-review
and removed
S-waiting-on-bors
labels
Jan 31, 2019
This comment has been minimized.
This comment has been minimized.
@bors retry Failure looks spurious. |
bors
added
S-waiting-on-bors
and removed
S-waiting-on-review
labels
Jan 31, 2019
mati865
referenced this pull request
Jan 31, 2019
Merged
proc_macro: make `TokenStream::from_streams` pre-allocate its vector. #58001
This comment has been minimized.
This comment has been minimized.
added a commit
that referenced
this pull request
Jan 31, 2019
pnkfelix
referenced this pull request
Jan 31, 2019
Closed
AppVeyor spuriously killing a dist- job with message "Build exceeded allowed resource quotas" #58025
This comment has been minimized.
This comment has been minimized.
|
bors
merged commit 4a4186e
into
rust-lang:master
Jan 31, 2019
1 check passed
This comment has been minimized.
This comment has been minimized.
added a commit
to rust-lang-nursery/rust-toolstate
that referenced
this pull request
Jan 31, 2019
oli-obk
referenced this pull request
Jan 31, 2019
Closed
Make `saturating_add` and `saturating_sub` `const` functions #58030
This comment has been minimized.
This comment has been minimized.
Cool, these also should work on vector types. |
nikic commentedJan 30, 2019
•
edited
Use the
[su](add|sub).sat
LLVM intrinsics, if we're compiling against LLVM 8, as they should optimize and codegen better than IR based on[su](add|sub).with.overlow
.For the fallback for LLVM < 8 I'm using the same expansion that target lowering in LLVM uses, which is not the same as Rust currently uses (in particular due to the use of selects rather than branches).
Fixes #55286.
Fixes #52203.
Fixes #44500.
r? @nagisa