< prev index next >

src/hotspot/cpu/aarch64/aarch64.ad

Print this page

 7107 %}
 7108 
 7109 // Load Klass Pointer
 7110 instruct loadKlass(iRegPNoSp dst, memory8 mem)
 7111 %{
 7112   match(Set dst (LoadKlass mem));
 7113   predicate(!needs_acquiring_load(n));
 7114 
 7115   ins_cost(4 * INSN_COST);
 7116   format %{ "ldr  $dst, $mem\t# class" %}
 7117 
 7118   ins_encode(aarch64_enc_ldr(dst, mem));
 7119 
 7120   ins_pipe(iload_reg_mem);
 7121 %}
 7122 
 7123 // Load Narrow Klass Pointer
 7124 instruct loadNKlass(iRegNNoSp dst, memory4 mem)
 7125 %{
 7126   match(Set dst (LoadNKlass mem));
 7127   predicate(!needs_acquiring_load(n));
 7128 
 7129   ins_cost(4 * INSN_COST);
 7130   format %{ "ldrw  $dst, $mem\t# compressed class ptr" %}
 7131 
 7132   ins_encode(aarch64_enc_ldrw(dst, mem));
 7133 
 7134   ins_pipe(iload_reg_mem);
 7135 %}
 7136 














 7137 // Load Float
 7138 instruct loadF(vRegF dst, memory4 mem)
 7139 %{
 7140   match(Set dst (LoadF mem));
 7141   predicate(!needs_acquiring_load(n));
 7142 
 7143   ins_cost(4 * INSN_COST);
 7144   format %{ "ldrs  $dst, $mem\t# float" %}
 7145 
 7146   ins_encode( aarch64_enc_ldrs(dst, mem) );
 7147 
 7148   ins_pipe(pipe_class_memory);
 7149 %}
 7150 
 7151 // Load Double
 7152 instruct loadD(vRegD dst, memory8 mem)
 7153 %{
 7154   match(Set dst (LoadD mem));
 7155   predicate(!needs_acquiring_load(n));
 7156 

16398   effect(USE lbl);
16399 
16400   ins_cost(BRANCH_COST);
16401   // short variant.
16402   // ins_short_branch(1);
16403   format %{ "b$cmp $lbl \t// counted loop end" %}
16404 
16405   ins_encode(aarch64_enc_br_con(cmp, lbl));
16406 
16407   ins_pipe(pipe_branch);
16408 %}
16409 
16410 // counted loop end branch far
16411 // TODO: fixme
16412 
16413 // ============================================================================
16414 // inlined locking and unlocking
16415 
16416 instruct cmpFastLock(rFlagsReg cr, iRegP object, iRegP box, iRegPNoSp tmp, iRegPNoSp tmp2, iRegPNoSp tmp3)
16417 %{

16418   match(Set cr (FastLock object box));
16419   effect(TEMP tmp, TEMP tmp2, TEMP tmp3);
16420 
16421   // TODO
16422   // identify correct cost
16423   ins_cost(5 * INSN_COST);
16424   format %{ "fastlock $object,$box\t! kills $tmp,$tmp2" %}
16425 
16426   ins_encode %{
16427     __ fast_lock($object$$Register, $box$$Register, $tmp$$Register, $tmp2$$Register, $tmp3$$Register);
16428   %}
16429 
16430   ins_pipe(pipe_serial);
16431 %}
16432 
16433 instruct cmpFastUnlock(rFlagsReg cr, iRegP object, iRegP box, iRegPNoSp tmp, iRegPNoSp tmp2)
16434 %{

16435   match(Set cr (FastUnlock object box));
16436   effect(TEMP tmp, TEMP tmp2);
16437 
16438   ins_cost(5 * INSN_COST);
16439   format %{ "fastunlock $object,$box\t! kills $tmp, $tmp2" %}
16440 
16441   ins_encode %{
16442     __ fast_unlock($object$$Register, $box$$Register, $tmp$$Register, $tmp2$$Register);
16443   %}
16444 
16445   ins_pipe(pipe_serial);
16446 %}
16447 































16448 
16449 // ============================================================================
16450 // Safepoint Instructions
16451 
16452 // TODO
16453 // provide a near and far version of this code
16454 
16455 instruct safePoint(rFlagsReg cr, iRegP poll)
16456 %{
16457   match(SafePoint poll);
16458   effect(KILL cr);
16459 
16460   format %{
16461     "ldrw zr, [$poll]\t# Safepoint: poll for GC"
16462   %}
16463   ins_encode %{
16464     __ read_polling_page(as_Register($poll$$reg), relocInfo::poll_type);
16465   %}
16466   ins_pipe(pipe_serial); // ins_pipe(iload_reg_mem);
16467 %}

 7107 %}
 7108 
 7109 // Load Klass Pointer
 7110 instruct loadKlass(iRegPNoSp dst, memory8 mem)
 7111 %{
 7112   match(Set dst (LoadKlass mem));
 7113   predicate(!needs_acquiring_load(n));
 7114 
 7115   ins_cost(4 * INSN_COST);
 7116   format %{ "ldr  $dst, $mem\t# class" %}
 7117 
 7118   ins_encode(aarch64_enc_ldr(dst, mem));
 7119 
 7120   ins_pipe(iload_reg_mem);
 7121 %}
 7122 
 7123 // Load Narrow Klass Pointer
 7124 instruct loadNKlass(iRegNNoSp dst, memory4 mem)
 7125 %{
 7126   match(Set dst (LoadNKlass mem));
 7127   predicate(!needs_acquiring_load(n) && !UseCompactObjectHeaders);
 7128 
 7129   ins_cost(4 * INSN_COST);
 7130   format %{ "ldrw  $dst, $mem\t# compressed class ptr" %}
 7131 
 7132   ins_encode(aarch64_enc_ldrw(dst, mem));
 7133 
 7134   ins_pipe(iload_reg_mem);
 7135 %}
 7136 
 7137 instruct loadNKlassCompactHeaders(iRegNNoSp dst, memory4 mem, rFlagsReg cr)
 7138 %{
 7139   match(Set dst (LoadNKlass mem));
 7140   effect(KILL cr);
 7141   predicate(!needs_acquiring_load(n) && UseCompactObjectHeaders);
 7142 
 7143   ins_cost(4 * INSN_COST);
 7144   format %{ "ldrw  $dst, $mem\t# compressed class ptr" %}
 7145   ins_encode %{
 7146     __ load_nklass_compact($dst$$Register, $mem$$base$$Register, $mem$$index$$Register, $mem$$scale, $mem$$disp);
 7147   %}
 7148   ins_pipe(pipe_slow);
 7149 %}
 7150 
 7151 // Load Float
 7152 instruct loadF(vRegF dst, memory4 mem)
 7153 %{
 7154   match(Set dst (LoadF mem));
 7155   predicate(!needs_acquiring_load(n));
 7156 
 7157   ins_cost(4 * INSN_COST);
 7158   format %{ "ldrs  $dst, $mem\t# float" %}
 7159 
 7160   ins_encode( aarch64_enc_ldrs(dst, mem) );
 7161 
 7162   ins_pipe(pipe_class_memory);
 7163 %}
 7164 
 7165 // Load Double
 7166 instruct loadD(vRegD dst, memory8 mem)
 7167 %{
 7168   match(Set dst (LoadD mem));
 7169   predicate(!needs_acquiring_load(n));
 7170 

16412   effect(USE lbl);
16413 
16414   ins_cost(BRANCH_COST);
16415   // short variant.
16416   // ins_short_branch(1);
16417   format %{ "b$cmp $lbl \t// counted loop end" %}
16418 
16419   ins_encode(aarch64_enc_br_con(cmp, lbl));
16420 
16421   ins_pipe(pipe_branch);
16422 %}
16423 
16424 // counted loop end branch far
16425 // TODO: fixme
16426 
16427 // ============================================================================
16428 // inlined locking and unlocking
16429 
16430 instruct cmpFastLock(rFlagsReg cr, iRegP object, iRegP box, iRegPNoSp tmp, iRegPNoSp tmp2, iRegPNoSp tmp3)
16431 %{
16432   predicate(LockingMode != LM_LIGHTWEIGHT);
16433   match(Set cr (FastLock object box));
16434   effect(TEMP tmp, TEMP tmp2, TEMP tmp3);
16435 


16436   ins_cost(5 * INSN_COST);
16437   format %{ "fastlock $object,$box\t! kills $tmp,$tmp2,$tmp3" %}
16438 
16439   ins_encode %{
16440     __ fast_lock($object$$Register, $box$$Register, $tmp$$Register, $tmp2$$Register, $tmp3$$Register);
16441   %}
16442 
16443   ins_pipe(pipe_serial);
16444 %}
16445 
16446 instruct cmpFastUnlock(rFlagsReg cr, iRegP object, iRegP box, iRegPNoSp tmp, iRegPNoSp tmp2)
16447 %{
16448   predicate(LockingMode != LM_LIGHTWEIGHT);
16449   match(Set cr (FastUnlock object box));
16450   effect(TEMP tmp, TEMP tmp2);
16451 
16452   ins_cost(5 * INSN_COST);
16453   format %{ "fastunlock $object,$box\t! kills $tmp, $tmp2" %}
16454 
16455   ins_encode %{
16456     __ fast_unlock($object$$Register, $box$$Register, $tmp$$Register, $tmp2$$Register);
16457   %}
16458 
16459   ins_pipe(pipe_serial);
16460 %}
16461 
16462 instruct cmpFastLockLightweight(rFlagsReg cr, iRegP object, iRegP box, iRegPNoSp tmp, iRegPNoSp tmp2)
16463 %{
16464   predicate(LockingMode == LM_LIGHTWEIGHT);
16465   match(Set cr (FastLock object box));
16466   effect(TEMP tmp, TEMP tmp2);
16467 
16468   ins_cost(5 * INSN_COST);
16469   format %{ "fastlock $object,$box\t! kills $tmp,$tmp2" %}
16470 
16471   ins_encode %{
16472     __ fast_lock_lightweight($object$$Register, $box$$Register, $tmp$$Register, $tmp2$$Register);
16473   %}
16474 
16475   ins_pipe(pipe_serial);
16476 %}
16477 
16478 instruct cmpFastUnlockLightweight(rFlagsReg cr, iRegP object, iRegP box, iRegPNoSp tmp, iRegPNoSp tmp2)
16479 %{
16480   predicate(LockingMode == LM_LIGHTWEIGHT);
16481   match(Set cr (FastUnlock object box));
16482   effect(TEMP tmp, TEMP tmp2);
16483 
16484   ins_cost(5 * INSN_COST);
16485   format %{ "fastunlock $object,$box\t! kills $tmp, $tmp2" %}
16486 
16487   ins_encode %{
16488     __ fast_unlock_lightweight($object$$Register, $box$$Register, $tmp$$Register, $tmp2$$Register);
16489   %}
16490 
16491   ins_pipe(pipe_serial);
16492 %}
16493 
16494 // ============================================================================
16495 // Safepoint Instructions
16496 
16497 // TODO
16498 // provide a near and far version of this code
16499 
16500 instruct safePoint(rFlagsReg cr, iRegP poll)
16501 %{
16502   match(SafePoint poll);
16503   effect(KILL cr);
16504 
16505   format %{
16506     "ldrw zr, [$poll]\t# Safepoint: poll for GC"
16507   %}
16508   ins_encode %{
16509     __ read_polling_page(as_Register($poll$$reg), relocInfo::poll_type);
16510   %}
16511   ins_pipe(pipe_serial); // ins_pipe(iload_reg_mem);
16512 %}
< prev index next >