[wasm] Add WidenUpper and WidenLower SIMD intrins#80117
Merged
radekdoulik merged 2 commits intodotnet:mainfrom Jan 3, 2023
Merged
[wasm] Add WidenUpper and WidenLower SIMD intrins#80117radekdoulik merged 2 commits intodotnet:mainfrom
radekdoulik merged 2 commits intodotnet:mainfrom
Conversation
This improves performance in string related areas. Example code:
> wa-info -d -f Ascii.*WidenFourAsciiBytesToUtf16AndWriteToBuffer dotnet.wasm
(func corlib_System_Text_Ascii_WidenFourAsciiBytesToUtf16AndWriteToBuffer_char__uint(param $0 i32, $1 i32, $2 i32))
local.get $0
i32.eqz
if
call mini_llvmonly_throw_nullref_exception
unreachable
local.get $0
local.get $1
i32x4.splat [SIMD]
i16x8.extend.low.i8x16.u [SIMD]
v128.store64.lane 0 [SIMD]
It is also visible in the bench sample Json task, where it improves
serialization times:
| measurement | before | after |
|-:|-:|-:|
| Json, non-ASCII text serialize | 0.2939ms | 0.2174ms |
| Json, small serialize | 0.0274ms | 0.0262ms |
| Json, large serialize | 7.5466ms | 7.0948ms |
It would be enough to do zero/sign extensions instead of zero shifts, I
left the shifts in place though as I am not sure whether there is
a reason for that on arm64.
vargaz
approved these changes
Jan 3, 2023
lewing
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.
This improves performance in string related areas. Example code:
It is also visible in the bench sample Json task, where it improves serialization times:
It would be enough to do zero/sign extensions instead of zero shifts, I left the shifts in place though as I am not sure whether there is a reason for that on arm64.