-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit efb02eb
authored
Rollup merge of #146699 - heiher:is-ascii-lsx, r=Mark-Simulacrum
Add `is_ascii` function optimized for LoongArch64 for [u8]
Similar to x86_64, on LoongArch64 we use the `vmskltz.b` instruction to test the high bit in a lane.
For longer input cases, the performance improvement is significant. For unaligned cases close to 32 bytes in length, there's some regression, but it seems acceptable.
| core benches (MB/s) | Before | After | % |
|--------------------------------------------------------|--------|--------|---------|
| ascii::is_ascii::short::case00_libcore | 1000 | 1000 | 0.00 |
| ascii::is_ascii::medium::case00_libcore | 8000 | 8000 | 0.00 |
| ascii::is_ascii::long::case00_libcore | 183947 | 436875 | +137.50 |
| ascii::is_ascii::unaligned_head_medium::case00_libcore | 7750 | 2818 | -63.64 |
| ascii::is_ascii::unaligned_head_long::case00_libcore | 317681 | 436812 | +37.50 |
| ascii::is_ascii::unaligned_tail_medium::case00_libcore | 7750 | 3444 | -55.56 |
| ascii::is_ascii::unaligned_tail_long::case00_libcore | 155311 | 436812 | +181.25 |
| ascii::is_ascii::unaligned_both_medium::case00_libcore | 7500 | 3333 | -55.56 |
| ascii::is_ascii::unaligned_both_long::case00_libcore | 174700 | 436750 | +150.00 |File tree
Expand file treeCollapse file tree
0 file changed
+0
-0
lines changedOpen diff view settings
Filter options
Expand file treeCollapse file tree
0 file changed
+0
-0
lines changedOpen diff view settings
0 commit comments