Bug 933257 - Part 9: Use fdlibm in asm.js. r=luke
☠☠ backed out by f87fe6fda717 ☠ ☠
authorTooru Fujisawa <arai_a@mac.com>
Sat, 05 Mar 2016 05:18:09 +0900
changeset 339780 b6ca6b5832d8d353ce8e97562b94c2bf1c346dcb
parent 339779 69061c0ec32b220c879d9c2612c12ce6cd726d85
child 339781 b2624519692fb70a1c09d37a7f6a8c1bf1a9f7b0
push id12803
push userjbeich@FreeBSD.org
push dateSun, 13 Mar 2016 09:48:54 +0000
reviewersluke
bugs933257
milestone48.0a1
Bug 933257 - Part 9: Use fdlibm in asm.js. r=luke
js/src/asmjs/WasmTypes.cpp
--- a/js/src/asmjs/WasmTypes.cpp
+++ b/js/src/asmjs/WasmTypes.cpp
@@ -13,16 +13,18 @@
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 #include "asmjs/WasmTypes.h"
 
+#include "fdlibm.h"
+
 #include "jslibmath.h"
 #include "jsmath.h"
 
 #include "asmjs/Wasm.h"
 #include "asmjs/WasmModule.h"
 #include "js/Conversions.h"
 #include "vm/Interpreter.h"
 
@@ -220,40 +222,40 @@ wasm::AddressOf(SymbolicAddress imm, Exc
 #endif
       case SymbolicAddress::ModD:
         return FuncCast(NumberMod, Args_Double_DoubleDouble);
       case SymbolicAddress::SinD:
 #ifdef _WIN64
         // Workaround a VS 2013 sin issue, see math_sin_uncached.
         return FuncCast<double (double)>(js::math_sin_uncached, Args_Double_Double);
 #else
-        return FuncCast<double (double)>(sin, Args_Double_Double);
+        return FuncCast<double (double)>(fdlibm::sin, Args_Double_Double);
 #endif
       case SymbolicAddress::CosD:
-        return FuncCast<double (double)>(cos, Args_Double_Double);
+        return FuncCast<double (double)>(fdlibm::cos, Args_Double_Double);
       case SymbolicAddress::TanD:
-        return FuncCast<double (double)>(tan, Args_Double_Double);
+        return FuncCast<double (double)>(fdlibm::tan, Args_Double_Double);
       case SymbolicAddress::ASinD:
-        return FuncCast<double (double)>(asin, Args_Double_Double);
+        return FuncCast<double (double)>(fdlibm::asin, Args_Double_Double);
       case SymbolicAddress::ACosD:
-        return FuncCast<double (double)>(acos, Args_Double_Double);
+        return FuncCast<double (double)>(fdlibm::acos, Args_Double_Double);
       case SymbolicAddress::ATanD:
-        return FuncCast<double (double)>(atan, Args_Double_Double);
+        return FuncCast<double (double)>(fdlibm::atan, Args_Double_Double);
       case SymbolicAddress::CeilD:
-        return FuncCast<double (double)>(ceil, Args_Double_Double);
+        return FuncCast<double (double)>(fdlibm::ceil, Args_Double_Double);
       case SymbolicAddress::CeilF:
-        return FuncCast<float (float)>(ceilf, Args_Float32_Float32);
+        return FuncCast<float (float)>(fdlibm::ceilf, Args_Float32_Float32);
       case SymbolicAddress::FloorD:
-        return FuncCast<double (double)>(floor, Args_Double_Double);
+        return FuncCast<double (double)>(fdlibm::floor, Args_Double_Double);
       case SymbolicAddress::FloorF:
-        return FuncCast<float (float)>(floorf, Args_Float32_Float32);
+        return FuncCast<float (float)>(fdlibm::floorf, Args_Float32_Float32);
       case SymbolicAddress::ExpD:
-        return FuncCast<double (double)>(exp, Args_Double_Double);
+        return FuncCast<double (double)>(fdlibm::exp, Args_Double_Double);
       case SymbolicAddress::LogD:
-        return FuncCast<double (double)>(log, Args_Double_Double);
+        return FuncCast<double (double)>(fdlibm::log, Args_Double_Double);
       case SymbolicAddress::PowD:
         return FuncCast(ecmaPow, Args_Double_DoubleDouble);
       case SymbolicAddress::ATan2D:
         return FuncCast(ecmaAtan2, Args_Double_DoubleDouble);
       case SymbolicAddress::Limit:
         break;
     }