< prev index next >

src/hotspot/cpu/ppc/ppc.ad

Print this page

12119 // GL TODO: Improve this.
12120 // - result should not be a TEMP
12121 // - Add match rule as on sparc avoiding additional Cmp.
12122 instruct partialSubtypeCheck(iRegPdst result, iRegP_N2P subklass, iRegP_N2P superklass,
12123                              iRegPdst tmp_klass, iRegPdst tmp_arrayptr) %{
12124   match(Set result (PartialSubtypeCheck subklass superklass));
12125   effect(TEMP_DEF result, TEMP tmp_klass, TEMP tmp_arrayptr);
12126   ins_cost(DEFAULT_COST*10);
12127 
12128   format %{ "PartialSubtypeCheck $result = ($subklass instanceOf $superklass) tmp: $tmp_klass, $tmp_arrayptr" %}
12129   ins_encode %{
12130     __ check_klass_subtype_slow_path($subklass$$Register, $superklass$$Register, $tmp_arrayptr$$Register,
12131                                      $tmp_klass$$Register, NULL, $result$$Register);
12132   %}
12133   ins_pipe(pipe_class_default);
12134 %}
12135 
12136 // inlined locking and unlocking
12137 
12138 instruct cmpFastLock(flagsRegCR0 crx, iRegPdst oop, iRegPdst box, iRegPdst tmp1, iRegPdst tmp2) %{

12139   match(Set crx (FastLock oop box));
12140   effect(TEMP tmp1, TEMP tmp2);
12141   predicate(!Compile::current()->use_rtm());
12142 
12143   format %{ "FASTLOCK  $oop, $box, $tmp1, $tmp2" %}
12144   ins_encode %{
12145     __ compiler_fast_lock_object($crx$$CondRegister, $oop$$Register, $box$$Register,
12146                                  $tmp1$$Register, $tmp2$$Register, /*tmp3*/ R0);
12147     // If locking was successful, crx should indicate 'EQ'.
12148     // The compiler generates a branch to the runtime call to
12149     // _complete_monitor_locking_Java for the case where crx is 'NE'.
12150   %}
12151   ins_pipe(pipe_class_compare);
12152 %}
12153 
12154 // Separate version for TM. Use bound register for box to enable USE_KILL.
12155 instruct cmpFastLock_tm(flagsReg crx, iRegPdst oop, rarg2RegP box, iRegPdst tmp1, iRegPdst tmp2, iRegPdst tmp3) %{
12156   match(Set crx (FastLock oop box));
12157   effect(TEMP tmp1, TEMP tmp2, TEMP tmp3, USE_KILL box);
12158   predicate(Compile::current()->use_rtm());
12159 
12160   format %{ "FASTLOCK  $oop, $box, $tmp1, $tmp2, $tmp3 (TM)" %}
12161   ins_encode %{
12162     __ compiler_fast_lock_object($crx$$CondRegister, $oop$$Register, $box$$Register,
12163                                  $tmp1$$Register, $tmp2$$Register, $tmp3$$Register,
12164                                  _rtm_counters, _stack_rtm_counters,
12165                                  ((Method*)(ra_->C->method()->constant_encoding()))->method_data(),
12166                                  /*RTM*/ true, ra_->C->profile_rtm());
12167     // If locking was successful, crx should indicate 'EQ'.
12168     // The compiler generates a branch to the runtime call to
12169     // _complete_monitor_locking_Java for the case where crx is 'NE'.
12170   %}
12171   ins_pipe(pipe_class_compare);
12172 %}
12173 
12174 instruct cmpFastUnlock(flagsRegCR0 crx, iRegPdst oop, iRegPdst box, iRegPdst tmp1, iRegPdst tmp2, iRegPdst tmp3) %{

12175   match(Set crx (FastUnlock oop box));
12176   effect(TEMP tmp1, TEMP tmp2, TEMP tmp3);
12177   predicate(!Compile::current()->use_rtm());
12178 
12179   format %{ "FASTUNLOCK  $oop, $box, $tmp1, $tmp2" %}
12180   ins_encode %{
12181     __ compiler_fast_unlock_object($crx$$CondRegister, $oop$$Register, $box$$Register,
12182                                    $tmp1$$Register, $tmp2$$Register, $tmp3$$Register,
12183                                    false);
12184     // If unlocking was successful, crx should indicate 'EQ'.
12185     // The compiler generates a branch to the runtime call to
12186     // _complete_monitor_unlocking_Java for the case where crx is 'NE'.
12187   %}
12188   ins_pipe(pipe_class_compare);
12189 %}
12190 
12191 instruct cmpFastUnlock_tm(flagsReg crx, iRegPdst oop, iRegPdst box, iRegPdst tmp1, iRegPdst tmp2, iRegPdst tmp3) %{

















12192   match(Set crx (FastUnlock oop box));
12193   effect(TEMP tmp1, TEMP tmp2, TEMP tmp3);
12194   predicate(Compile::current()->use_rtm());
12195 
12196   format %{ "FASTUNLOCK  $oop, $box, $tmp1, $tmp2 (TM)" %}
12197   ins_encode %{
12198     __ compiler_fast_unlock_object($crx$$CondRegister, $oop$$Register, $box$$Register,
12199                                    $tmp1$$Register, $tmp2$$Register, $tmp3$$Register,
12200                                    /*RTM*/ true);
12201     // If unlocking was successful, crx should indicate 'EQ'.
12202     // The compiler generates a branch to the runtime call to
12203     // _complete_monitor_unlocking_Java for the case where crx is 'NE'.
12204   %}
12205   ins_pipe(pipe_class_compare);
12206 %}
12207 
12208 // Align address.
12209 instruct align_addr(iRegPdst dst, iRegPsrc src, immLnegpow2 mask) %{
12210   match(Set dst (CastX2P (AndL (CastP2X src) mask)));
12211 
12212   format %{ "ANDDI   $dst, $src, $mask \t// next aligned address" %}
12213   size(4);
12214   ins_encode %{
12215     __ clrrdi($dst$$Register, $src$$Register, log2i_exact(-(julong)$mask$$constant));
12216   %}
12217   ins_pipe(pipe_class_default);
12218 %}
12219 
12220 // Array size computation.

12119 // GL TODO: Improve this.
12120 // - result should not be a TEMP
12121 // - Add match rule as on sparc avoiding additional Cmp.
12122 instruct partialSubtypeCheck(iRegPdst result, iRegP_N2P subklass, iRegP_N2P superklass,
12123                              iRegPdst tmp_klass, iRegPdst tmp_arrayptr) %{
12124   match(Set result (PartialSubtypeCheck subklass superklass));
12125   effect(TEMP_DEF result, TEMP tmp_klass, TEMP tmp_arrayptr);
12126   ins_cost(DEFAULT_COST*10);
12127 
12128   format %{ "PartialSubtypeCheck $result = ($subklass instanceOf $superklass) tmp: $tmp_klass, $tmp_arrayptr" %}
12129   ins_encode %{
12130     __ check_klass_subtype_slow_path($subklass$$Register, $superklass$$Register, $tmp_arrayptr$$Register,
12131                                      $tmp_klass$$Register, NULL, $result$$Register);
12132   %}
12133   ins_pipe(pipe_class_default);
12134 %}
12135 
12136 // inlined locking and unlocking
12137 
12138 instruct cmpFastLock(flagsRegCR0 crx, iRegPdst oop, iRegPdst box, iRegPdst tmp1, iRegPdst tmp2) %{
12139   predicate(LockingMode != LM_LIGHTWEIGHT);
12140   match(Set crx (FastLock oop box));
12141   effect(TEMP tmp1, TEMP tmp2);

12142 
12143   format %{ "FASTLOCK  $oop, $box, $tmp1, $tmp2" %}
12144   ins_encode %{
12145     __ compiler_fast_lock_object($crx$$CondRegister, $oop$$Register, $box$$Register,
12146                                  $tmp1$$Register, $tmp2$$Register, /*tmp3*/ R0);
12147     // If locking was successful, crx should indicate 'EQ'.
12148     // The compiler generates a branch to the runtime call to
12149     // _complete_monitor_locking_Java for the case where crx is 'NE'.
12150   %}
12151   ins_pipe(pipe_class_compare);
12152 %}
12153 




















12154 instruct cmpFastUnlock(flagsRegCR0 crx, iRegPdst oop, iRegPdst box, iRegPdst tmp1, iRegPdst tmp2, iRegPdst tmp3) %{
12155   predicate(LockingMode != LM_LIGHTWEIGHT);
12156   match(Set crx (FastUnlock oop box));
12157   effect(TEMP tmp1, TEMP tmp2, TEMP tmp3);

12158 
12159   format %{ "FASTUNLOCK  $oop, $box, $tmp1, $tmp2" %}
12160   ins_encode %{
12161     __ compiler_fast_unlock_object($crx$$CondRegister, $oop$$Register, $box$$Register,
12162                                    $tmp1$$Register, $tmp2$$Register, $tmp3$$Register);

12163     // If unlocking was successful, crx should indicate 'EQ'.
12164     // The compiler generates a branch to the runtime call to
12165     // _complete_monitor_unlocking_Java for the case where crx is 'NE'.
12166   %}
12167   ins_pipe(pipe_class_compare);
12168 %}
12169 
12170 instruct cmpFastLockLightweight(flagsRegCR0 crx, iRegPdst oop, iRegPdst box, iRegPdst tmp1, iRegPdst tmp2) %{
12171   predicate(LockingMode == LM_LIGHTWEIGHT);
12172   match(Set crx (FastLock oop box));
12173   effect(TEMP tmp1, TEMP tmp2);
12174 
12175   format %{ "FASTLOCK  $oop, $box, $tmp1, $tmp2" %}
12176   ins_encode %{
12177     __ fast_lock_lightweight($crx$$CondRegister, $oop$$Register, $box$$Register,
12178                              $tmp1$$Register, $tmp2$$Register, /*tmp3*/ R0);
12179     // If locking was successful, crx should indicate 'EQ'.
12180     // The compiler generates a branch to the runtime call to
12181     // _complete_monitor_locking_Java for the case where crx is 'NE'.
12182   %}
12183   ins_pipe(pipe_class_compare);
12184 %}
12185 
12186 instruct cmpFastUnlockLightweight(flagsRegCR0 crx, iRegPdst oop, iRegPdst box, iRegPdst tmp1, iRegPdst tmp2, iRegPdst tmp3) %{
12187   predicate(LockingMode == LM_LIGHTWEIGHT);
12188   match(Set crx (FastUnlock oop box));
12189   effect(TEMP tmp1, TEMP tmp2, TEMP tmp3);

12190 
12191   format %{ "FASTUNLOCK  $oop, $box, $tmp1, $tmp2" %}
12192   ins_encode %{
12193     __ fast_unlock_lightweight($crx$$CondRegister, $oop$$Register, $box$$Register,
12194                                $tmp1$$Register, $tmp2$$Register, $tmp3$$Register);

12195     // If unlocking was successful, crx should indicate 'EQ'.
12196     // The compiler generates a branch to the runtime call to
12197     // _complete_monitor_unlocking_Java for the case where crx is 'NE'.
12198   %}
12199   ins_pipe(pipe_class_compare);
12200 %}
12201 
12202 // Align address.
12203 instruct align_addr(iRegPdst dst, iRegPsrc src, immLnegpow2 mask) %{
12204   match(Set dst (CastX2P (AndL (CastP2X src) mask)));
12205 
12206   format %{ "ANDDI   $dst, $src, $mask \t// next aligned address" %}
12207   size(4);
12208   ins_encode %{
12209     __ clrrdi($dst$$Register, $src$$Register, log2i_exact(-(julong)$mask$$constant));
12210   %}
12211   ins_pipe(pipe_class_default);
12212 %}
12213 
12214 // Array size computation.
< prev index next >