[FP16] Implement f16x8.demote_{f64x2, f32x4}_zero.#8580
Open
brendandahl wants to merge 2 commits intoWebAssembly:mainfrom
Open
[FP16] Implement f16x8.demote_{f64x2, f32x4}_zero.#8580brendandahl wants to merge 2 commits intoWebAssembly:mainfrom
brendandahl wants to merge 2 commits 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)?
Collaborator
Author
There was a problem hiding this comment.
I've added a few precision loss tests. While doing that I found conversions.wast spec test that covers a lot more. I'll copy that over in the future to get more coverage.
| ;; 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?
Collaborator
Author
There was a problem hiding this comment.
Since we don't have a f16 constant that we can use to test for nan:arithmetic I can't really add a stable test for this yet. I've added a todo once we resolve WebAssembly/half-precision#6
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