< prev index next >

src/hotspot/cpu/ppc/ppc.ad

Print this page

12130 // GL TODO: Improve this.
12131 // - result should not be a TEMP
12132 // - Add match rule as on sparc avoiding additional Cmp.
12133 instruct partialSubtypeCheck(iRegPdst result, iRegP_N2P subklass, iRegP_N2P superklass,
12134                              iRegPdst tmp_klass, iRegPdst tmp_arrayptr) %{
12135   match(Set result (PartialSubtypeCheck subklass superklass));
12136   effect(TEMP_DEF result, TEMP tmp_klass, TEMP tmp_arrayptr);
12137   ins_cost(DEFAULT_COST*10);
12138 
12139   format %{ "PartialSubtypeCheck $result = ($subklass instanceOf $superklass) tmp: $tmp_klass, $tmp_arrayptr" %}
12140   ins_encode %{
12141     __ check_klass_subtype_slow_path($subklass$$Register, $superklass$$Register, $tmp_arrayptr$$Register,
12142                                      $tmp_klass$$Register, NULL, $result$$Register);
12143   %}
12144   ins_pipe(pipe_class_default);
12145 %}
12146 
12147 // inlined locking and unlocking
12148 
12149 instruct cmpFastLock(flagsRegCR0 crx, iRegPdst oop, iRegPdst box, iRegPdst tmp1, iRegPdst tmp2) %{

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

12186   match(Set crx (FastUnlock oop box));
12187   effect(TEMP tmp1, TEMP tmp2, TEMP tmp3);
12188   predicate(!Compile::current()->use_rtm());
12189 
12190   format %{ "FASTUNLOCK  $oop, $box, $tmp1, $tmp2" %}
12191   ins_encode %{
12192     __ compiler_fast_unlock_object($crx$$CondRegister, $oop$$Register, $box$$Register,
12193                                    $tmp1$$Register, $tmp2$$Register, $tmp3$$Register,
12194                                    false);
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 instruct cmpFastUnlock_tm(flagsReg crx, iRegPdst oop, iRegPdst box, iRegPdst tmp1, iRegPdst tmp2, iRegPdst tmp3) %{

















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

12130 // GL TODO: Improve this.
12131 // - result should not be a TEMP
12132 // - Add match rule as on sparc avoiding additional Cmp.
12133 instruct partialSubtypeCheck(iRegPdst result, iRegP_N2P subklass, iRegP_N2P superklass,
12134                              iRegPdst tmp_klass, iRegPdst tmp_arrayptr) %{
12135   match(Set result (PartialSubtypeCheck subklass superklass));
12136   effect(TEMP_DEF result, TEMP tmp_klass, TEMP tmp_arrayptr);
12137   ins_cost(DEFAULT_COST*10);
12138 
12139   format %{ "PartialSubtypeCheck $result = ($subklass instanceOf $superklass) tmp: $tmp_klass, $tmp_arrayptr" %}
12140   ins_encode %{
12141     __ check_klass_subtype_slow_path($subklass$$Register, $superklass$$Register, $tmp_arrayptr$$Register,
12142                                      $tmp_klass$$Register, NULL, $result$$Register);
12143   %}
12144   ins_pipe(pipe_class_default);
12145 %}
12146 
12147 // inlined locking and unlocking
12148 
12149 instruct cmpFastLock(flagsRegCR0 crx, iRegPdst oop, iRegPdst box, iRegPdst tmp1, iRegPdst tmp2) %{
12150   predicate(LockingMode != LM_LIGHTWEIGHT);
12151   match(Set crx (FastLock oop box));
12152   effect(TEMP tmp1, TEMP tmp2);

12153 
12154   format %{ "FASTLOCK  $oop, $box, $tmp1, $tmp2" %}
12155   ins_encode %{
12156     __ compiler_fast_lock_object($crx$$CondRegister, $oop$$Register, $box$$Register,
12157                                  $tmp1$$Register, $tmp2$$Register, /*tmp3*/ R0);
12158     // If locking was successful, crx should indicate 'EQ'.
12159     // The compiler generates a branch to the runtime call to
12160     // _complete_monitor_locking_Java for the case where crx is 'NE'.
12161   %}
12162   ins_pipe(pipe_class_compare);
12163 %}
12164 




















12165 instruct cmpFastUnlock(flagsRegCR0 crx, iRegPdst oop, iRegPdst box, iRegPdst tmp1, iRegPdst tmp2, iRegPdst tmp3) %{
12166   predicate(LockingMode != LM_LIGHTWEIGHT);
12167   match(Set crx (FastUnlock oop box));
12168   effect(TEMP tmp1, TEMP tmp2, TEMP tmp3);

12169 
12170   format %{ "FASTUNLOCK  $oop, $box, $tmp1, $tmp2" %}
12171   ins_encode %{
12172     __ compiler_fast_unlock_object($crx$$CondRegister, $oop$$Register, $box$$Register,
12173                                    $tmp1$$Register, $tmp2$$Register, $tmp3$$Register);

12174     // If unlocking was successful, crx should indicate 'EQ'.
12175     // The compiler generates a branch to the runtime call to
12176     // _complete_monitor_unlocking_Java for the case where crx is 'NE'.
12177   %}
12178   ins_pipe(pipe_class_compare);
12179 %}
12180 
12181 instruct cmpFastLockLightweight(flagsRegCR0 crx, iRegPdst oop, iRegPdst box, iRegPdst tmp1, iRegPdst tmp2) %{
12182   predicate(LockingMode == LM_LIGHTWEIGHT);
12183   match(Set crx (FastLock oop box));
12184   effect(TEMP tmp1, TEMP tmp2);
12185 
12186   format %{ "FASTLOCK  $oop, $box, $tmp1, $tmp2" %}
12187   ins_encode %{
12188     __ fast_lock_lightweight($crx$$CondRegister, $oop$$Register, $box$$Register,
12189                              $tmp1$$Register, $tmp2$$Register, /*tmp3*/ R0);
12190     // If locking was successful, crx should indicate 'EQ'.
12191     // The compiler generates a branch to the runtime call to
12192     // _complete_monitor_locking_Java for the case where crx is 'NE'.
12193   %}
12194   ins_pipe(pipe_class_compare);
12195 %}
12196 
12197 instruct cmpFastUnlockLightweight(flagsRegCR0 crx, iRegPdst oop, iRegPdst box, iRegPdst tmp1, iRegPdst tmp2, iRegPdst tmp3) %{
12198   predicate(LockingMode == LM_LIGHTWEIGHT);
12199   match(Set crx (FastUnlock oop box));
12200   effect(TEMP tmp1, TEMP tmp2, TEMP tmp3);

12201 
12202   format %{ "FASTUNLOCK  $oop, $box, $tmp1, $tmp2" %}
12203   ins_encode %{
12204     __ fast_unlock_lightweight($crx$$CondRegister, $oop$$Register, $box$$Register,
12205                                $tmp1$$Register, $tmp2$$Register, $tmp3$$Register);

12206     // If unlocking was successful, crx should indicate 'EQ'.
12207     // The compiler generates a branch to the runtime call to
12208     // _complete_monitor_unlocking_Java for the case where crx is 'NE'.
12209   %}
12210   ins_pipe(pipe_class_compare);
12211 %}
12212 
12213 // Align address.
12214 instruct align_addr(iRegPdst dst, iRegPsrc src, immLnegpow2 mask) %{
12215   match(Set dst (CastX2P (AndL (CastP2X src) mask)));
12216 
12217   format %{ "ANDDI   $dst, $src, $mask \t// next aligned address" %}
12218   size(4);
12219   ins_encode %{
12220     __ clrrdi($dst$$Register, $src$$Register, log2i_exact(-(julong)$mask$$constant));
12221   %}
12222   ins_pipe(pipe_class_default);
12223 %}
12224 
12225 // Array size computation.
< prev index next >