src/cpu/x86/vm/stubGenerator_x86_32.cpp

Print this page
rev 3227 : 7133857: exp() and pow() should use the x87 ISA on x86
Summary: use x87 instructions to implement exp() and pow() in interpreter/c1/c2.
Reviewed-by:


2119       __ fld_d(Address(rsp, 4));
2120       __ trigfunc('s');
2121       __ ret(0);
2122     }
2123     {
2124       StubCodeMark mark(this, "StubRoutines", "cos");
2125       StubRoutines::_intrinsic_cos = (double (*)(double)) __ pc();
2126 
2127       __ fld_d(Address(rsp, 4));
2128       __ trigfunc('c');
2129       __ ret(0);
2130     }
2131     {
2132       StubCodeMark mark(this, "StubRoutines", "tan");
2133       StubRoutines::_intrinsic_tan = (double (*)(double)) __ pc();
2134 
2135       __ fld_d(Address(rsp, 4));
2136       __ trigfunc('t');
2137       __ ret(0);
2138     }



2139 
2140     // The intrinsic version of these seem to return the same value as
2141     // the strict version.
2142     StubRoutines::_intrinsic_exp = SharedRuntime::dexp;
2143     StubRoutines::_intrinsic_pow = SharedRuntime::dpow;









2144   }
2145 
2146  public:
2147   // Information about frame layout at time of blocking runtime call.
2148   // Note that we only have to preserve callee-saved registers since
2149   // the compilers are responsible for supplying a continuation point
2150   // if they expect all registers to be preserved.
2151   enum layout {
2152     thread_off,    // last_java_sp
2153     arg1_off,
2154     arg2_off,
2155     rbp_off,       // callee saved register
2156     ret_pc,
2157     framesize
2158   };
2159 
2160  private:
2161 
2162 #undef  __
2163 #define __ masm->




2119       __ fld_d(Address(rsp, 4));
2120       __ trigfunc('s');
2121       __ ret(0);
2122     }
2123     {
2124       StubCodeMark mark(this, "StubRoutines", "cos");
2125       StubRoutines::_intrinsic_cos = (double (*)(double)) __ pc();
2126 
2127       __ fld_d(Address(rsp, 4));
2128       __ trigfunc('c');
2129       __ ret(0);
2130     }
2131     {
2132       StubCodeMark mark(this, "StubRoutines", "tan");
2133       StubRoutines::_intrinsic_tan = (double (*)(double)) __ pc();
2134 
2135       __ fld_d(Address(rsp, 4));
2136       __ trigfunc('t');
2137       __ ret(0);
2138     }
2139     {
2140       StubCodeMark mark(this, "StubRoutines", "exp");
2141       StubRoutines::_intrinsic_exp = (double (*)(double)) __ pc();
2142 
2143       __ fld_d(Address(rsp, 4));
2144       __ exp_with_fallback(0);
2145       __ ret(0);
2146     }
2147     {
2148       StubCodeMark mark(this, "StubRoutines", "pow");
2149       StubRoutines::_intrinsic_pow = (double (*)(double,double)) __ pc();
2150 
2151       __ fld_d(Address(rsp, 12));
2152       __ fld_d(Address(rsp, 4));
2153       __ pow_with_fallback(0);
2154       __ ret(0);
2155     }
2156   }
2157 
2158  public:
2159   // Information about frame layout at time of blocking runtime call.
2160   // Note that we only have to preserve callee-saved registers since
2161   // the compilers are responsible for supplying a continuation point
2162   // if they expect all registers to be preserved.
2163   enum layout {
2164     thread_off,    // last_java_sp
2165     arg1_off,
2166     arg2_off,
2167     rbp_off,       // callee saved register
2168     ret_pc,
2169     framesize
2170   };
2171 
2172  private:
2173 
2174 #undef  __
2175 #define __ masm->