< prev index next >

src/hotspot/cpu/aarch64/aarch64.ad

Print this page

 7129 %}
 7130 
 7131 // Load Klass Pointer
 7132 instruct loadKlass(iRegPNoSp dst, memory8 mem)
 7133 %{
 7134   match(Set dst (LoadKlass mem));
 7135   predicate(!needs_acquiring_load(n));
 7136 
 7137   ins_cost(4 * INSN_COST);
 7138   format %{ "ldr  $dst, $mem\t# class" %}
 7139 
 7140   ins_encode(aarch64_enc_ldr(dst, mem));
 7141 
 7142   ins_pipe(iload_reg_mem);
 7143 %}
 7144 
 7145 // Load Narrow Klass Pointer
 7146 instruct loadNKlass(iRegNNoSp dst, memory4 mem)
 7147 %{
 7148   match(Set dst (LoadNKlass mem));
 7149   predicate(!needs_acquiring_load(n));
 7150 
 7151   ins_cost(4 * INSN_COST);
 7152   format %{ "ldrw  $dst, $mem\t# compressed class ptr" %}
 7153 
 7154   ins_encode(aarch64_enc_ldrw(dst, mem));
 7155 
 7156   ins_pipe(iload_reg_mem);
 7157 %}
 7158 














 7159 // Load Float
 7160 instruct loadF(vRegF dst, memory4 mem)
 7161 %{
 7162   match(Set dst (LoadF mem));
 7163   predicate(!needs_acquiring_load(n));
 7164 
 7165   ins_cost(4 * INSN_COST);
 7166   format %{ "ldrs  $dst, $mem\t# float" %}
 7167 
 7168   ins_encode( aarch64_enc_ldrs(dst, mem) );
 7169 
 7170   ins_pipe(pipe_class_memory);
 7171 %}
 7172 
 7173 // Load Double
 7174 instruct loadD(vRegD dst, memory8 mem)
 7175 %{
 7176   match(Set dst (LoadD mem));
 7177   predicate(!needs_acquiring_load(n));
 7178 

16420   effect(USE lbl);
16421 
16422   ins_cost(BRANCH_COST);
16423   // short variant.
16424   // ins_short_branch(1);
16425   format %{ "b$cmp $lbl \t// counted loop end" %}
16426 
16427   ins_encode(aarch64_enc_br_con(cmp, lbl));
16428 
16429   ins_pipe(pipe_branch);
16430 %}
16431 
16432 // counted loop end branch far
16433 // TODO: fixme
16434 
16435 // ============================================================================
16436 // inlined locking and unlocking
16437 
16438 instruct cmpFastLock(rFlagsReg cr, iRegP object, iRegP box, iRegPNoSp tmp, iRegPNoSp tmp2, iRegPNoSp tmp3)
16439 %{

16440   match(Set cr (FastLock object box));
16441   effect(TEMP tmp, TEMP tmp2, TEMP tmp3);
16442 
16443   // TODO
16444   // identify correct cost
16445   ins_cost(5 * INSN_COST);
16446   format %{ "fastlock $object,$box\t! kills $tmp,$tmp2" %}
16447 
16448   ins_encode %{
16449     __ fast_lock($object$$Register, $box$$Register, $tmp$$Register, $tmp2$$Register, $tmp3$$Register);
16450   %}
16451 
16452   ins_pipe(pipe_serial);
16453 %}
16454 
16455 instruct cmpFastUnlock(rFlagsReg cr, iRegP object, iRegP box, iRegPNoSp tmp, iRegPNoSp tmp2)
16456 %{

16457   match(Set cr (FastUnlock object box));
16458   effect(TEMP tmp, TEMP tmp2);
16459 
16460   ins_cost(5 * INSN_COST);
16461   format %{ "fastunlock $object,$box\t! kills $tmp, $tmp2" %}
16462 
16463   ins_encode %{
16464     __ fast_unlock($object$$Register, $box$$Register, $tmp$$Register, $tmp2$$Register);
16465   %}
16466 
16467   ins_pipe(pipe_serial);
16468 %}
16469 































16470 
16471 // ============================================================================
16472 // Safepoint Instructions
16473 
16474 // TODO
16475 // provide a near and far version of this code
16476 
16477 instruct safePoint(rFlagsReg cr, iRegP poll)
16478 %{
16479   match(SafePoint poll);
16480   effect(KILL cr);
16481 
16482   format %{
16483     "ldrw zr, [$poll]\t# Safepoint: poll for GC"
16484   %}
16485   ins_encode %{
16486     __ read_polling_page(as_Register($poll$$reg), relocInfo::poll_type);
16487   %}
16488   ins_pipe(pipe_serial); // ins_pipe(iload_reg_mem);
16489 %}

 7129 %}
 7130 
 7131 // Load Klass Pointer
 7132 instruct loadKlass(iRegPNoSp dst, memory8 mem)
 7133 %{
 7134   match(Set dst (LoadKlass mem));
 7135   predicate(!needs_acquiring_load(n));
 7136 
 7137   ins_cost(4 * INSN_COST);
 7138   format %{ "ldr  $dst, $mem\t# class" %}
 7139 
 7140   ins_encode(aarch64_enc_ldr(dst, mem));
 7141 
 7142   ins_pipe(iload_reg_mem);
 7143 %}
 7144 
 7145 // Load Narrow Klass Pointer
 7146 instruct loadNKlass(iRegNNoSp dst, memory4 mem)
 7147 %{
 7148   match(Set dst (LoadNKlass mem));
 7149   predicate(!needs_acquiring_load(n) && !UseCompactObjectHeaders);
 7150 
 7151   ins_cost(4 * INSN_COST);
 7152   format %{ "ldrw  $dst, $mem\t# compressed class ptr" %}
 7153 
 7154   ins_encode(aarch64_enc_ldrw(dst, mem));
 7155 
 7156   ins_pipe(iload_reg_mem);
 7157 %}
 7158 
 7159 instruct loadNKlassCompactHeaders(iRegNNoSp dst, memory4 mem, rFlagsReg cr)
 7160 %{
 7161   match(Set dst (LoadNKlass mem));
 7162   effect(KILL cr);
 7163   predicate(!needs_acquiring_load(n) && UseCompactObjectHeaders);
 7164 
 7165   ins_cost(4 * INSN_COST);
 7166   format %{ "ldrw  $dst, $mem\t# compressed class ptr" %}
 7167   ins_encode %{
 7168     __ load_nklass_compact($dst$$Register, $mem$$base$$Register, $mem$$index$$Register, $mem$$scale, $mem$$disp);
 7169   %}
 7170   ins_pipe(pipe_slow);
 7171 %}
 7172 
 7173 // Load Float
 7174 instruct loadF(vRegF dst, memory4 mem)
 7175 %{
 7176   match(Set dst (LoadF mem));
 7177   predicate(!needs_acquiring_load(n));
 7178 
 7179   ins_cost(4 * INSN_COST);
 7180   format %{ "ldrs  $dst, $mem\t# float" %}
 7181 
 7182   ins_encode( aarch64_enc_ldrs(dst, mem) );
 7183 
 7184   ins_pipe(pipe_class_memory);
 7185 %}
 7186 
 7187 // Load Double
 7188 instruct loadD(vRegD dst, memory8 mem)
 7189 %{
 7190   match(Set dst (LoadD mem));
 7191   predicate(!needs_acquiring_load(n));
 7192 

16434   effect(USE lbl);
16435 
16436   ins_cost(BRANCH_COST);
16437   // short variant.
16438   // ins_short_branch(1);
16439   format %{ "b$cmp $lbl \t// counted loop end" %}
16440 
16441   ins_encode(aarch64_enc_br_con(cmp, lbl));
16442 
16443   ins_pipe(pipe_branch);
16444 %}
16445 
16446 // counted loop end branch far
16447 // TODO: fixme
16448 
16449 // ============================================================================
16450 // inlined locking and unlocking
16451 
16452 instruct cmpFastLock(rFlagsReg cr, iRegP object, iRegP box, iRegPNoSp tmp, iRegPNoSp tmp2, iRegPNoSp tmp3)
16453 %{
16454   predicate(LockingMode != LM_LIGHTWEIGHT);
16455   match(Set cr (FastLock object box));
16456   effect(TEMP tmp, TEMP tmp2, TEMP tmp3);
16457 


16458   ins_cost(5 * INSN_COST);
16459   format %{ "fastlock $object,$box\t! kills $tmp,$tmp2,$tmp3" %}
16460 
16461   ins_encode %{
16462     __ fast_lock($object$$Register, $box$$Register, $tmp$$Register, $tmp2$$Register, $tmp3$$Register);
16463   %}
16464 
16465   ins_pipe(pipe_serial);
16466 %}
16467 
16468 instruct cmpFastUnlock(rFlagsReg cr, iRegP object, iRegP box, iRegPNoSp tmp, iRegPNoSp tmp2)
16469 %{
16470   predicate(LockingMode != LM_LIGHTWEIGHT);
16471   match(Set cr (FastUnlock object box));
16472   effect(TEMP tmp, TEMP tmp2);
16473 
16474   ins_cost(5 * INSN_COST);
16475   format %{ "fastunlock $object,$box\t! kills $tmp, $tmp2" %}
16476 
16477   ins_encode %{
16478     __ fast_unlock($object$$Register, $box$$Register, $tmp$$Register, $tmp2$$Register);
16479   %}
16480 
16481   ins_pipe(pipe_serial);
16482 %}
16483 
16484 instruct cmpFastLockLightweight(rFlagsReg cr, iRegP object, iRegP box, iRegPNoSp tmp, iRegPNoSp tmp2)
16485 %{
16486   predicate(LockingMode == LM_LIGHTWEIGHT);
16487   match(Set cr (FastLock object box));
16488   effect(TEMP tmp, TEMP tmp2);
16489 
16490   ins_cost(5 * INSN_COST);
16491   format %{ "fastlock $object,$box\t! kills $tmp,$tmp2" %}
16492 
16493   ins_encode %{
16494     __ fast_lock_lightweight($object$$Register, $box$$Register, $tmp$$Register, $tmp2$$Register);
16495   %}
16496 
16497   ins_pipe(pipe_serial);
16498 %}
16499 
16500 instruct cmpFastUnlockLightweight(rFlagsReg cr, iRegP object, iRegP box, iRegPNoSp tmp, iRegPNoSp tmp2)
16501 %{
16502   predicate(LockingMode == LM_LIGHTWEIGHT);
16503   match(Set cr (FastUnlock object box));
16504   effect(TEMP tmp, TEMP tmp2);
16505 
16506   ins_cost(5 * INSN_COST);
16507   format %{ "fastunlock $object,$box\t! kills $tmp, $tmp2" %}
16508 
16509   ins_encode %{
16510     __ fast_unlock_lightweight($object$$Register, $box$$Register, $tmp$$Register, $tmp2$$Register);
16511   %}
16512 
16513   ins_pipe(pipe_serial);
16514 %}
16515 
16516 // ============================================================================
16517 // Safepoint Instructions
16518 
16519 // TODO
16520 // provide a near and far version of this code
16521 
16522 instruct safePoint(rFlagsReg cr, iRegP poll)
16523 %{
16524   match(SafePoint poll);
16525   effect(KILL cr);
16526 
16527   format %{
16528     "ldrw zr, [$poll]\t# Safepoint: poll for GC"
16529   %}
16530   ins_encode %{
16531     __ read_polling_page(as_Register($poll$$reg), relocInfo::poll_type);
16532   %}
16533   ins_pipe(pipe_serial); // ins_pipe(iload_reg_mem);
16534 %}
< prev index next >