5297 ins_pipe(ialu_reg_mem); // XXX
5298 %}
5299
5300
5301 // Load Klass Pointer
5302 instruct loadKlass(rRegP dst, memory mem)
5303 %{
5304 match(Set dst (LoadKlass mem));
5305
5306 ins_cost(125); // XXX
5307 format %{ "movq $dst, $mem\t# class" %}
5308 ins_encode %{
5309 __ movq($dst$$Register, $mem$$Address);
5310 %}
5311 ins_pipe(ialu_reg_mem); // XXX
5312 %}
5313
5314 // Load narrow Klass Pointer
5315 instruct loadNKlass(rRegN dst, memory mem)
5316 %{
5317 match(Set dst (LoadNKlass mem));
5318
5319 ins_cost(125); // XXX
5320 format %{ "movl $dst, $mem\t# compressed klass ptr" %}
5321 ins_encode %{
5322 __ movl($dst$$Register, $mem$$Address);
5323 %}
5324 ins_pipe(ialu_reg_mem); // XXX
5325 %}
5326
5327 // Load Float
5328 instruct loadF(regF dst, memory mem)
5329 %{
5330 match(Set dst (LoadF mem));
5331
5332 ins_cost(145); // XXX
5333 format %{ "movss $dst, $mem\t# float" %}
5334 ins_encode %{
5335 __ movflt($dst$$XMMRegister, $mem$$Address);
5336 %}
5337 ins_pipe(pipe_slow); // XXX
5338 %}
5339
5340 // Load Double
5341 instruct loadD_partial(regD dst, memory mem)
5342 %{
5343 predicate(!UseXmmLoadAndClearUpper);
5344 match(Set dst (LoadD mem));
5345
5346 ins_cost(145); // XXX
12625
12626 format %{ "cmpl $mem, $src\t# compressed ptr" %}
12627 ins_encode %{
12628 __ cmp_narrow_oop($mem$$Address, (jobject)$src$$constant);
12629 %}
12630 ins_pipe(ialu_cr_reg_mem);
12631 %}
12632
12633 instruct compN_rReg_imm_klass(rFlagsRegU cr, rRegN op1, immNKlass op2) %{
12634 match(Set cr (CmpN op1 op2));
12635
12636 format %{ "cmpl $op1, $op2\t# compressed klass ptr" %}
12637 ins_encode %{
12638 __ cmp_narrow_klass($op1$$Register, (Klass*)$op2$$constant);
12639 %}
12640 ins_pipe(ialu_cr_reg_imm);
12641 %}
12642
12643 instruct compN_mem_imm_klass(rFlagsRegU cr, memory mem, immNKlass src)
12644 %{
12645 match(Set cr (CmpN src (LoadNKlass mem)));
12646
12647 format %{ "cmpl $mem, $src\t# compressed klass ptr" %}
12648 ins_encode %{
12649 __ cmp_narrow_klass($mem$$Address, (Klass*)$src$$constant);
12650 %}
12651 ins_pipe(ialu_cr_reg_mem);
12652 %}
12653
12654 instruct testN_reg(rFlagsReg cr, rRegN src, immN0 zero) %{
12655 match(Set cr (CmpN src zero));
12656
12657 format %{ "testl $src, $src\t# compressed ptr" %}
12658 ins_encode %{ __ testl($src$$Register, $src$$Register); %}
12659 ins_pipe(ialu_cr_reg_imm);
12660 %}
12661
12662 instruct testN_mem(rFlagsReg cr, memory mem, immN0 zero)
12663 %{
12664 predicate(CompressedOops::base() != NULL);
13271 // ============================================================================
13272 // inlined locking and unlocking
13273
13274 instruct cmpFastLockRTM(rFlagsReg cr, rRegP object, rbx_RegP box, rax_RegI tmp, rdx_RegI scr, rRegI cx1, rRegI cx2) %{
13275 predicate(Compile::current()->use_rtm());
13276 match(Set cr (FastLock object box));
13277 effect(TEMP tmp, TEMP scr, TEMP cx1, TEMP cx2, USE_KILL box);
13278 ins_cost(300);
13279 format %{ "fastlock $object,$box\t! kills $box,$tmp,$scr,$cx1,$cx2" %}
13280 ins_encode %{
13281 __ fast_lock($object$$Register, $box$$Register, $tmp$$Register,
13282 $scr$$Register, $cx1$$Register, $cx2$$Register, r15_thread,
13283 _rtm_counters, _stack_rtm_counters,
13284 ((Method*)(ra_->C->method()->constant_encoding()))->method_data(),
13285 true, ra_->C->profile_rtm());
13286 %}
13287 ins_pipe(pipe_slow);
13288 %}
13289
13290 instruct cmpFastLock(rFlagsReg cr, rRegP object, rbx_RegP box, rax_RegI tmp, rRegP scr) %{
13291 predicate(!Compile::current()->use_rtm());
13292 match(Set cr (FastLock object box));
13293 effect(TEMP tmp, TEMP scr, USE_KILL box);
13294 ins_cost(300);
13295 format %{ "fastlock $object,$box\t! kills $box,$tmp,$scr" %}
13296 ins_encode %{
13297 __ fast_lock($object$$Register, $box$$Register, $tmp$$Register,
13298 $scr$$Register, noreg, noreg, r15_thread, nullptr, nullptr, nullptr, false, false);
13299 %}
13300 ins_pipe(pipe_slow);
13301 %}
13302
13303 instruct cmpFastUnlock(rFlagsReg cr, rRegP object, rax_RegP box, rRegP tmp) %{
13304 match(Set cr (FastUnlock object box));
13305 effect(TEMP tmp, USE_KILL box);
13306 ins_cost(300);
13307 format %{ "fastunlock $object,$box\t! kills $box,$tmp" %}
13308 ins_encode %{
13309 __ fast_unlock($object$$Register, $box$$Register, $tmp$$Register, ra_->C->use_rtm());
13310 %}
13311 ins_pipe(pipe_slow);
13312 %}
13313
13314
13315 // ============================================================================
13316 // Safepoint Instructions
13317 instruct safePoint_poll_tls(rFlagsReg cr, rRegP poll)
13318 %{
13319 match(SafePoint poll);
13320 effect(KILL cr, USE poll);
13321
13322 format %{ "testl rax, [$poll]\t"
13323 "# Safepoint: poll for GC" %}
13324 ins_cost(125);
13325 size(4); /* setting an explicit size will cause debug builds to assert if size is incorrect */
13326 ins_encode %{
13327 __ relocate(relocInfo::poll_type);
13328 address pre_pc = __ pc();
13329 __ testl(rax, Address($poll$$Register, 0));
13330 assert(nativeInstruction_at(pre_pc)->is_safepoint_poll(), "must emit test %%eax [reg]");
13331 %}
13332 ins_pipe(ialu_reg_mem);
13333 %}
|
5297 ins_pipe(ialu_reg_mem); // XXX
5298 %}
5299
5300
5301 // Load Klass Pointer
5302 instruct loadKlass(rRegP dst, memory mem)
5303 %{
5304 match(Set dst (LoadKlass mem));
5305
5306 ins_cost(125); // XXX
5307 format %{ "movq $dst, $mem\t# class" %}
5308 ins_encode %{
5309 __ movq($dst$$Register, $mem$$Address);
5310 %}
5311 ins_pipe(ialu_reg_mem); // XXX
5312 %}
5313
5314 // Load narrow Klass Pointer
5315 instruct loadNKlass(rRegN dst, memory mem)
5316 %{
5317 predicate(!UseCompactObjectHeaders);
5318 match(Set dst (LoadNKlass mem));
5319
5320 ins_cost(125); // XXX
5321 format %{ "movl $dst, $mem\t# compressed klass ptr" %}
5322 ins_encode %{
5323 __ movl($dst$$Register, $mem$$Address);
5324 %}
5325 ins_pipe(ialu_reg_mem); // XXX
5326 %}
5327
5328 instruct loadNKlassCompactHeaders(rRegN dst, memory mem, rFlagsReg cr)
5329 %{
5330 predicate(UseCompactObjectHeaders);
5331 match(Set dst (LoadNKlass mem));
5332 effect(KILL cr);
5333 ins_cost(125); // XXX
5334 format %{ "movl $dst, $mem\t# compressed klass ptr" %}
5335 ins_encode %{
5336 Register index = $mem$$index != 4 ? $mem$$index$$Register : noreg;
5337 Address::ScaleFactor sf = (index != noreg) ? static_cast<Address::ScaleFactor>($mem$$scale) : Address::no_scale;
5338 __ load_nklass_compact_c2($dst$$Register, $mem$$base$$Register, index, sf, $mem$$disp);
5339 %}
5340 ins_pipe(pipe_slow); // XXX
5341 %}
5342
5343 // Load Float
5344 instruct loadF(regF dst, memory mem)
5345 %{
5346 match(Set dst (LoadF mem));
5347
5348 ins_cost(145); // XXX
5349 format %{ "movss $dst, $mem\t# float" %}
5350 ins_encode %{
5351 __ movflt($dst$$XMMRegister, $mem$$Address);
5352 %}
5353 ins_pipe(pipe_slow); // XXX
5354 %}
5355
5356 // Load Double
5357 instruct loadD_partial(regD dst, memory mem)
5358 %{
5359 predicate(!UseXmmLoadAndClearUpper);
5360 match(Set dst (LoadD mem));
5361
5362 ins_cost(145); // XXX
12641
12642 format %{ "cmpl $mem, $src\t# compressed ptr" %}
12643 ins_encode %{
12644 __ cmp_narrow_oop($mem$$Address, (jobject)$src$$constant);
12645 %}
12646 ins_pipe(ialu_cr_reg_mem);
12647 %}
12648
12649 instruct compN_rReg_imm_klass(rFlagsRegU cr, rRegN op1, immNKlass op2) %{
12650 match(Set cr (CmpN op1 op2));
12651
12652 format %{ "cmpl $op1, $op2\t# compressed klass ptr" %}
12653 ins_encode %{
12654 __ cmp_narrow_klass($op1$$Register, (Klass*)$op2$$constant);
12655 %}
12656 ins_pipe(ialu_cr_reg_imm);
12657 %}
12658
12659 instruct compN_mem_imm_klass(rFlagsRegU cr, memory mem, immNKlass src)
12660 %{
12661 predicate(!UseCompactObjectHeaders);
12662 match(Set cr (CmpN src (LoadNKlass mem)));
12663
12664 format %{ "cmpl $mem, $src\t# compressed klass ptr" %}
12665 ins_encode %{
12666 __ cmp_narrow_klass($mem$$Address, (Klass*)$src$$constant);
12667 %}
12668 ins_pipe(ialu_cr_reg_mem);
12669 %}
12670
12671 instruct testN_reg(rFlagsReg cr, rRegN src, immN0 zero) %{
12672 match(Set cr (CmpN src zero));
12673
12674 format %{ "testl $src, $src\t# compressed ptr" %}
12675 ins_encode %{ __ testl($src$$Register, $src$$Register); %}
12676 ins_pipe(ialu_cr_reg_imm);
12677 %}
12678
12679 instruct testN_mem(rFlagsReg cr, memory mem, immN0 zero)
12680 %{
12681 predicate(CompressedOops::base() != NULL);
13288 // ============================================================================
13289 // inlined locking and unlocking
13290
13291 instruct cmpFastLockRTM(rFlagsReg cr, rRegP object, rbx_RegP box, rax_RegI tmp, rdx_RegI scr, rRegI cx1, rRegI cx2) %{
13292 predicate(Compile::current()->use_rtm());
13293 match(Set cr (FastLock object box));
13294 effect(TEMP tmp, TEMP scr, TEMP cx1, TEMP cx2, USE_KILL box);
13295 ins_cost(300);
13296 format %{ "fastlock $object,$box\t! kills $box,$tmp,$scr,$cx1,$cx2" %}
13297 ins_encode %{
13298 __ fast_lock($object$$Register, $box$$Register, $tmp$$Register,
13299 $scr$$Register, $cx1$$Register, $cx2$$Register, r15_thread,
13300 _rtm_counters, _stack_rtm_counters,
13301 ((Method*)(ra_->C->method()->constant_encoding()))->method_data(),
13302 true, ra_->C->profile_rtm());
13303 %}
13304 ins_pipe(pipe_slow);
13305 %}
13306
13307 instruct cmpFastLock(rFlagsReg cr, rRegP object, rbx_RegP box, rax_RegI tmp, rRegP scr) %{
13308 predicate(LockingMode != LM_LIGHTWEIGHT && !Compile::current()->use_rtm());
13309 match(Set cr (FastLock object box));
13310 effect(TEMP tmp, TEMP scr, USE_KILL box);
13311 ins_cost(300);
13312 format %{ "fastlock $object,$box\t! kills $box,$tmp,$scr" %}
13313 ins_encode %{
13314 __ fast_lock($object$$Register, $box$$Register, $tmp$$Register,
13315 $scr$$Register, noreg, noreg, r15_thread, nullptr, nullptr, nullptr, false, false);
13316 %}
13317 ins_pipe(pipe_slow);
13318 %}
13319
13320 instruct cmpFastUnlock(rFlagsReg cr, rRegP object, rax_RegP box, rRegP tmp) %{
13321 predicate(LockingMode != LM_LIGHTWEIGHT);
13322 match(Set cr (FastUnlock object box));
13323 effect(TEMP tmp, USE_KILL box);
13324 ins_cost(300);
13325 format %{ "fastunlock $object,$box\t! kills $box,$tmp" %}
13326 ins_encode %{
13327 __ fast_unlock($object$$Register, $box$$Register, $tmp$$Register, ra_->C->use_rtm());
13328 %}
13329 ins_pipe(pipe_slow);
13330 %}
13331
13332 instruct cmpFastLockLightweight(rFlagsReg cr, rRegP object, rbx_RegP box, rax_RegI rax_reg, rRegP tmp) %{
13333 predicate(LockingMode == LM_LIGHTWEIGHT);
13334 match(Set cr (FastLock object box));
13335 effect(TEMP rax_reg, TEMP tmp, USE_KILL box);
13336 ins_cost(300);
13337 format %{ "fastlock $object,$box\t! kills $box,$rax_reg,$tmp" %}
13338 ins_encode %{
13339 __ fast_lock_lightweight($object$$Register, $box$$Register, $rax_reg$$Register, $tmp$$Register, r15_thread);
13340 %}
13341 ins_pipe(pipe_slow);
13342 %}
13343
13344 instruct cmpFastUnlockLightweight(rFlagsReg cr, rRegP object, rax_RegP rax_reg, rRegP tmp) %{
13345 predicate(LockingMode == LM_LIGHTWEIGHT);
13346 match(Set cr (FastUnlock object rax_reg));
13347 effect(TEMP tmp, USE_KILL rax_reg);
13348 ins_cost(300);
13349 format %{ "fastunlock $object,$rax_reg\t! kills $rax_reg,$tmp" %}
13350 ins_encode %{
13351 __ fast_unlock_lightweight($object$$Register, $rax_reg$$Register, $tmp$$Register, r15_thread);
13352 %}
13353 ins_pipe(pipe_slow);
13354 %}
13355
13356
13357 // ============================================================================
13358 // Safepoint Instructions
13359 instruct safePoint_poll_tls(rFlagsReg cr, rRegP poll)
13360 %{
13361 match(SafePoint poll);
13362 effect(KILL cr, USE poll);
13363
13364 format %{ "testl rax, [$poll]\t"
13365 "# Safepoint: poll for GC" %}
13366 ins_cost(125);
13367 size(4); /* setting an explicit size will cause debug builds to assert if size is incorrect */
13368 ins_encode %{
13369 __ relocate(relocInfo::poll_type);
13370 address pre_pc = __ pc();
13371 __ testl(rax, Address($poll$$Register, 0));
13372 assert(nativeInstruction_at(pre_pc)->is_safepoint_poll(), "must emit test %%eax [reg]");
13373 %}
13374 ins_pipe(ialu_reg_mem);
13375 %}
|