From c3a71ff46d8f38e29896c321d89b6d0c3b90fbc1 Mon Sep 17 00:00:00 2001 From: Brendan Dahl Date: Thu, 26 Sep 2024 15:35:47 -0700 Subject: [FP16] Implement conversion operations. (#6974) Note: FP16 is a little different from F32/F64 since it can't represent the full 2^16 integer range. 65504 is the max whole integer. This leads to some slightly strange behavior when converting integers greater than 65504 since they become infinity. Specified at https://github.com/WebAssembly/half-precision/blob/main/proposals/half-precision/Overview.md --- src/wasm/wasm.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/wasm/wasm.cpp') diff --git a/src/wasm/wasm.cpp b/src/wasm/wasm.cpp index 87ae6ac5a..84fd9a06f 100644 --- a/src/wasm/wasm.cpp +++ b/src/wasm/wasm.cpp @@ -703,6 +703,10 @@ void Unary::finalize() { case RelaxedTruncUVecF32x4ToVecI32x4: case RelaxedTruncZeroSVecF64x2ToVecI32x4: case RelaxedTruncZeroUVecF64x2ToVecI32x4: + case TruncSatSVecF16x8ToVecI16x8: + case TruncSatUVecF16x8ToVecI16x8: + case ConvertSVecI16x8ToVecF16x8: + case ConvertUVecI16x8ToVecF16x8: type = Type::v128; break; case AnyTrueVec128: -- cgit v1.2.3