@@ -5305,7 +5305,6 @@ instruct jmpLoopEnd_reg_zero_long(cmpOp cop, mRegI src1, immI_0 zero, label lab
53055305%}
53065306
53075307
5308- // This match pattern is created for StoreIConditional since I cannot match IfNode without a RegFlags!
53095308instruct jmpCon_flags_long(cmpOpEqNe cop, FlagsReg cr, label labl) %{
53105309 match(If cop cr);
53115310 effect(USE labl);
@@ -5735,7 +5734,6 @@ instruct jmpLoopEnd_reg_zero_short(cmpOp cop, mRegI src1, immI_0 zero, label la
57355734%}
57365735
57375736
5738- // This match pattern is created for StoreIConditional since I cannot match IfNode without a RegFlags!
57395737instruct jmpCon_flags_short(cmpOpEqNe cop, FlagsReg cr, label labl) %{
57405738 match(If cop cr);
57415739 effect(USE labl);
@@ -11363,120 +11361,6 @@ instruct partialSubtypeCheckVsZero_short( mRegP sub, mRegP super, mRegP tmp1, mR
1136311361 ins_short_branch(1);
1136411362%}
1136511363
11366- // Conditional-store of the updated heap-top.
11367- // Used during allocation of the shared heap.
11368-
11369- instruct storePConditional(memory heap_top_ptr, mRegP oldval, mRegP newval, FlagsReg cr) %{
11370- match(Set cr (StorePConditional heap_top_ptr (Binary oldval newval)));
11371-
11372- format %{ "move AT, $newval\n\t"
11373- "sc_d $heap_top_ptr, AT\t# (ptr) @storePConditional \n\t"
11374- "move $cr, AT\n" %}
11375- ins_encode%{
11376- Register oldval = $oldval$$Register;
11377- Register newval = $newval$$Register;
11378- Address addr(as_Register($heap_top_ptr$$base), $heap_top_ptr$$disp);
11379-
11380- int index = $heap_top_ptr$$index;
11381- int scale = $heap_top_ptr$$scale;
11382- int disp = $heap_top_ptr$$disp;
11383-
11384- guarantee(Assembler::is_simm(disp, 12), "");
11385-
11386- if (index != -1) {
11387- __ stop("in storePConditional: index != -1");
11388- } else {
11389- __ move(AT, newval);
11390- __ sc_d(AT, addr);
11391- __ move($cr$$Register, AT);
11392- }
11393- %}
11394- ins_pipe(long_memory_op);
11395- %}
11396-
11397- // Conditional-store of an int value.
11398- // AT flag is set on success, reset otherwise.
11399- instruct storeIConditional(memory mem, mRegI oldval, mRegI newval, FlagsReg cr) %{
11400- match(Set cr (StoreIConditional mem (Binary oldval newval)));
11401- format %{ "CMPXCHG $newval, $mem, $oldval \t# @storeIConditional" %}
11402-
11403- ins_encode %{
11404- Register oldval = $oldval$$Register;
11405- Register newval = $newval$$Register;
11406- Register cr = $cr$$Register;
11407- Address addr(as_Register($mem$$base), $mem$$disp);
11408-
11409- int index = $mem$$index;
11410- int scale = $mem$$scale;
11411- int disp = $mem$$disp;
11412-
11413- guarantee(Assembler::is_simm(disp, 12), "");
11414-
11415- if (index != -1) {
11416- __ stop("in storeIConditional: index != -1");
11417- } else {
11418- if (cr != addr.base() && cr != oldval && cr != newval) {
11419- __ cmpxchg32(addr, oldval, newval, cr, true, false, true);
11420- } else {
11421- __ cmpxchg32(addr, oldval, newval, AT, true, false, true);
11422- __ move(cr, AT);
11423- }
11424- }
11425- %}
11426-
11427- ins_pipe(long_memory_op);
11428- %}
11429-
11430- // Conditional-store of a long value.
11431- // ZF flag is set on success, reset otherwise. Implemented with a CMPXCHG.
11432- instruct storeLConditional(memory mem, mRegL oldval, mRegL newval, FlagsReg cr)
11433- %{
11434- match(Set cr (StoreLConditional mem (Binary oldval newval)));
11435-
11436- format %{ "cmpxchg $mem, $newval\t# If $oldval == $mem then store $newval into $mem" %}
11437- ins_encode%{
11438- Register oldval = $oldval$$Register;
11439- Register newval = $newval$$Register;
11440- Register cr = $cr$$Register;
11441- Address addr(as_Register($mem$$base), $mem$$disp);
11442-
11443- int index = $mem$$index;
11444- int scale = $mem$$scale;
11445- int disp = $mem$$disp;
11446-
11447- guarantee(Assembler::is_simm(disp, 12), "");
11448-
11449- if (index != -1) {
11450- __ stop("in storeIConditional: index != -1");
11451- } else {
11452- if (cr != addr.base() && cr != oldval && cr != newval) {
11453- __ cmpxchg(addr, oldval, newval, cr, false, true);
11454- } else {
11455- __ cmpxchg(addr, oldval, newval, AT, false, true);
11456- __ move(cr, AT);
11457- }
11458- }
11459- %}
11460- ins_pipe(long_memory_op);
11461- %}
11462-
11463- // Implement LoadPLocked. Must be ordered against changes of the memory location
11464- // by storePConditional.
11465- instruct loadPLocked(mRegP dst, memory mem) %{
11466- match(Set dst (LoadPLocked mem));
11467- ins_cost(MEMORY_REF_COST);
11468-
11469- format %{ "ll_d $dst, $mem #@loadPLocked\n\t" %}
11470- size(12);
11471- ins_encode %{
11472- relocInfo::relocType disp_reloc = $mem->disp_reloc();
11473- assert(disp_reloc == relocInfo::none, "cannot have disp");
11474- __ loadstore_enc($dst$$Register, $mem$$base, $mem$$index, $mem$$scale, $mem$$disp, C2_MacroAssembler::LOAD_LINKED_LONG);
11475- %}
11476- ins_pipe( ialu_loadI );
11477- %}
11478-
11479-
1148011364instruct compareAndSwapI(mRegI res, mRegP mem_ptr, mRegI oldval, mRegI newval) %{
1148111365 match(Set res (CompareAndSwapI mem_ptr (Binary oldval newval)));
1148211366 ins_cost(3 * MEMORY_REF_COST);
0 commit comments