-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[wasm] Add PackedSimd bit shift intrinsics #83896
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[wasm] Add PackedSimd bit shift intrinsics #83896
Conversation
Example of code generated for this method:
void Snippet(Vector128<int> vector)
{
var v2 = PackedSimd.ShiftLeft (vector, 3);
var v3 = PackedSimd.ShiftRightArithmetic (vector, 3);
var v4 = PackedSimd.ShiftRightLogical (vector, 3);
Print (vector, v2, v3, v4);
}
Relevant parts:
(func Wasm_Browser_Bench_Sample_Sample_VectorTask_Add_Snippet_System_Runtime_Intrinsics_Vector128_1_int(param $0 i32, $1 i32, $2 i32))
...
local.tee $3
i32.const 3
i32x4.shr.u [SIMD]
v128.store offset:96 align:4 [SIMD]
local.get $0
local.get $3
i32.const 3
i32x4.shr.s [SIMD]
v128.store offset:80 align:4 [SIMD]
local.get $0
local.get $3
i32.const 3
i32x4.shl [SIMD]
v128.store offset:64 align:4 [SIMD]
...
|
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
|
Tagging subscribers to this area: @dotnet/area-system-runtime-intrinsics Issue DetailsExample of code generated for this method: Relevant parts:
|
| MINI_OP(OP_USHLL2, "unsigned_shift_left_long_2", XREG, XREG, IREG) | ||
| MINI_OP(OP_SSHLL, "signed_shift_left_long", XREG, XREG, IREG) | ||
| MINI_OP(OP_SSHLL2, "signed_shift_left_long_2", XREG, XREG, IREG) | ||
| MINI_OP(OP_SHL, "shl", XREG, XREG, IREG) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe name these simd_shl or xshl ?
| {SN_Negate}, | ||
| {SN_ReplaceLane}, | ||
| {SN_ShiftLeft}, | ||
| {SN_ShiftRightArithmetic}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing this to
{SN_ShiftLeft, OP_SHL},
etc. will make this code:
if (op != 0)
return emit_simd_ins_for_sig (cfg, klass, op, c0, arg0_type, fsig, args);
automatically emit it, so the switch case will no longer be neccessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with Zoltan.
|
The failures are unrelated. I will address remaining feedback in the following PR. |
Example of code generated for this method:
Relevant parts: