Mercurial > hg > graal-jvmci-8
comparison 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 |
comparison
equal
deleted
inserted
replaced
6057:8f972594effc | 6084:6759698e3140 |
---|---|
2926 __ fstp_d(Address(rsp, 0)); | 2926 __ fstp_d(Address(rsp, 0)); |
2927 __ movdbl(xmm0, Address(rsp, 0)); | 2927 __ movdbl(xmm0, Address(rsp, 0)); |
2928 __ addq(rsp, 8); | 2928 __ addq(rsp, 8); |
2929 __ ret(0); | 2929 __ ret(0); |
2930 } | 2930 } |
2931 | 2931 { |
2932 // The intrinsic version of these seem to return the same value as | 2932 StubCodeMark mark(this, "StubRoutines", "exp"); |
2933 // the strict version. | 2933 StubRoutines::_intrinsic_exp = (double (*)(double)) __ pc(); |
2934 StubRoutines::_intrinsic_exp = SharedRuntime::dexp; | 2934 |
2935 StubRoutines::_intrinsic_pow = SharedRuntime::dpow; | 2935 __ subq(rsp, 8); |
2936 __ movdbl(Address(rsp, 0), xmm0); | |
2937 __ fld_d(Address(rsp, 0)); | |
2938 __ exp_with_fallback(0); | |
2939 __ fstp_d(Address(rsp, 0)); | |
2940 __ movdbl(xmm0, Address(rsp, 0)); | |
2941 __ addq(rsp, 8); | |
2942 __ ret(0); | |
2943 } | |
2944 { | |
2945 StubCodeMark mark(this, "StubRoutines", "pow"); | |
2946 StubRoutines::_intrinsic_pow = (double (*)(double,double)) __ pc(); | |
2947 | |
2948 __ subq(rsp, 8); | |
2949 __ movdbl(Address(rsp, 0), xmm1); | |
2950 __ fld_d(Address(rsp, 0)); | |
2951 __ movdbl(Address(rsp, 0), xmm0); | |
2952 __ fld_d(Address(rsp, 0)); | |
2953 __ pow_with_fallback(0); | |
2954 __ fstp_d(Address(rsp, 0)); | |
2955 __ movdbl(xmm0, Address(rsp, 0)); | |
2956 __ addq(rsp, 8); | |
2957 __ ret(0); | |
2958 } | |
2936 } | 2959 } |
2937 | 2960 |
2938 #undef __ | 2961 #undef __ |
2939 #define __ masm-> | 2962 #define __ masm-> |
2940 | 2963 |