diff options
author | Ng Zhi An <zhin@chromium.org> | 2021-11-15 13:43:43 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-15 13:43:43 -0800 |
commit | 3549e3040340c706349b1ee9ab3e994279805afc (patch) | |
tree | 4764d49a6c0ec600102dd07ec677c6755b6da338 /src/passes/Print.cpp | |
parent | ed1f0d8427f330a18b2ca98adeadcb1be56d59bc (diff) | |
download | binaryen-3549e3040340c706349b1ee9ab3e994279805afc.tar.gz binaryen-3549e3040340c706349b1ee9ab3e994279805afc.tar.bz2 binaryen-3549e3040340c706349b1ee9ab3e994279805afc.zip |
Add support for relaxed-simd instructions (#4320)
This adds relaxed-simd instructions based on the current status of the
proposal
https://github.com/WebAssembly/relaxed-simd/blob/main/proposals/relaxed-simd/Overview.md.
Binary opcodes are based on what is listed in
https://github.com/WebAssembly/relaxed-simd/blob/main/proposals/relaxed-simd/Overview.md#binary-format.
Text names are not fixed yet, and some sort sort of names that maps to
the non-relaxed versions are chosen for this prototype.
Support for these instructions have been added to LLVM via builtins,
adding support here will allow Emscripten to successfully compile files
that use those builtins.
Interpreter support has also been added, and they delegate to the
non-relaxed versions of the instructions.
Most instructions are implemented in the interpreter the same way as the non-relaxed
simd128 instructions, except for fma/fms, which is always fused.
Diffstat (limited to 'src/passes/Print.cpp')
-rw-r--r-- | src/passes/Print.cpp | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp index ce4238f34..3476199d6 100644 --- a/src/passes/Print.cpp +++ b/src/passes/Print.cpp @@ -659,6 +659,30 @@ struct PrintExpressionContents case Bitselect: o << "v128.bitselect"; break; + case LaneselectI8x16: + o << "i8x16.laneselect"; + break; + case LaneselectI16x8: + o << "i16x8.laneselect"; + break; + case LaneselectI32x4: + o << "i32x4.laneselect"; + break; + case LaneselectI64x2: + o << "i64x2.laneselect"; + break; + case RelaxedFmaVecF32x4: + o << "f32x4.relaxed_fma"; + break; + case RelaxedFmsVecF32x4: + o << "f32x4.relaxed_fms"; + break; + case RelaxedFmaVecF64x2: + o << "f64x2.relaxed_fma"; + break; + case RelaxedFmsVecF64x2: + o << "f64x2.relaxed_fms"; + break; } restoreNormalColor(o); } @@ -1192,6 +1216,18 @@ struct PrintExpressionContents case PromoteLowVecF32x4ToVecF64x2: o << "f64x2.promote_low_f32x4"; break; + case RelaxedTruncSVecF32x4ToVecI32x4: + o << "i32x4.relaxed_trunc_f32x4_s"; + break; + case RelaxedTruncUVecF32x4ToVecI32x4: + o << "i32x4.relaxed_trunc_f32x4_u"; + break; + case RelaxedTruncZeroSVecF64x2ToVecI32x4: + o << "i32x4.relaxed_trunc_f64x2_s_zero"; + break; + case RelaxedTruncZeroUVecF64x2ToVecI32x4: + o << "i32x4.relaxed_trunc_f64x2_u_zero"; + break; case InvalidUnary: WASM_UNREACHABLE("unvalid unary operator"); } @@ -1800,6 +1836,22 @@ struct PrintExpressionContents o << "i8x16.swizzle"; break; + case RelaxedMinVecF32x4: + o << "f32x4.relaxed_min"; + break; + case RelaxedMaxVecF32x4: + o << "f32x4.relaxed_max"; + break; + case RelaxedMinVecF64x2: + o << "f64x2.relaxed_min"; + break; + case RelaxedMaxVecF64x2: + o << "f64x2.relaxed_max"; + break; + case RelaxedSwizzleVec8x16: + o << "i8x16.relaxed_swizzle"; + break; + case InvalidBinary: WASM_UNREACHABLE("unvalid binary operator"); } |