Closed Bug 1638586 Opened 5 years ago Closed 5 years ago

Optimize MathAbs in CacheIR and Warp

Categories

(Core :: JavaScript Engine: JIT, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
mozilla78
Tracking Status
firefox78 --- fixed

People

(Reporter: evilpies, Assigned: evilpies)

References

Details

Attachments

(4 files)

Math.abs dominates the run-time of kraken-gaussian-blur.

Assignee: nobody → evilpies
Blocks: 1638111

The type monitoring implications around INT32_MIN and so are a bit dangerous. Maybe we should just always monitor? I might also have made some silly mistake on non-x64. Try: https://hg.mozilla.org/try/rev/70708c2b7c6c2c6ca5df6595558d9c14c6e980df

(In reply to Tom Schuster [:evilpie] from comment #5)

The type monitoring implications around INT32_MIN and so are a bit dangerous. Maybe we should just always monitor?

The C++ code does a double Abs and then uses setNumber, so it's possible to have a double like 3.0 where the C++ code would return an int32 and the IC a double... Monitoring might make sense because of that - it's still much faster than what we're doing now and type monitoring is hopefully temporary.

Pushed by evilpies@gmail.com: https://hg.mozilla.org/integration/autoland/rev/c30f74744dda Cleanup and share more code for double abs in Ion. r=jandem https://hg.mozilla.org/integration/autoland/rev/8a549beacd6b Introduce and use branchNeg32. r=jandem https://hg.mozilla.org/integration/autoland/rev/6e4a013df094 Support double and int32 Math.abs in CacheIR. r=iain https://hg.mozilla.org/integration/autoland/rev/51588346ff98 Transpile Math.abs in Warp. r=iain
Depends on: 1638779
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: