Skip to content

[FP16] Removed "relaxed" from madd and nmadd.#8411

Open
brendandahl wants to merge 2 commits intoWebAssembly:mainfrom
brendandahl:remove-relaxed-fp16
Open

[FP16] Removed "relaxed" from madd and nmadd.#8411
brendandahl wants to merge 2 commits intoWebAssembly:mainfrom
brendandahl:remove-relaxed-fp16

Conversation

@brendandahl
Copy link
Collaborator

With FP16 there won't be any relaxed instructions because the hardware should always be able to promote the type to F32 so there won't be a double rounding issue.

@brendandahl brendandahl requested review from kripken and tlively March 4, 2026 00:05
With FP16 there won't be any relaxed instructions because the hardware
should always be able to promote the type to F32 so there won't be a
double rounding issue.
@brendandahl brendandahl force-pushed the remove-relaxed-fp16 branch from eb46f4a to 42264c2 Compare March 4, 2026 00:19
switch (curr->op) {
case RelaxedMaddVecF16x8:
case RelaxedNmaddVecF16x8:
case MaddVecF16x8:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

One thing we haven't resolved, is whether fp16 implies simd is enabled.

Copy link
Member

Choose a reason for hiding this comment

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

Since it requires the v128 type, I think it's reasonable to require simd.

Comment on lines +552 to +553
("f16x8.madd", "makeSIMDTernary(SIMDTernaryOp::MaddVecF16x8)"),
("f16x8.nmadd", "makeSIMDTernary(SIMDTernaryOp::NmaddVecF16x8)"),
Copy link
Member

Choose a reason for hiding this comment

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

Please align the right hand side to match the above lines.

switch (curr->op) {
case RelaxedMaddVecF16x8:
case RelaxedNmaddVecF16x8:
case MaddVecF16x8:
Copy link
Member

Choose a reason for hiding this comment

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

Since it requires the v128 type, I think it's reasonable to require simd.

Comment on lines +77 to +78
case MaddVecF16x8:
case NmaddVecF16x8:
Copy link
Member

Choose a reason for hiding this comment

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

These the pass should probably leave these in place since they are not relaxed SIMD. We can update the test accordingly, too.

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