[wasm] Add ConditionalSelect SIMD intrinsics#80145
Merged
radekdoulik merged 1 commit intodotnet:mainfrom Jan 4, 2023
Merged
Conversation
It uses existing `OP_BSL`, which does And, Not, And and Or operations.
llvm emits it as `v128.bitselect` for us. So I think we don't need
to use the `llvm.wasm.bitselect.*` intrinsics.
This should help in few areas, SpanHelper.ReplaceValueType and
IndexOfAnyAsciiSearcher.IndexOfAnyLookup'1.
It improves the Json deserialization a bit:
| measurement | before | after |
|-:|-:|-:|
| Json, non-ASCII text deserialize | 0.4343ms | 0.4275ms |
| Json, small deserialize | 0.0517ms | 0.0497ms |
| Json, large deserialize | 14.3995ms | 13.8217ms |
Example of emitted code:
> wa-info -d -f SpanHelper.*ReplaceValueType src\mono\sample\wasm\browser-bench\bin\Release\AppBundle\dotnet.wasm
(func corlib_System_SpanHelpers_ReplaceValueType_uint16_uint16__uint16__uint16_uint16_uintptr(param $0 i32, $1 i32, $2 i32, $3 i32, $4 i32, $5 i32))
...
i16x8.eq [SIMD]
v128.bitselect [SIMD]
v128.store [SIMD]
...
Member
Author
|
Changes in the |
vargaz
approved these changes
Jan 3, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It uses existing
OP_BSL, which does And, Not, And and Or operations. llvm emits it asv128.bitselectfor us. So I think we don't need to use thellvm.wasm.bitselect.*intrinsics.This should help in few areas, SpanHelper.ReplaceValueType and IndexOfAnyAsciiSearcher.IndexOfAnyLookup'1.
It improves the Json deserialization a bit:
Example of emitted code: