< prev index next >
src/cpu/x86/vm/stubGenerator_x86_64.cpp
Print this page
*** 2970,3008 ****
StubRoutines::_arrayof_oop_disjoint_arraycopy_uninit = StubRoutines::_oop_disjoint_arraycopy_uninit;
StubRoutines::_arrayof_oop_arraycopy_uninit = StubRoutines::_oop_arraycopy_uninit;
}
- void generate_math_stubs() {
- {
- StubCodeMark mark(this, "StubRoutines", "log10");
- StubRoutines::_intrinsic_log10 = (double (*)(double)) __ pc();
-
- __ subq(rsp, 8);
- __ movdbl(Address(rsp, 0), xmm0);
- __ fld_d(Address(rsp, 0));
- __ flog10();
- __ fstp_d(Address(rsp, 0));
- __ movdbl(xmm0, Address(rsp, 0));
- __ addq(rsp, 8);
- __ ret(0);
- }
- {
- StubCodeMark mark(this, "StubRoutines", "tan");
- StubRoutines::_intrinsic_tan = (double (*)(double)) __ pc();
-
- __ subq(rsp, 8);
- __ movdbl(Address(rsp, 0), xmm0);
- __ fld_d(Address(rsp, 0));
- __ trigfunc('t');
- __ fstp_d(Address(rsp, 0));
- __ movdbl(xmm0, Address(rsp, 0));
- __ addq(rsp, 8);
- __ ret(0);
- }
- }
-
// AES intrinsic stubs
enum {AESBlockSize = 16};
address generate_key_shuffle_mask() {
__ align(16);
--- 2970,2979 ----
*** 4743,4752 ****
--- 4714,4763 ----
return start;
}
+ address generate_libmLog10() {
+ address start = __ pc();
+
+ const XMMRegister x0 = xmm0;
+ const XMMRegister x1 = xmm1;
+ const XMMRegister x2 = xmm2;
+ const XMMRegister x3 = xmm3;
+
+ const XMMRegister x4 = xmm4;
+ const XMMRegister x5 = xmm5;
+ const XMMRegister x6 = xmm6;
+ const XMMRegister x7 = xmm7;
+
+ const Register tmp = r11;
+
+ BLOCK_COMMENT("Entry:");
+ __ enter(); // required for proper stackwalking of RuntimeStub frame
+
+ #ifdef _WIN64
+ // save the xmm registers which must be preserved 6-7
+ __ subptr(rsp, 4 * wordSize);
+ __ movdqu(Address(rsp, 0), xmm6);
+ __ movdqu(Address(rsp, 2 * wordSize), xmm7);
+ #endif
+ __ fast_log10(x0, x1, x2, x3, x4, x5, x6, x7, rax, rcx, rdx, tmp);
+
+ #ifdef _WIN64
+ // restore xmm regs belonging to calling function
+ __ movdqu(xmm6, Address(rsp, 0));
+ __ movdqu(xmm7, Address(rsp, 2 * wordSize));
+ __ addptr(rsp, 4 * wordSize);
+ #endif
+
+ __ leave(); // required for proper stackwalking of RuntimeStub frame
+ __ ret(0);
+
+ return start;
+
+ }
+
address generate_libmPow() {
address start = __ pc();
const XMMRegister x0 = xmm0;
const XMMRegister x1 = xmm1;
*** 4808,4817 ****
--- 4819,4830 ----
BLOCK_COMMENT("Entry:");
__ enter(); // required for proper stackwalking of RuntimeStub frame
#ifdef _WIN64
+ __ push(rsi);
+ __ push(rdi);
// save the xmm registers which must be preserved 6-7
__ subptr(rsp, 4 * wordSize);
__ movdqu(Address(rsp, 0), xmm6);
__ movdqu(Address(rsp, 2 * wordSize), xmm7);
#endif
*** 4820,4829 ****
--- 4833,4844 ----
#ifdef _WIN64
// restore xmm regs belonging to calling function
__ movdqu(xmm6, Address(rsp, 0));
__ movdqu(xmm7, Address(rsp, 2 * wordSize));
__ addptr(rsp, 4 * wordSize);
+ __ pop(rdi);
+ __ pop(rsi);
#endif
__ leave(); // required for proper stackwalking of RuntimeStub frame
__ ret(0);
*** 4851,4860 ****
--- 4866,4877 ----
BLOCK_COMMENT("Entry:");
__ enter(); // required for proper stackwalking of RuntimeStub frame
#ifdef _WIN64
+ __ push(rsi);
+ __ push(rdi);
// save the xmm registers which must be preserved 6-7
__ subptr(rsp, 4 * wordSize);
__ movdqu(Address(rsp, 0), xmm6);
__ movdqu(Address(rsp, 2 * wordSize), xmm7);
#endif
*** 4863,4872 ****
--- 4880,4938 ----
#ifdef _WIN64
// restore xmm regs belonging to calling function
__ movdqu(xmm6, Address(rsp, 0));
__ movdqu(xmm7, Address(rsp, 2 * wordSize));
__ addptr(rsp, 4 * wordSize);
+ __ pop(rdi);
+ __ pop(rsi);
+ #endif
+
+ __ leave(); // required for proper stackwalking of RuntimeStub frame
+ __ ret(0);
+
+ return start;
+
+ }
+
+ address generate_libmTan() {
+ address start = __ pc();
+
+ const XMMRegister x0 = xmm0;
+ const XMMRegister x1 = xmm1;
+ const XMMRegister x2 = xmm2;
+ const XMMRegister x3 = xmm3;
+
+ const XMMRegister x4 = xmm4;
+ const XMMRegister x5 = xmm5;
+ const XMMRegister x6 = xmm6;
+ const XMMRegister x7 = xmm7;
+
+ const Register tmp1 = r8;
+ const Register tmp2 = r9;
+ const Register tmp3 = r10;
+ const Register tmp4 = r11;
+
+ BLOCK_COMMENT("Entry:");
+ __ enter(); // required for proper stackwalking of RuntimeStub frame
+
+ #ifdef _WIN64
+ __ push(rsi);
+ __ push(rdi);
+ // save the xmm registers which must be preserved 6-7
+ __ subptr(rsp, 4 * wordSize);
+ __ movdqu(Address(rsp, 0), xmm6);
+ __ movdqu(Address(rsp, 2 * wordSize), xmm7);
+ #endif
+ __ fast_tan(x0, x1, x2, x3, x4, x5, x6, x7, rax, rcx, rdx, tmp1, tmp2, tmp3, tmp4);
+
+ #ifdef _WIN64
+ // restore xmm regs belonging to calling function
+ __ movdqu(xmm6, Address(rsp, 0));
+ __ movdqu(xmm7, Address(rsp, 2 * wordSize));
+ __ addptr(rsp, 4 * wordSize);
+ __ pop(rdi);
+ __ pop(rsi);
#endif
__ leave(); // required for proper stackwalking of RuntimeStub frame
__ ret(0);
*** 5064,5082 ****
StubRoutines::x86::generate_CRC32C_table(supports_clmul);
StubRoutines::_crc32c_table_addr = (address)StubRoutines::x86::_crc32c_table;
StubRoutines::_updateBytesCRC32C = generate_updateBytesCRC32C(supports_clmul);
}
if (VM_Version::supports_sse2()) {
StubRoutines::_dexp = generate_libmExp();
StubRoutines::_dlog = generate_libmLog();
StubRoutines::_dpow = generate_libmPow();
! if (UseLibmSinIntrinsic) {
StubRoutines::_dsin = generate_libmSin();
}
! if (UseLibmCosIntrinsic) {
StubRoutines::_dcos = generate_libmCos();
}
}
}
void generate_all() {
// Generates all stubs and initializes the entry points
--- 5130,5160 ----
StubRoutines::x86::generate_CRC32C_table(supports_clmul);
StubRoutines::_crc32c_table_addr = (address)StubRoutines::x86::_crc32c_table;
StubRoutines::_updateBytesCRC32C = generate_updateBytesCRC32C(supports_clmul);
}
if (VM_Version::supports_sse2()) {
+ if (vmIntrinsics::is_intrinsic_available(vmIntrinsics::_dexp)) {
StubRoutines::_dexp = generate_libmExp();
+ }
+ if (vmIntrinsics::is_intrinsic_available(vmIntrinsics::_dlog)) {
StubRoutines::_dlog = generate_libmLog();
+ }
+ if (vmIntrinsics::is_intrinsic_available(vmIntrinsics::_dlog10)) {
+ StubRoutines::_dlog10 = generate_libmLog10();
+ }
+ if (vmIntrinsics::is_intrinsic_available(vmIntrinsics::_dpow)) {
StubRoutines::_dpow = generate_libmPow();
! }
! if (vmIntrinsics::is_intrinsic_available(vmIntrinsics::_dsin)) {
StubRoutines::_dsin = generate_libmSin();
}
! if (vmIntrinsics::is_intrinsic_available(vmIntrinsics::_dcos)) {
StubRoutines::_dcos = generate_libmCos();
}
+ if (vmIntrinsics::is_intrinsic_available(vmIntrinsics::_dtan)) {
+ StubRoutines::_dtan = generate_libmTan();
+ }
}
}
void generate_all() {
// Generates all stubs and initializes the entry points
*** 5117,5128 ****
StubRoutines::_verify_oop_subroutine_entry = generate_verify_oop();
// arraycopy stubs used by compilers
generate_arraycopy_stubs();
- generate_math_stubs();
-
// don't bother generating these AES intrinsic stubs unless global flag is set
if (UseAESIntrinsics) {
StubRoutines::x86::_key_shuffle_mask_addr = generate_key_shuffle_mask(); // needed by the others
StubRoutines::_aescrypt_encryptBlock = generate_aescrypt_encryptBlock();
StubRoutines::_aescrypt_decryptBlock = generate_aescrypt_decryptBlock();
--- 5195,5204 ----
< prev index next >