optimize sqrt on asm.js

RESOLVED FIXED in mozilla24

Status

()

Core
JavaScript Engine
--
enhancement
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: sunfish, Unassigned)

Tracking

Trunk
mozilla24
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

5 years ago
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.
(Reporter)

Comment 1

5 years ago
Created attachment 755047 [details] [diff] [review]
a proposed fix
Attachment #755047 - Flags: review?(luke)

Updated

5 years ago
Attachment #755047 - Flags: review?(luke) → review+

Comment 2

5 years ago
Thanks!

Updated

5 years ago
Keywords: checkin-needed
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
Flags: in-testsuite?
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
(Reporter)

Comment 5

5 years ago
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.