Math.sqrt under asm.js is currently lowered to a library call. IonMonkey already has an optimized implementation of Math.sqrt which is capable of emitting a single instruction on platforms which support it, so asm.js just needs to use it.
Created attachment 755047 [details] [diff] [review] a proposed fix
Attachment #755047 - Flags: review?(luke)
https://hg.mozilla.org/mozilla-central/rev/17143afc4fab Do we have tests for this? If not, should we?
Status: UNCONFIRMED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
There are existing tests that Math.sqrt returns the right answer for a variety of interesting inputs and existing tests that call Math.sqrt from asm.js. Unfortunately however, there's no framework for testing that the JIT performed a particular optimization or emitted a particular code sequence.
Correctness is my concern, so it sounds like we're good. Thanks.
Flags: in-testsuite? → in-testsuite+
You need to log in before you can comment on or make changes to this bug.