[wasm] Add Vector128.Narrow intrinsics#79447
Merged
radekdoulik merged 1 commit intodotnet:mainfrom Dec 9, 2022
Merged
Conversation
Add intrinsics for
i8x16.narrow_i16x8_s(a: v128, b: v128) -> v128
i8x16.narrow_i16x8_u(a: v128, b: v128) -> v128
i16x8.narrow_i32x4_s(a: v128, b: v128) -> v128
i16x8.narrow_i32x4_u(a: v128, b: v128) -> v128
These improve string handling, where the i16x8.narrow_i32x4_u is used.
Like:
> wa-info -d -f corlib_System_Text_ASCIIUtility_ExtractAsciiVector_System_Runtime_Intrinsics_Vector128_1_uint16_System_Runtime_Intrinsics_Vector128_1_uint16 dotnet.wasm
(func corlib_System_Text_ASCIIUtility_ExtractAsciiVector_System_Runtime_Intrinsics_Vector128_1_uint16_System_Runtime_Intrinsics_Vector128_1_uint16(param $0 i32, $1 i32, $2 i32, $3 i32))
local.get $0
local.get $1
v128.load align:4 [SIMD]
local.get $2
v128.load align:4 [SIMD]
i8x16.narrow.i16x8.u [SIMD]
v128.store [SIMD]
> wa-info -d -f corlib_System_Text_ASCIIUtility_NarrowUtf16ToAscii_Intrinsified_char__byte__uintptr dotnet.wasm
(func corlib_System_Text_ASCIIUtility_NarrowUtf16ToAscii_Intrinsified_char__byte__uintptr(param $0 i32, $1 i32, $2 i32, $3 i32) (result i32))
...
v128.load [SIMD]
local.tee $5
v128.const 0xff80ff80ff80ff80ff80ff80ff80ff80 [SIMD]
local.tee $6
v128.and [SIMD]
v128.any.true [SIMD]
br.if
local.get $1
i32.eqz
br.if
local.get $1
local.get $5
local.get $5
i8x16.narrow.i16x8.u [SIMD]
v128.store64.lane 0 [SIMD]
...
It is also measurable in the browser-bench, where
`Json, non-ASCII text deserialize` improves from 0.5048ms to 0.4428ms
for simd on chrome.
vargaz
approved these changes
Dec 9, 2022
Member
Author
Member
Author
|
The tvOS and iOS timeouts are #73539 |
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.
Add intrinsics for
These improve string handling, where the i16x8.narrow_i32x4_u is used.
Like:
It is also measurable in the browser-bench, where
Json, non-ASCII text deserializeimproves from 0.5048ms to 0.4428ms for simd on chrome.