Skip to content
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

Automatic Rustup #4111

Merged
merged 19 commits into from
Dec 27, 2024
Merged
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
2b8e73a
Auto merge of #134604 - RalfJung:miri-sync, r=RalfJung
bors Dec 21, 2024
6b4e2c7
Auto merge of #134501 - lcnr:member-constraints-yeet, r=oli-obk
bors Dec 21, 2024
9c7674d
Auto merge of #134505 - jieyouxu:boop-compiler-cc, r=clubby789,jieyouxu
bors Dec 21, 2024
2f1f0b8
Auto merge of #134268 - lqd:polonius-next, r=jackh726
bors Dec 21, 2024
cc5cbb0
Auto merge of #130733 - okaneco:is_ascii, r=scottmcm
bors Dec 22, 2024
5a3169d
Auto merge of #134326 - scottmcm:slice-drop-shim-ptrmetadata, r=saethlin
bors Dec 22, 2024
6f96f2b
Auto merge of #131193 - EFanZh:asserts-vec-len, r=the8472
bors Dec 22, 2024
2d148a9
Auto merge of #134465 - lcnr:type-verifier, r=compiler-errors
bors Dec 23, 2024
17297cd
Auto merge of #134608 - DianQK:disable-93775, r=jieyouxu
bors Dec 23, 2024
b89ef6d
Auto merge of #134405 - rmehri01:x-completions, r=onur-ozkan
bors Dec 23, 2024
da9ce2d
Auto merge of #134513 - fudancoder:master, r=jieyouxu
bors Dec 24, 2024
0c1f85b
Auto merge of #134724 - onur-ozkan:type-improvements, r=jieyouxu
bors Dec 24, 2024
6cf9d8e
Auto merge of #134703 - poliorcetics:ab/push-ovsylkzsoxku, r=Guillaum…
bors Dec 25, 2024
49dc1a9
Auto merge of #134784 - RalfJung:miri-sync, r=RalfJung
bors Dec 26, 2024
825ea5c
Auto merge of #134774 - jyn514:rustc-dev-short-backtraces, r=jieyouxu
bors Dec 26, 2024
272cb41
Auto merge of #134788 - flip1995:clippy-subtree-update, r=matthiaskrgr
bors Dec 26, 2024
bdf4967
Preparing for merge from rustc
Dec 27, 2024
b69648d
Merge from rustc
Dec 27, 2024
0308d17
clippy
RalfJung Dec 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Auto merge of #130733 - okaneco:is_ascii, r=scottmcm
Optimize `is_ascii` for `str` and `[u8]` further

Replace the existing optimized function with one that enables auto-vectorization.

This is especially beneficial on x86-64 as `pmovmskb` can be emitted with careful structuring of the code. The instruction can detect non-ASCII characters one vector register width at a time instead of the current `usize` at a time check.

The resulting implementation is completely safe.

`case00_libcore` is the current implementation, `case04_while_loop` is this PR.
```
benchmarks:
    ascii::is_ascii_slice::long::case00_libcore                             22.25/iter  +/- 1.09
    ascii::is_ascii_slice::long::case04_while_loop                           6.78/iter  +/- 0.92
    ascii::is_ascii_slice::medium::case00_libcore                            2.81/iter  +/- 0.39
    ascii::is_ascii_slice::medium::case04_while_loop                         1.56/iter  +/- 0.78
    ascii::is_ascii_slice::short::case00_libcore                             5.55/iter  +/- 0.85
    ascii::is_ascii_slice::short::case04_while_loop                          3.75/iter  +/- 0.22
    ascii::is_ascii_slice::unaligned_both_long::case00_libcore              26.59/iter  +/- 0.66
    ascii::is_ascii_slice::unaligned_both_long::case04_while_loop            5.78/iter  +/- 0.16
    ascii::is_ascii_slice::unaligned_both_medium::case00_libcore             2.97/iter  +/- 0.32
    ascii::is_ascii_slice::unaligned_both_medium::case04_while_loop          2.41/iter  +/- 0.10
    ascii::is_ascii_slice::unaligned_head_long::case00_libcore              23.71/iter  +/- 0.79
    ascii::is_ascii_slice::unaligned_head_long::case04_while_loop            7.83/iter  +/- 1.31
    ascii::is_ascii_slice::unaligned_head_medium::case00_libcore             3.69/iter  +/- 0.54
    ascii::is_ascii_slice::unaligned_head_medium::case04_while_loop          7.05/iter  +/- 0.32
    ascii::is_ascii_slice::unaligned_tail_long::case00_libcore              24.44/iter  +/- 1.41
    ascii::is_ascii_slice::unaligned_tail_long::case04_while_loop            5.12/iter  +/- 0.18
    ascii::is_ascii_slice::unaligned_tail_medium::case00_libcore             3.24/iter  +/- 0.40
    ascii::is_ascii_slice::unaligned_tail_medium::case04_while_loop          2.86/iter  +/- 0.14

```

`unaligned_head_medium` is the main regression in the benchmarks. It is a 32 byte string being sliced `bytes[1..]`.

The first commit can be used to run the benchmarks against the current core implementation.

Previous implementation was done in #74066

---

Two potential drawbacks of this implementation are that it increases instruction count and may regress other platforms/architectures. The benches here may also be too artificial to glean much insight from.
https://rust.godbolt.org/z/G9znGfY36
  • Loading branch information
bors committed Dec 22, 2024
commit cc5cbb0dd74f438f89908009ce6694c069ff17f5

This merge commit was added into this branch cleanly.

There are no new changes to show, but you can still view the diff.