< prev index next >

src/hotspot/cpu/x86/x86_64.ad

Print this page

 5279      __ movl($dst$$Register, $mem$$Address);
 5280    %}
 5281    ins_pipe(ialu_reg_mem); // XXX
 5282 %}
 5283 
 5284 
 5285 // Load Klass Pointer
 5286 instruct loadKlass(rRegP dst, memory mem)
 5287 %{
 5288   match(Set dst (LoadKlass mem));
 5289 
 5290   ins_cost(125); // XXX
 5291   format %{ "movq    $dst, $mem\t# class" %}
 5292   ins_encode %{
 5293     __ movq($dst$$Register, $mem$$Address);
 5294   %}
 5295   ins_pipe(ialu_reg_mem); // XXX
 5296 %}
 5297 
 5298 // Load narrow Klass Pointer
 5299 instruct loadNKlass(rRegN dst, memory mem)
 5300 %{
 5301   match(Set dst (LoadNKlass mem));
 5302 
 5303   ins_cost(125); // XXX
 5304   format %{ "movl    $dst, $mem\t# compressed klass ptr" %}
 5305   ins_encode %{
 5306     __ movl($dst$$Register, $mem$$Address);


 5307   %}
 5308   ins_pipe(ialu_reg_mem); // XXX
 5309 %}
 5310 
 5311 // Load Float
 5312 instruct loadF(regF dst, memory mem)
 5313 %{
 5314   match(Set dst (LoadF mem));
 5315 
 5316   ins_cost(145); // XXX
 5317   format %{ "movss   $dst, $mem\t# float" %}
 5318   ins_encode %{
 5319     __ movflt($dst$$XMMRegister, $mem$$Address);
 5320   %}
 5321   ins_pipe(pipe_slow); // XXX
 5322 %}
 5323 
 5324 // Load Double
 5325 instruct loadD_partial(regD dst, memory mem)
 5326 %{
 5327   predicate(!UseXmmLoadAndClearUpper);
 5328   match(Set dst (LoadD mem));

12586 %{
12587   match(Set cr (CmpN src (LoadN mem)));
12588 
12589   format %{ "cmpl    $mem, $src\t# compressed ptr" %}
12590   ins_encode %{
12591     __ cmp_narrow_oop($mem$$Address, (jobject)$src$$constant);
12592   %}
12593   ins_pipe(ialu_cr_reg_mem);
12594 %}
12595 
12596 instruct compN_rReg_imm_klass(rFlagsRegU cr, rRegN op1, immNKlass op2) %{
12597   match(Set cr (CmpN op1 op2));
12598 
12599   format %{ "cmpl    $op1, $op2\t# compressed klass ptr" %}
12600   ins_encode %{
12601     __ cmp_narrow_klass($op1$$Register, (Klass*)$op2$$constant);
12602   %}
12603   ins_pipe(ialu_cr_reg_imm);
12604 %}
12605 



12606 instruct compN_mem_imm_klass(rFlagsRegU cr, memory mem, immNKlass src)
12607 %{

12608   match(Set cr (CmpN src (LoadNKlass mem)));
12609 
12610   format %{ "cmpl    $mem, $src\t# compressed klass ptr" %}
12611   ins_encode %{
12612     __ cmp_narrow_klass($mem$$Address, (Klass*)$src$$constant);
12613   %}
12614   ins_pipe(ialu_cr_reg_mem);
12615 %}
12616 
12617 instruct testN_reg(rFlagsReg cr, rRegN src, immN0 zero) %{
12618   match(Set cr (CmpN src zero));
12619 
12620   format %{ "testl   $src, $src\t# compressed ptr" %}
12621   ins_encode %{ __ testl($src$$Register, $src$$Register); %}
12622   ins_pipe(ialu_cr_reg_imm);
12623 %}
12624 
12625 instruct testN_mem(rFlagsReg cr, memory mem, immN0 zero)
12626 %{
12627   predicate(CompressedOops::base() != NULL);

13268       __ jccb(Assembler::parity, *l);
13269       __ jccb(Assembler::notEqual, *l);
13270     } else if ($cop$$cmpcode == Assembler::equal) {
13271       Label done;
13272       __ jccb(Assembler::parity, done);
13273       __ jccb(Assembler::equal, *l);
13274       __ bind(done);
13275     } else {
13276        ShouldNotReachHere();
13277     }
13278   %}
13279   ins_pipe(pipe_jcc);
13280   ins_short_branch(1);
13281 %}
13282 
13283 // ============================================================================
13284 // inlined locking and unlocking
13285 
13286 instruct cmpFastLockRTM(rFlagsReg cr, rRegP object, rbx_RegP box, rax_RegI tmp, rdx_RegI scr, rRegI cx1, rRegI cx2) %{
13287   predicate(Compile::current()->use_rtm());
13288   match(Set cr (FastLock object box));
13289   effect(TEMP tmp, TEMP scr, TEMP cx1, TEMP cx2, USE_KILL box);
13290   ins_cost(300);
13291   format %{ "fastlock $object,$box\t! kills $box,$tmp,$scr,$cx1,$cx2" %}
13292   ins_encode %{
13293     __ fast_lock($object$$Register, $box$$Register, $tmp$$Register,
13294                  $scr$$Register, $cx1$$Register, $cx2$$Register,
13295                  _rtm_counters, _stack_rtm_counters,
13296                  ((Method*)(ra_->C->method()->constant_encoding()))->method_data(),
13297                  true, ra_->C->profile_rtm());
13298   %}
13299   ins_pipe(pipe_slow);
13300 %}
13301 
13302 instruct cmpFastLock(rFlagsReg cr, rRegP object, rbx_RegP box, rax_RegI tmp, rRegP scr, rRegP cx1) %{
13303   predicate(!Compile::current()->use_rtm());
13304   match(Set cr (FastLock object box));
13305   effect(TEMP tmp, TEMP scr, TEMP cx1, USE_KILL box);
13306   ins_cost(300);
13307   format %{ "fastlock $object,$box\t! kills $box,$tmp,$scr" %}
13308   ins_encode %{
13309     __ fast_lock($object$$Register, $box$$Register, $tmp$$Register,
13310                  $scr$$Register, $cx1$$Register, noreg, NULL, NULL, NULL, false, false);
13311   %}
13312   ins_pipe(pipe_slow);
13313 %}
13314 
13315 instruct cmpFastUnlock(rFlagsReg cr, rRegP object, rax_RegP box, rRegP tmp) %{
13316   match(Set cr (FastUnlock object box));
13317   effect(TEMP tmp, USE_KILL box);
13318   ins_cost(300);
13319   format %{ "fastunlock $object,$box\t! kills $box,$tmp" %}
13320   ins_encode %{
13321     __ fast_unlock($object$$Register, $box$$Register, $tmp$$Register, ra_->C->use_rtm());
13322   %}
13323   ins_pipe(pipe_slow);
13324 %}
13325 
13326 
13327 // ============================================================================
13328 // Safepoint Instructions
13329 instruct safePoint_poll_tls(rFlagsReg cr, rRegP poll)
13330 %{
13331   match(SafePoint poll);
13332   effect(KILL cr, USE poll);
13333 
13334   format %{ "testl   rax, [$poll]\t"
13335             "# Safepoint: poll for GC" %}
13336   ins_cost(125);
13337   size(4); /* setting an explicit size will cause debug builds to assert if size is incorrect */

 5279      __ movl($dst$$Register, $mem$$Address);
 5280    %}
 5281    ins_pipe(ialu_reg_mem); // XXX
 5282 %}
 5283 
 5284 
 5285 // Load Klass Pointer
 5286 instruct loadKlass(rRegP dst, memory mem)
 5287 %{
 5288   match(Set dst (LoadKlass mem));
 5289 
 5290   ins_cost(125); // XXX
 5291   format %{ "movq    $dst, $mem\t# class" %}
 5292   ins_encode %{
 5293     __ movq($dst$$Register, $mem$$Address);
 5294   %}
 5295   ins_pipe(ialu_reg_mem); // XXX
 5296 %}
 5297 
 5298 // Load narrow Klass Pointer
 5299 instruct loadNKlass(rRegN dst, indOffset8 mem, rFlagsReg cr)
 5300 %{
 5301   match(Set dst (LoadNKlass mem));
 5302   effect(TEMP_DEF dst, KILL cr);
 5303   ins_cost(125); // XXX
 5304   format %{ "movl    $dst, $mem\t# compressed klass ptr" %}
 5305   ins_encode %{
 5306     assert($mem$$disp == oopDesc::klass_offset_in_bytes(), "expect correct offset 4, but got: %d", $mem$$disp);
 5307     assert($mem$$index == 4, "expect no index register: %d", $mem$$index);
 5308     __ load_nklass($dst$$Register, $mem$$base$$Register);
 5309   %}
 5310   ins_pipe(pipe_slow); // XXX
 5311 %}
 5312 
 5313 // Load Float
 5314 instruct loadF(regF dst, memory mem)
 5315 %{
 5316   match(Set dst (LoadF mem));
 5317 
 5318   ins_cost(145); // XXX
 5319   format %{ "movss   $dst, $mem\t# float" %}
 5320   ins_encode %{
 5321     __ movflt($dst$$XMMRegister, $mem$$Address);
 5322   %}
 5323   ins_pipe(pipe_slow); // XXX
 5324 %}
 5325 
 5326 // Load Double
 5327 instruct loadD_partial(regD dst, memory mem)
 5328 %{
 5329   predicate(!UseXmmLoadAndClearUpper);
 5330   match(Set dst (LoadD mem));

12588 %{
12589   match(Set cr (CmpN src (LoadN mem)));
12590 
12591   format %{ "cmpl    $mem, $src\t# compressed ptr" %}
12592   ins_encode %{
12593     __ cmp_narrow_oop($mem$$Address, (jobject)$src$$constant);
12594   %}
12595   ins_pipe(ialu_cr_reg_mem);
12596 %}
12597 
12598 instruct compN_rReg_imm_klass(rFlagsRegU cr, rRegN op1, immNKlass op2) %{
12599   match(Set cr (CmpN op1 op2));
12600 
12601   format %{ "cmpl    $op1, $op2\t# compressed klass ptr" %}
12602   ins_encode %{
12603     __ cmp_narrow_klass($op1$$Register, (Klass*)$op2$$constant);
12604   %}
12605   ins_pipe(ialu_cr_reg_imm);
12606 %}
12607 
12608 // Disabled because the compressed Klass* in header cannot be safely
12609 // accessed. TODO: Re-enable it as soon as synchronization does not
12610 // overload the upper header bits anymore.
12611 instruct compN_mem_imm_klass(rFlagsRegU cr, memory mem, immNKlass src)
12612 %{
12613   predicate(false);
12614   match(Set cr (CmpN src (LoadNKlass mem)));
12615 
12616   format %{ "cmpl    $mem, $src\t# compressed klass ptr" %}
12617   ins_encode %{
12618     __ cmp_narrow_klass($mem$$Address, (Klass*)$src$$constant);
12619   %}
12620   ins_pipe(ialu_cr_reg_mem);
12621 %}
12622 
12623 instruct testN_reg(rFlagsReg cr, rRegN src, immN0 zero) %{
12624   match(Set cr (CmpN src zero));
12625 
12626   format %{ "testl   $src, $src\t# compressed ptr" %}
12627   ins_encode %{ __ testl($src$$Register, $src$$Register); %}
12628   ins_pipe(ialu_cr_reg_imm);
12629 %}
12630 
12631 instruct testN_mem(rFlagsReg cr, memory mem, immN0 zero)
12632 %{
12633   predicate(CompressedOops::base() != NULL);

13274       __ jccb(Assembler::parity, *l);
13275       __ jccb(Assembler::notEqual, *l);
13276     } else if ($cop$$cmpcode == Assembler::equal) {
13277       Label done;
13278       __ jccb(Assembler::parity, done);
13279       __ jccb(Assembler::equal, *l);
13280       __ bind(done);
13281     } else {
13282        ShouldNotReachHere();
13283     }
13284   %}
13285   ins_pipe(pipe_jcc);
13286   ins_short_branch(1);
13287 %}
13288 
13289 // ============================================================================
13290 // inlined locking and unlocking
13291 
13292 instruct cmpFastLockRTM(rFlagsReg cr, rRegP object, rbx_RegP box, rax_RegI tmp, rdx_RegI scr, rRegI cx1, rRegI cx2) %{
13293   predicate(Compile::current()->use_rtm());
13294   match(Set cr (FastLock object));
13295   effect(TEMP tmp, TEMP scr, TEMP cx1, TEMP cx2, TEMP box);
13296   ins_cost(300);
13297   format %{ "fastlock $object,$box\t! kills $box,$tmp,$scr,$cx1,$cx2" %}
13298   ins_encode %{
13299     __ fast_lock($object$$Register, $box$$Register, $tmp$$Register,
13300                  $scr$$Register, $cx1$$Register, $cx2$$Register, r15_thread,
13301                  _rtm_counters, _stack_rtm_counters,
13302                  ((Method*)(ra_->C->method()->constant_encoding()))->method_data(),
13303                  true, ra_->C->profile_rtm());
13304   %}
13305   ins_pipe(pipe_slow);
13306 %}
13307 
13308 instruct cmpFastLock(rFlagsReg cr, rRegP object, rax_RegI tmp, rRegP scr, rRegP cx1) %{
13309   predicate(!Compile::current()->use_rtm());
13310   match(Set cr (FastLock object));
13311   effect(TEMP tmp, TEMP scr, TEMP cx1);
13312   ins_cost(300);
13313   format %{ "fastlock $object\t! kills $tmp,$scr" %}
13314   ins_encode %{
13315     __ fast_lock($object$$Register, noreg, $tmp$$Register,
13316                  $scr$$Register, $cx1$$Register, noreg, r15_thread, NULL, NULL, NULL, false, false);
13317   %}
13318   ins_pipe(pipe_slow);
13319 %}
13320 
13321 instruct cmpFastUnlock(rFlagsReg cr, rRegP object, rax_RegP box, rRegP tmp) %{
13322   match(Set cr (FastUnlock object));
13323   effect(TEMP tmp, TEMP 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 
13333 // ============================================================================
13334 // Safepoint Instructions
13335 instruct safePoint_poll_tls(rFlagsReg cr, rRegP poll)
13336 %{
13337   match(SafePoint poll);
13338   effect(KILL cr, USE poll);
13339 
13340   format %{ "testl   rax, [$poll]\t"
13341             "# Safepoint: poll for GC" %}
13342   ins_cost(125);
13343   size(4); /* setting an explicit size will cause debug builds to assert if size is incorrect */
< prev index next >