hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86_32.cpp
changeset 38018 1dc6c6f21231
parent 35495 e27da438fa13
child 38699 f8bec5f6b09c
--- a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86_32.cpp	Wed Mar 30 17:04:14 2016 +0200
+++ b/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86_32.cpp	Wed Apr 06 10:29:26 2016 -0700
@@ -345,13 +345,34 @@
   __ fld_d(Address(rsp, 1*wordSize));
   switch (kind) {
     case Interpreter::java_lang_math_sin :
-        __ trigfunc('s');
+        __ subptr(rsp, 2 * wordSize);
+        __ fstp_d(Address(rsp, 0));
+        if (VM_Version::supports_sse2() && StubRoutines::dsin() != NULL) {
+          __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dsin())));
+        } else {
+          __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dsin)));
+        }
+        __ addptr(rsp, 2 * wordSize);
         break;
     case Interpreter::java_lang_math_cos :
-        __ trigfunc('c');
+        __ subptr(rsp, 2 * wordSize);
+        __ fstp_d(Address(rsp, 0));
+        if (VM_Version::supports_sse2() && StubRoutines::dcos() != NULL) {
+          __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dcos())));
+        } else {
+          __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dcos)));
+        }
+        __ addptr(rsp, 2 * wordSize);
         break;
     case Interpreter::java_lang_math_tan :
-        __ trigfunc('t');
+        __ subptr(rsp, 2 * wordSize);
+        __ fstp_d(Address(rsp, 0));
+        if (StubRoutines::dtan() != NULL) {
+          __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dtan())));
+        } else {
+          __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dtan)));
+        }
+        __ addptr(rsp, 2 * wordSize);
         break;
     case Interpreter::java_lang_math_sqrt:
         __ fsqrt();
@@ -362,26 +383,29 @@
     case Interpreter::java_lang_math_log:
         __ subptr(rsp, 2 * wordSize);
         __ fstp_d(Address(rsp, 0));
-        if (VM_Version::supports_sse2()) {
+        if (StubRoutines::dlog() != NULL) {
           __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dlog())));
-        }
-        else {
+        } else {
           __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dlog)));
         }
         __ addptr(rsp, 2 * wordSize);
         break;
     case Interpreter::java_lang_math_log10:
-        __ flog10();
-        // Store to stack to convert 80bit precision back to 64bits
-        __ push_fTOS();
-        __ pop_fTOS();
+        __ subptr(rsp, 2 * wordSize);
+        __ fstp_d(Address(rsp, 0));
+        if (StubRoutines::dlog10() != NULL) {
+          __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dlog10())));
+        } else {
+          __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dlog10)));
+        }
+        __ addptr(rsp, 2 * wordSize);
         break;
     case Interpreter::java_lang_math_pow:
       __ fld_d(Address(rsp, 3*wordSize)); // second argument
       __ subptr(rsp, 4 * wordSize);
       __ fstp_d(Address(rsp, 0));
       __ fstp_d(Address(rsp, 2 * wordSize));
-      if (VM_Version::supports_sse2()) {
+      if (StubRoutines::dpow() != NULL) {
         __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dpow())));
       } else {
         __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dpow)));
@@ -391,7 +415,7 @@
     case Interpreter::java_lang_math_exp:
       __ subptr(rsp, 2*wordSize);
       __ fstp_d(Address(rsp, 0));
-      if (VM_Version::supports_sse2()) {
+      if (StubRoutines::dexp() != NULL) {
         __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dexp())));
       } else {
         __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dexp)));