< prev index next >

src/cpu/x86/vm/templateInterpreterGenerator_x86_64.cpp

Print this page




 352   if (!InlineIntrinsics) return NULL; // Generate a vanilla entry
 353 
 354   address entry_point = __ pc();
 355 
 356   // These don't need a safepoint check because they aren't virtually
 357   // callable. We won't enter these intrinsics from compiled code.
 358   // If in the future we added an intrinsic which was virtually callable
 359   // we'd have to worry about how to safepoint so that this code is used.
 360 
 361   // mathematical functions inlined by compiler
 362   // (interpreter must provide identical implementation
 363   // in order to avoid monotonicity bugs when switching
 364   // from interpreter to compiler in the middle of some
 365   // computation)
 366   //
 367   // stack: [ ret adr ] <-- rsp
 368   //        [ lo(arg) ]
 369   //        [ hi(arg) ]
 370   //
 371 
 372 
 373   if (kind == Interpreter::java_lang_math_sqrt) {









 374     __ sqrtsd(xmm0, Address(rsp, wordSize));
 375   } else if (kind == Interpreter::java_lang_math_exp) {
 376     __ movdbl(xmm0, Address(rsp, wordSize));
 377     if (StubRoutines::dexp() != NULL) {
 378       __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dexp())));
 379     } else {
 380       __ call_VM_leaf0(CAST_FROM_FN_PTR(address, SharedRuntime::dexp));
 381     }
 382   } else if (kind == Interpreter::java_lang_math_log) {
 383     __ movdbl(xmm0, Address(rsp, wordSize));
 384     if (StubRoutines::dlog() != NULL) {
 385       __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dlog())));
 386     } else {
 387       __ call_VM_leaf0(CAST_FROM_FN_PTR(address, SharedRuntime::dlog));
 388     }
 389   } else if (kind == Interpreter::java_lang_math_log10) {
 390     __ movdbl(xmm0, Address(rsp, wordSize));
 391     if (StubRoutines::dlog10() != NULL) {
 392       __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dlog10())));
 393     } else {




 352   if (!InlineIntrinsics) return NULL; // Generate a vanilla entry
 353 
 354   address entry_point = __ pc();
 355 
 356   // These don't need a safepoint check because they aren't virtually
 357   // callable. We won't enter these intrinsics from compiled code.
 358   // If in the future we added an intrinsic which was virtually callable
 359   // we'd have to worry about how to safepoint so that this code is used.
 360 
 361   // mathematical functions inlined by compiler
 362   // (interpreter must provide identical implementation
 363   // in order to avoid monotonicity bugs when switching
 364   // from interpreter to compiler in the middle of some
 365   // computation)
 366   //
 367   // stack: [ ret adr ] <-- rsp
 368   //        [ lo(arg) ]
 369   //        [ hi(arg) ]
 370   //
 371 
 372   if (kind == Interpreter::java_lang_math_fmaD) {
 373     __ movdbl(xmm0, Address(rsp, wordSize));
 374     __ movdbl(xmm1, Address(rsp, 3 * wordSize));
 375     __ movdbl(xmm2, Address(rsp, 5 * wordSize));
 376     __ vfmadd231sd(xmm0, xmm1, xmm2);
 377   } else if (kind == Interpreter::java_lang_math_fmaF) {
 378     __ movdbl(xmm0, Address(rsp, wordSize));
 379     __ movdbl(xmm1, Address(rsp, 2 * wordSize));
 380     __ movdbl(xmm2, Address(rsp, 3 * wordSize));
 381     __ vfmadd231ss(xmm0, xmm1, xmm2);
 382   } else if (kind == Interpreter::java_lang_math_sqrt) {
 383     __ sqrtsd(xmm0, Address(rsp, wordSize));
 384   } else if (kind == Interpreter::java_lang_math_exp) {
 385     __ movdbl(xmm0, Address(rsp, wordSize));
 386     if (StubRoutines::dexp() != NULL) {
 387       __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dexp())));
 388     } else {
 389       __ call_VM_leaf0(CAST_FROM_FN_PTR(address, SharedRuntime::dexp));
 390     }
 391   } else if (kind == Interpreter::java_lang_math_log) {
 392     __ movdbl(xmm0, Address(rsp, wordSize));
 393     if (StubRoutines::dlog() != NULL) {
 394       __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dlog())));
 395     } else {
 396       __ call_VM_leaf0(CAST_FROM_FN_PTR(address, SharedRuntime::dlog));
 397     }
 398   } else if (kind == Interpreter::java_lang_math_log10) {
 399     __ movdbl(xmm0, Address(rsp, wordSize));
 400     if (StubRoutines::dlog10() != NULL) {
 401       __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dlog10())));
 402     } else {


< prev index next >