Closed Bug 1316824 Opened 8 years ago Closed 2 years ago

Wasm baseline: Avoid SNaN -> QNaN conversion for constant arguments to Min and Max

Categories

(Core :: JavaScript: WebAssembly, enhancement, P5)

enhancement

Tracking

()

RESOLVED INACTIVE

People

(Reporter: lth, Unassigned, Mentored)

References

Details

Attachments

(1 file)

In emit{Min,Max}F{32,64}() we unconditionally convert arguments from signaling NaN to quiet NaN by adding 0.0.

It is silly to do this for constant values, so we should definitely avoid that, and that is especially true since Min and Max often will be applied to one constant argument.

It is interesting to consider whether there is a simple way to know that a value cannot be a signaling NaN.  For example, off the top of my head I would say that the result of an arithmetic operation can't be signaling.

It does not look like it's worthwhile to go down the more complex path here, since the fixup is relatively cheap (clear a register and subtract, and we hope the FPU optimizes that path.)  Still, worth remembering.
Mentor: lhansen
Something like this, but for the other three cases as well, and with test cases.
Micro-optimizations in straight-line code without emipirical support are P5.
Priority: P3 → P5
Per policy at https://wiki.mozilla.org/Bug_Triage/Projects/Bug_Handling/Bug_Husbandry#Inactive_Bugs. If this bug is not an enhancement request or a bug not present in a supported release of Firefox, then it may be reopened.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → INACTIVE
Status: RESOLVED → REOPENED
Resolution: INACTIVE → ---
Component: JavaScript Engine: JIT → Javascript: Web Assembly
Type: defect → enhancement
See Also: → 1716710
Status: REOPENED → RESOLVED
Closed: 6 years ago2 years ago
Resolution: --- → INACTIVE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: