Skip to content

[FP16] Implement f16x8.demote_{f64x2, f32x4}_zero.#8580

Open
brendandahl wants to merge 1 commit intoWebAssembly:mainfrom
brendandahl:bi-fp16-demote
Open

[FP16] Implement f16x8.demote_{f64x2, f32x4}_zero.#8580
brendandahl wants to merge 1 commit intoWebAssembly:mainfrom
brendandahl:bi-fp16-demote

Conversation

@brendandahl
Copy link
Copy Markdown
Collaborator

@brendandahl brendandahl requested a review from a team as a code owner April 7, 2026 23:00
@brendandahl brendandahl requested review from stevenfontanella and removed request for a team April 7, 2026 23:00
@brendandahl brendandahl changed the title [FP16] Implement f16x8.demote_{f64x2, f32x5}_zero. [FP16] Implement f16x8.demote_{f64x2, f32x4}_zero. 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"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use a constructor instead of a C-style functional cast? Like int32_t{0}. Ditto below

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants