Commit 73c3905
committed
Add
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 |is_ascii function optimized for LoongArch64 for [u8]1 parent 9311767 commit 73c3905
1 file changed
+14
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
7 | 10 | | |
8 | 11 | | |
9 | 12 | | |
| |||
357 | 360 | | |
358 | 361 | | |
359 | 362 | | |
360 | | - | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
361 | 367 | | |
362 | 368 | | |
363 | 369 | | |
| |||
455 | 461 | | |
456 | 462 | | |
457 | 463 | | |
458 | | - | |
459 | | - | |
| 464 | + | |
| 465 | + | |
460 | 466 | | |
461 | 467 | | |
462 | 468 | | |
463 | | - | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
464 | 473 | | |
465 | 474 | | |
466 | 475 | | |
| |||
0 commit comments