-
Notifications
You must be signed in to change notification settings - Fork 319
Add support for most Wasm simd instructions to the wasmi crate
#1421
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
Merged
Conversation
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
This allows it to be reused in submodules.
These are unary instructions, thus it is trivial to execute them at translation time when the input is an immediate value.
This allows this macro to be re-used elsewhere.
simd proposal's v128.const and splat opssimd proposal instruction translation and execution
simd proposal instruction translation and executionsimd proposal instructions
simd proposal instructionssimd instructions
We rename this because it can be re-used for v128 store translation.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1421 +/- ##
==========================================
+ Coverage 67.18% 69.09% +1.91%
==========================================
Files 159 161 +2
Lines 15169 15724 +555
==========================================
+ Hits 10191 10865 +674
+ Misses 4978 4859 -119 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This makes it more flexible and usable for SIMD shift ops.
simd instructionssimd instructions in the wasmi crate
simd instructions in the wasmi cratesimd instructions to the wasmi crate
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Implemented Wasm
simdproposal instructions in this PR:This does not implement support for the following SIMD instructions:
replace_laneinstructionsloadinstructionsstoreinstructions➡️: means that this instructions is going to be implemented in a follow-up PR.
simdInstructionv128.const(imm: ImmByte[16]) -> v128i8x16.splat(x: i32) -> v128i16x8.splat(x: i32) -> v128i32x4.splat(x: i32) -> v128i64x2.splat(x: i64) -> v128f32x4.splat(x: f32) -> v128f64x2.splat(x: f64) -> v128i8x16.extract_lane_s(a: v128, imm: ImmLaneIdx16) -> i32i8x16.extract_lane_u(a: v128, imm: ImmLaneIdx16) -> i32i16x8.extract_lane_s(a: v128, imm: ImmLaneIdx8) -> i32i16x8.extract_lane_u(a: v128, imm: ImmLaneIdx8) -> i32i32x4.extract_lane(a: v128, imm: ImmLaneIdx4) -> i32i64x2.extract_lane(a: v128, imm: ImmLaneIdx2) -> i64f32x4.extract_lane(a: v128, imm: ImmLaneIdx4) -> f32f64x2.extract_lane(a: v128, imm: ImmLaneIdx2) -> f64i8x16.replace_lane(a: v128, imm: ImmLaneIdx16, x: i32) -> v128i16x8.replace_lane(a: v128, imm: ImmLaneIdx8, x: i32) -> v128i32x4.replace_lane(a: v128, imm: ImmLaneIdx4, x: i32) -> v128i64x2.replace_lane(a: v128, imm: ImmLaneIdx2, x: i64) -> v128f32x4.replace_lane(a: v128, imm: ImmLaneIdx4, x: f32) -> v128f64x2.replace_lane(a: v128, imm: ImmLaneIdx2, x: f64) -> v128i8x16.shuffle(a: v128, b: v128, imm: ImmLaneIdx32[16]) -> v128i8x16.swizzle(a: v128, s: v128) -> v128i8x16.add(a: v128, b: v128) -> v128i16x8.add(a: v128, b: v128) -> v128i32x4.add(a: v128, b: v128) -> v128i64x2.add(a: v128, b: v128) -> v128i8x16.sub(a: v128, b: v128) -> v128i16x8.sub(a: v128, b: v128) -> v128i32x4.sub(a: v128, b: v128) -> v128i64x2.sub(a: v128, b: v128) -> v128i16x8.mul(a: v128, b: v128) -> v128i32x4.mul(a: v128, b: v128) -> v128i64x2.mul(a: v128, b: v128) -> v128i32x4.dot_i16x8_s(a: v128, b: v128) -> v128i8x16.neg(a: v128) -> v128i16x8.neg(a: v128) -> v128i32x4.neg(a: v128) -> v128i64x2.neg(a: v128) -> v128i16x8.extmul_low_i8x16_s(a: v128, b: v128) -> v128i16x8.extmul_high_i8x16_s(a: v128, b: v128) -> v128i16x8.extmul_low_i8x16_u(a: v128, b: v128) -> v128i16x8.extmul_high_i8x16_u(a: v128, b: v128) -> v128i32x4.extmul_low_i16x8_s(a: v128, b: v128) -> v128i32x4.extmul_high_i16x8_s(a: v128, b: v128) -> v128i32x4.extmul_low_i16x8_u(a: v128, b: v128) -> v128i32x4.extmul_high_i16x8_u(a: v128, b: v128) -> v128i64x2.extmul_low_i32x4_s(a: v128, b: v128) -> v128i64x2.extmul_high_i32x4_s(a: v128, b: v128) -> v128i64x2.extmul_low_i32x4_u(a: v128, b: v128) -> v128i64x2.extmul_high_i32x4_u(a: v128, b: v128) -> v128i16x8.extadd_pairwise_i8x16_s(a: v128) -> v128i16x8.extadd_pairwise_i8x16_u(a: v128) -> v128i32x4.extadd_pairwise_i16x8_s(a: v128) -> v128i32x4.extadd_pairwise_i16x8_u(a: v128) -> v128i8x16.add_sat_s(a: v128, b: v128) -> v128i8x16.add_sat_u(a: v128, b: v128) -> v128i16x8.add_sat_s(a: v128, b: v128) -> v128i16x8.add_sat_u(a: v128, b: v128) -> v128i8x16.sub_sat_s(a: v128, b: v128) -> v128i8x16.sub_sat_u(a: v128, b: v128) -> v128i16x8.sub_sat_s(a: v128, b: v128) -> v128i16x8.sub_sat_u(a: v128, b: v128) -> v128i16x8.q15mulr_sat_s(a: v128, b: v128) -> v128i8x16.min_s(a: v128, b: v128) -> v128i8x16.min_u(a: v128, b: v128) -> v128i16x8.min_s(a: v128, b: v128) -> v128i16x8.min_u(a: v128, b: v128) -> v128i32x4.min_s(a: v128, b: v128) -> v128i32x4.min_u(a: v128, b: v128) -> v128i8x16.max_s(a: v128, b: v128) -> v128i8x16.max_u(a: v128, b: v128) -> v128i16x8.max_s(a: v128, b: v128) -> v128i16x8.max_u(a: v128, b: v128) -> v128i32x4.max_s(a: v128, b: v128) -> v128i32x4.max_u(a: v128, b: v128) -> v128i8x16.avgr_u(a: v128, b: v128) -> v128i16x8.avgr_u(a: v128, b: v128) -> v128i8x16.abs(a: v128) -> v128i16x8.abs(a: v128) -> v128i32x4.abs(a: v128) -> v128i64x2.abs(a: v128) -> v128i8x16.shl(a: v128, y: i32) -> v128i16x8.shl(a: v128, y: i32) -> v128i32x4.shl(a: v128, y: i32) -> v128i64x2.shl(a: v128, y: i32) -> v128i8x16.shr_s(a: v128, y: i32) -> v128i8x16.shr_u(a: v128, y: i32) -> v128i16x8.shr_s(a: v128, y: i32) -> v128i16x8.shr_u(a: v128, y: i32) -> v128i32x4.shr_s(a: v128, y: i32) -> v128i32x4.shr_u(a: v128, y: i32) -> v128i64x2.shr_s(a: v128, y: i32) -> v128i64x2.shr_u(a: v128, y: i32) -> v128v128.and(a: v128, b: v128) -> v128v128.or(a: v128, b: v128) -> v128v128.xor(a: v128, b: v128) -> v128v128.not(a: v128) -> v128v128.andnot(a: v128, b: v128) -> v128v128.bitselect(v1: v128, v2: v128, c: v128) -> v128i8x16.popcnt(v: v128) -> v128v128.any_true(a: v128) -> i32i8x16.all_true(a: v128) -> i32i16x8.all_true(a: v128) -> i32i32x4.all_true(a: v128) -> i32i64x2.all_true(a: v128) -> i32i8x16.bitmask(a: v128) -> i32i16x8.bitmask(a: v128) -> i32i32x4.bitmask(a: v128) -> i32i64x2.bitmask(a: v128) -> i32i8x16.eq(a: v128, b: v128) -> v128i16x8.eq(a: v128, b: v128) -> v128i32x4.eq(a: v128, b: v128) -> v128i64x2.eq(a: v128, b: v128) -> v128f32x4.eq(a: v128, b: v128) -> v128f64x2.eq(a: v128, b: v128) -> v128i8x16.ne(a: v128, b: v128) -> v128i16x8.ne(a: v128, b: v128) -> v128i32x4.ne(a: v128, b: v128) -> v128i64x2.ne(a: v128, b: v128) -> v128f32x4.ne(a: v128, b: v128) -> v128f64x2.ne(a: v128, b: v128) -> v128i8x16.lt_s(a: v128, b: v128) -> v128i8x16.lt_u(a: v128, b: v128) -> v128i16x8.lt_s(a: v128, b: v128) -> v128i16x8.lt_u(a: v128, b: v128) -> v128i32x4.lt_s(a: v128, b: v128) -> v128i32x4.lt_u(a: v128, b: v128) -> v128i64x2.lt_s(a: v128, b: v128) -> v128f32x4.lt(a: v128, b: v128) -> v128f64x2.lt(a: v128, b: v128) -> v128i8x16.le_s(a: v128, b: v128) -> v128i8x16.le_u(a: v128, b: v128) -> v128i16x8.le_s(a: v128, b: v128) -> v128i16x8.le_u(a: v128, b: v128) -> v128i32x4.le_s(a: v128, b: v128) -> v128i32x4.le_u(a: v128, b: v128) -> v128i64x2.le_s(a: v128, b: v128) -> v128f32x4.le(a: v128, b: v128) -> v128f64x2.le(a: v128, b: v128) -> v128i8x16.gt_s(a: v128, b: v128) -> v128i8x16.gt_u(a: v128, b: v128) -> v128i16x8.gt_s(a: v128, b: v128) -> v128i16x8.gt_u(a: v128, b: v128) -> v128i32x4.gt_s(a: v128, b: v128) -> v128i32x4.gt_u(a: v128, b: v128) -> v128i64x2.gt_s(a: v128, b: v128) -> v128f32x4.gt(a: v128, b: v128) -> v128f64x2.gt(a: v128, b: v128) -> v128i8x16.ge_s(a: v128, b: v128) -> v128i8x16.ge_u(a: v128, b: v128) -> v128i16x8.ge_s(a: v128, b: v128) -> v128i16x8.ge_u(a: v128, b: v128) -> v128i32x4.ge_s(a: v128, b: v128) -> v128i32x4.ge_u(a: v128, b: v128) -> v128i64x2.ge_s(a: v128, b: v128) -> v128f32x4.ge(a: v128, b: v128) -> v128f64x2.ge(a: v128, b: v128) -> v128v128.load(m: memarg) -> v128v128.load32_zero(m: memarg) -> v128v128.load64_zero(m: memarg) -> v128v128.load8_splat(m: memarg) -> v128v128.load16_splat(m: memarg) -> v128v128.load32_splat(m: memarg) -> v128v128.load64_splat(m: memarg) -> v128v128.load8_lane(m: memarg, x: v128, imm: ImmLaneIdx16) -> v128v128.load16_lane(m: memarg, x: v128, imm: ImmLaneIdx8) -> v128v128.load32_lane(m: memarg, x: v128, imm: ImmLaneIdx4) -> v128v128.load64_lane(m: memarg, x: v128, imm: ImmLaneIdx2) -> v128v128.load8x8_s(m: memarg)v128.load8x8_u(m: memarg)v128.load16x4_s(m: memarg)v128.load16x4_u(m: memarg)v128.load32x2_s(m: memarg)v128.load32x2_u(m: memarg)v128.store(m: memarg, data: v128)v128.store8_lane(m: memarg, data: v128, imm: ImmLaneIdx16)v128.store16_lane(m: memarg, data: v128, imm: ImmLaneIdx8)v128.store32_lane(m: memarg, data: v128, imm: ImmLaneIdx4)v128.store64_lane(m: memarg, data: v128, imm: ImmLaneIdx2)f32x4.neg(a: v128) -> v128f64x2.neg(a: v128) -> v128f32x4.abs(a: v128) -> v128f64x2.abs(a: v128) -> v128f32x4.min(a: v128, b: v128) -> v128f64x2.min(a: v128, b: v128) -> v128f32x4.max(a: v128, b: v128) -> v128f64x2.max(a: v128, b: v128) -> v128f32x4.pmin(a: v128, b: v128) -> v128f64x2.pmin(a: v128, b: v128) -> v128f32x4.pmax(a: v128, b: v128) -> v128f64x2.pmax(a: v128, b: v128) -> v128f32x4.add(a: v128, b: v128) -> v128f64x2.add(a: v128, b: v128) -> v128f32x4.sub(a: v128, b: v128) -> v128f64x2.sub(a: v128, b: v128) -> v128f32x4.div(a: v128, b: v128) -> v128f64x2.div(a: v128, b: v128) -> v128f32x4.mul(a: v128, b: v128) -> v128f64x2.mul(a: v128, b: v128) -> v128f32x4.sqrt(a: v128) -> v128f64x2.sqrt(a: v128) -> v128f32x4.ceil(a: v128) -> v128f64x2.ceil(a: v128) -> v128f32x4.floor(a: v128) -> v128f64x2.floor(a: v128) -> v128f32x4.trunc(a: v128) -> v128f64x2.trunc(a: v128) -> v128f32x4.nearest(a: v128) -> v128f64x2.nearest(a: v128) -> v128f32x4.convert_i32x4_s(a: v128) -> v128f32x4.convert_i32x4_u(a: v128) -> v128f64x2.convert_low_i32x4_s(a: v128) -> v128f64x2.convert_low_i32x4_u(a: v128) -> v128i32x4.trunc_sat_f32x4_s(a: v128) -> v128i32x4.trunc_sat_f32x4_u(a: v128) -> v128i32x4.trunc_sat_f64x2_s_zero(a: v128) -> v128i32x4.trunc_sat_f64x2_u_zero(a: v128) -> v128f32x4.demote_f64x2_zero(a: v128) -> v128f64x2.promote_low_f32x4(a: v128) -> v128i8x16.narrow_i16x8_s(a: v128, b: v128) -> v128i8x16.narrow_i16x8_u(a: v128, b: v128) -> v128i16x8.narrow_i32x4_s(a: v128, b: v128) -> v128i16x8.narrow_i32x4_u(a: v128, b: v128) -> v128i16x8.extend_low_i8x16_s(a: v128) -> v128i16x8.extend_high_i8x16_s(a: v128) -> v128i16x8.extend_low_i8x16_u(a: v128) -> v128i16x8.extend_high_i8x16_u(a: v128) -> v128i32x4.extend_low_i16x8_s(a: v128) -> v128i32x4.extend_high_i16x8_s(a: v128) -> v128i32x4.extend_low_i16x8_u(a: v128) -> v128i32x4.extend_high_i16x8_u(a: v128) -> v128i64x2.extend_low_i32x4_s(a: v128) -> v128i64x2.extend_high_i32x4_s(a: v128) -> v128i64x2.extend_low_i32x4_u(a: v128) -> v128i64x2.extend_high_i32x4_u(a: v128) -> v128