Mercurial > hg > truffle
diff src/cpu/x86/vm/stubGenerator_x86_64.cpp @ 6084:6759698e3140
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: kvn, never, twisti
author | roland |
---|---|
date | Tue, 15 May 2012 10:10:23 +0200 |
parents | da4be62fb889 |
children | 1d7922586cf6 |
line wrap: on
line diff
--- a/src/cpu/x86/vm/stubGenerator_x86_64.cpp Mon May 14 09:36:00 2012 -0700 +++ b/src/cpu/x86/vm/stubGenerator_x86_64.cpp Tue May 15 10:10:23 2012 +0200 @@ -2928,11 +2928,34 @@ __ addq(rsp, 8); __ ret(0); } - - // The intrinsic version of these seem to return the same value as - // the strict version. - StubRoutines::_intrinsic_exp = SharedRuntime::dexp; - StubRoutines::_intrinsic_pow = SharedRuntime::dpow; + { + StubCodeMark mark(this, "StubRoutines", "exp"); + StubRoutines::_intrinsic_exp = (double (*)(double)) __ pc(); + + __ subq(rsp, 8); + __ movdbl(Address(rsp, 0), xmm0); + __ fld_d(Address(rsp, 0)); + __ exp_with_fallback(0); + __ fstp_d(Address(rsp, 0)); + __ movdbl(xmm0, Address(rsp, 0)); + __ addq(rsp, 8); + __ ret(0); + } + { + StubCodeMark mark(this, "StubRoutines", "pow"); + StubRoutines::_intrinsic_pow = (double (*)(double,double)) __ pc(); + + __ subq(rsp, 8); + __ movdbl(Address(rsp, 0), xmm1); + __ fld_d(Address(rsp, 0)); + __ movdbl(Address(rsp, 0), xmm0); + __ fld_d(Address(rsp, 0)); + __ pow_with_fallback(0); + __ fstp_d(Address(rsp, 0)); + __ movdbl(xmm0, Address(rsp, 0)); + __ addq(rsp, 8); + __ ret(0); + } } #undef __