Bug 1643519 - Transpile Math.atan2 in Warp. r=iain
authorcaroline <ccullen@mozilla.com>
Fri, 05 Jun 2020 18:55:19 +0000
changeset 534206 1bcf841f915ed32aface7bdc7a1e605f0118801b
parent 534205 4e9f0168ffe40aff7860ea447e2e50d7b550e5d4
child 534207 caae3550143323fd4d93576cc0d74bbff0c90df9
push id37484
push userdluca@mozilla.com
push dateSat, 06 Jun 2020 09:46:03 +0000
treeherdermozilla-central@6237102f005d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersiain
bugs1643519
milestone79.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1643519 - Transpile Math.atan2 in Warp. r=iain Depends on D78553 Differential Revision: https://phabricator.services.mozilla.com/D78554
js/src/jit/CacheIROps.yaml
js/src/jit/WarpCacheIRTranspiler.cpp
--- a/js/src/jit/CacheIROps.yaml
+++ b/js/src/jit/CacheIROps.yaml
@@ -720,17 +720,17 @@
 - name: MathRandomResult
   shared: false
   transpile: true
   args:
     rng: RawPointerField
 
 - name: MathAtan2NumberResult
   shared: true
-  transpile: false
+  transpile: true
   args:
     lhs: NumberId
     rhs: NumberId
 
 - name: MathFloorToInt32Result
   shared: true
   transpile: true
   args:
--- a/js/src/jit/WarpCacheIRTranspiler.cpp
+++ b/js/src/jit/WarpCacheIRTranspiler.cpp
@@ -1187,16 +1187,28 @@ bool WarpCacheIRTranspiler::emitMathSqrt
 
   auto* ins = MSqrt::New(alloc(), input, MIRType::Double);
   add(ins);
 
   pushResult(ins);
   return true;
 }
 
+bool WarpCacheIRTranspiler::emitMathAtan2NumberResult(NumberOperandId yId,
+                                                      NumberOperandId xId) {
+  MDefinition* y = getOperand(yId);
+  MDefinition* x = getOperand(xId);
+
+  auto* ins = MAtan2::New(alloc(), y, x);
+  add(ins);
+
+  pushResult(ins);
+  return true;
+}
+
 bool WarpCacheIRTranspiler::emitMathFunctionNumberResult(
     NumberOperandId inputId, UnaryMathFunction fun) {
   MDefinition* input = getOperand(inputId);
 
   auto* ins = MMathFunction::New(alloc(), input, fun);
   add(ins);
 
   pushResult(ins);