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 __ fmad(xmm0, xmm1, xmm2, xmm0); 377 } else if (kind == Interpreter::java_lang_math_fmaF) { 378 __ movflt(xmm0, Address(rsp, wordSize)); 379 __ movflt(xmm1, Address(rsp, 2 * wordSize)); 380 __ movflt(xmm2, Address(rsp, 3 * wordSize)); 381 __ fmaf(xmm0, xmm1, xmm2, xmm0); 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 } | 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 assert(UseFMA, "Needs FMA instructions support."); 374 __ movdbl(xmm0, Address(rsp, wordSize)); 375 __ movdbl(xmm1, Address(rsp, 3 * wordSize)); 376 __ movdbl(xmm2, Address(rsp, 5 * wordSize)); 377 __ fmad(xmm0, xmm1, xmm2, xmm0); 378 } else if (kind == Interpreter::java_lang_math_fmaF) { 379 assert(UseFMA, "Needs FMA instructions support."); 380 __ movflt(xmm0, Address(rsp, wordSize)); 381 __ movflt(xmm1, Address(rsp, 2 * wordSize)); 382 __ movflt(xmm2, Address(rsp, 3 * wordSize)); 383 __ fmaf(xmm0, xmm1, xmm2, xmm0); 384 } else if (kind == Interpreter::java_lang_math_sqrt) { 385 __ sqrtsd(xmm0, Address(rsp, wordSize)); 386 } else if (kind == Interpreter::java_lang_math_exp) { 387 __ movdbl(xmm0, Address(rsp, wordSize)); 388 if (StubRoutines::dexp() != NULL) { 389 __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dexp()))); 390 } else { 391 __ call_VM_leaf0(CAST_FROM_FN_PTR(address, SharedRuntime::dexp)); 392 } 393 } else if (kind == Interpreter::java_lang_math_log) { 394 __ movdbl(xmm0, Address(rsp, wordSize)); 395 if (StubRoutines::dlog() != NULL) { 396 __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dlog()))); 397 } else { 398 __ call_VM_leaf0(CAST_FROM_FN_PTR(address, SharedRuntime::dlog)); 399 } |