[FP16] Implement f16x8.demote_{f64x2, f32x4}_zero.#8580
Open
brendandahl wants to merge 1 commit intoWebAssembly:mainfrom
Open
[FP16] Implement f16x8.demote_{f64x2, f32x4}_zero.#8580brendandahl wants to merge 1 commit intoWebAssembly:mainfrom
brendandahl wants to merge 1 commit intoWebAssembly:mainfrom
Conversation
stevenfontanella
approved these changes
Apr 7, 2026
| ;; inf -inf 0 0 0 0 0 0 | ||
| (v128.const i16x8 0x7c00 0xfc00 0 0 0 0 0 0)) | ||
|
|
||
| (assert_return (invoke "f16x8.demote_f64x2_zero" |
Member
There was a problem hiding this comment.
Should we include a case that loses precision (besides overflow)?
| ;; Edge cases: Infinities, NaNs, Zeros | ||
| (assert_return (invoke "f16x8.demote_f64x2_zero" | ||
| ;; inf -inf | ||
| (v128.const i64x2 0x7ff0000000000000 0xfff0000000000000)) |
Member
There was a problem hiding this comment.
It looks like this NaN and the one below are canonical, can we have a case covering a non-canonical NaN?
| result[i] = Literal(fp16_ieee_from_fp32_value(lanes[i].getf32())); | ||
| } | ||
| for (size_t i = 4; i < 8; ++i) { | ||
| result[i] = Literal(int32_t(0)); |
Member
There was a problem hiding this comment.
Can we use a constructor instead of a C-style functional cast? Like int32_t{0}. Ditto below
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 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.
Specified at https://github.com/WebAssembly/half-precision/blob/main/proposals/half-precision/Overview.md