< prev index next >
src/cpu/aarch64/vm/aarch64.ad
Print this page
rev 10556 : [backport] Remove C2 write-barrier from .ad files
rev 10573 : [backport] Fix aarch64 CAS predicates
*** 9365,9394 ****
__ ldr(d, Address(s, BrooksPointer::byte_offset()));
%}
ins_pipe(pipe_class_memory);
%}
- instruct shenandoahWB(iRegP_R0 dst, iRegP src, rFlagsReg cr) %{
- match(Set dst (ShenandoahWriteBarrier src));
- effect(KILL cr);
-
- format %{ "shenandoah_wb $dst,$src" %}
- ins_encode %{
- Label done;
- Register s = $src$$Register;
- Register d = $dst$$Register;
- assert(d == r0, "result in r0");
- __ block_comment("Shenandoah write barrier {");
- // We need that first read barrier in order to trigger a SEGV/NPE on incoming NULL.
- // Also, it brings s into d in preparation for the call to shenandoah_write_barrier().
- __ ldr(d, Address(s, BrooksPointer::byte_offset()));
- __ shenandoah_write_barrier(d);
- __ block_comment("} Shenandoah write barrier");
- %}
- ins_pipe(pipe_slow);
- %}
-
// Convert oop pointer into compressed form
instruct encodeHeapOop(iRegNNoSp dst, iRegP src, rFlagsReg cr) %{
predicate(n->bottom_type()->make_ptr()->ptr() != TypePtr::NotNull);
match(Set dst (EncodeP src));
effect(KILL cr);
--- 9365,9374 ----
*** 9677,9694 ****
ins_pipe(pipe_slow);
%}
instruct compareAndSwapP_shenandoah(iRegINoSp res, indirect mem, iRegP oldval, iRegP newval, iRegPNoSp tmp, rFlagsReg cr) %{
! predicate(UseShenandoahGC && ShenandoahCASBarrier);
match(Set res (CompareAndSwapP mem (Binary oldval newval)));
! ins_cost(3 * VOLATILE_REF_COST);
effect(TEMP tmp, KILL cr);
format %{
! "cmpxchg_oop_shenandoah $mem, $oldval, $newval\t# (ptr) if $mem == $oldval then $mem <-- $newval with temp $tmp"
"cset $res, EQ\t# $res <-- (EQ ? 1 : 0)"
%}
ins_encode(aarch64_enc_cmpxchg_oop_shenandoah(mem, oldval, newval, tmp),
aarch64_enc_cset_eq(res));
--- 9657,9674 ----
ins_pipe(pipe_slow);
%}
instruct compareAndSwapP_shenandoah(iRegINoSp res, indirect mem, iRegP oldval, iRegP newval, iRegPNoSp tmp, rFlagsReg cr) %{
! predicate(UseShenandoahGC && ShenandoahCASBarrier && n->in(3)->in(1)->bottom_type() != TypePtr::NULL_PTR);
match(Set res (CompareAndSwapP mem (Binary oldval newval)));
! ins_cost(2 * VOLATILE_REF_COST);
effect(TEMP tmp, KILL cr);
format %{
! "cmpxchg_shenandoah_oop $mem, $oldval, $newval\t# (ptr) if $mem == $oldval then $mem <-- $newval with temp $tmp"
"cset $res, EQ\t# $res <-- (EQ ? 1 : 0)"
%}
ins_encode(aarch64_enc_cmpxchg_oop_shenandoah(mem, oldval, newval, tmp),
aarch64_enc_cset_eq(res));
*** 9696,9706 ****
ins_pipe(pipe_slow);
%}
instruct compareAndSwapN(iRegINoSp res, indirect mem, iRegNNoSp oldval, iRegNNoSp newval, rFlagsReg cr) %{
! predicate(!UseShenandoahGC || !ShenandoahCASBarrier);
match(Set res (CompareAndSwapN mem (Binary oldval newval)));
ins_cost(2 * VOLATILE_REF_COST);
effect(KILL cr);
--- 9676,9686 ----
ins_pipe(pipe_slow);
%}
instruct compareAndSwapN(iRegINoSp res, indirect mem, iRegNNoSp oldval, iRegNNoSp newval, rFlagsReg cr) %{
! predicate(!UseShenandoahGC || !ShenandoahCASBarrier || n->in(3)->in(1)->bottom_type() == TypeNarrowOop::NULL_PTR);
match(Set res (CompareAndSwapN mem (Binary oldval newval)));
ins_cost(2 * VOLATILE_REF_COST);
effect(KILL cr);
*** 9715,9732 ****
ins_pipe(pipe_slow);
%}
instruct compareAndSwapN_shenandoah(iRegINoSp res, indirect mem, iRegN oldval, iRegN newval, iRegNNoSp tmp, rFlagsReg cr) %{
! predicate(UseShenandoahGC && ShenandoahCASBarrier);
match(Set res (CompareAndSwapN mem (Binary oldval newval)));
! ins_cost(3 * VOLATILE_REF_COST);
effect(TEMP tmp, KILL cr);
format %{
! "cmpxchg_narrow_oop_shenandoah $mem, $oldval, $newval\t# (ptr) if $mem == $oldval then $mem <-- $newval with temp $tmp"
"cset $res, EQ\t# $res <-- (EQ ? 1 : 0)"
%}
ins_encode %{
Register tmp = $tmp$$Register;
--- 9695,9712 ----
ins_pipe(pipe_slow);
%}
instruct compareAndSwapN_shenandoah(iRegINoSp res, indirect mem, iRegN oldval, iRegN newval, iRegNNoSp tmp, rFlagsReg cr) %{
! predicate(UseShenandoahGC && ShenandoahCASBarrier && n->in(3)->in(1)->bottom_type() != TypeNarrowOop::NULL_PTR);
match(Set res (CompareAndSwapN mem (Binary oldval newval)));
! ins_cost(2 * VOLATILE_REF_COST);
effect(TEMP tmp, KILL cr);
format %{
! "cmpxchgw_shenandoah_narrow_oop $mem, $oldval, $newval\t# (ptr) if $mem == $oldval then $mem <-- $newval with temp $tmp"
"cset $res, EQ\t# $res <-- (EQ ? 1 : 0)"
%}
ins_encode %{
Register tmp = $tmp$$Register;
*** 9797,9814 ****
ins_pipe(pipe_slow);
%}
instruct compareAndSwapPAcq_shenandoah(iRegINoSp res, indirect mem, iRegP oldval, iRegP newval, iRegPNoSp tmp, rFlagsReg cr) %{
! predicate(needs_acquiring_load_exclusive(n) && UseShenandoahGC && ShenandoahCASBarrier);
match(Set res (CompareAndSwapP mem (Binary oldval newval)));
! ins_cost(2 * VOLATILE_REF_COST);
effect(TEMP tmp, KILL cr);
format %{
! "cmpxchg_acq_oop_shenandoah $mem, $oldval, $newval\t# (ptr) if $mem == $oldval then $mem <-- $newval with temp $tmp"
"cset $res, EQ\t# $res <-- (EQ ? 1 : 0)"
%}
ins_encode(aarch64_enc_cmpxchg_acq_oop_shenandoah(mem, oldval, newval, tmp),
aarch64_enc_cset_eq(res));
--- 9777,9794 ----
ins_pipe(pipe_slow);
%}
instruct compareAndSwapPAcq_shenandoah(iRegINoSp res, indirect mem, iRegP oldval, iRegP newval, iRegPNoSp tmp, rFlagsReg cr) %{
! predicate(needs_acquiring_load_exclusive(n) && UseShenandoahGC && ShenandoahCASBarrier && n->in(3)->in(1)->bottom_type() != TypePtr::NULL_PTR);
match(Set res (CompareAndSwapP mem (Binary oldval newval)));
! ins_cost(VOLATILE_REF_COST);
effect(TEMP tmp, KILL cr);
format %{
! "cmpxchg_acq_shenandoah_oop $mem, $oldval, $newval\t# (ptr) if $mem == $oldval then $mem <-- $newval with temp $tmp"
"cset $res, EQ\t# $res <-- (EQ ? 1 : 0)"
%}
ins_encode(aarch64_enc_cmpxchg_acq_oop_shenandoah(mem, oldval, newval, tmp),
aarch64_enc_cset_eq(res));
*** 9816,9826 ****
ins_pipe(pipe_slow);
%}
instruct compareAndSwapNAcq(iRegINoSp res, indirect mem, iRegNNoSp oldval, iRegNNoSp newval, rFlagsReg cr) %{
! predicate(needs_acquiring_load_exclusive(n) && (!UseShenandoahGC || !ShenandoahCASBarrier));
match(Set res (CompareAndSwapN mem (Binary oldval newval)));
ins_cost(VOLATILE_REF_COST);
effect(KILL cr);
--- 9796,9806 ----
ins_pipe(pipe_slow);
%}
instruct compareAndSwapNAcq(iRegINoSp res, indirect mem, iRegNNoSp oldval, iRegNNoSp newval, rFlagsReg cr) %{
! predicate(needs_acquiring_load_exclusive(n) && (!UseShenandoahGC || !ShenandoahCASBarrier|| n->in(3)->in(1)->bottom_type() == TypeNarrowOop::NULL_PTR));
match(Set res (CompareAndSwapN mem (Binary oldval newval)));
ins_cost(VOLATILE_REF_COST);
effect(KILL cr);
*** 9835,9852 ****
ins_pipe(pipe_slow);
%}
instruct compareAndSwapNAcq_shenandoah(iRegINoSp res, indirect mem, iRegN oldval, iRegN newval, iRegNNoSp tmp, rFlagsReg cr) %{
! predicate(needs_acquiring_load_exclusive(n) && UseShenandoahGC && ShenandoahCASBarrier);
match(Set res (CompareAndSwapN mem (Binary oldval newval)));
! ins_cost(3 * VOLATILE_REF_COST);
effect(TEMP tmp, KILL cr);
format %{
! "cmpxchg_narrow_oop_shenandoah $mem, $oldval, $newval\t# (ptr) if $mem == $oldval then $mem <-- $newval with temp $tmp"
"cset $res, EQ\t# $res <-- (EQ ? 1 : 0)"
%}
ins_encode %{
Register tmp = $tmp$$Register;
--- 9815,9832 ----
ins_pipe(pipe_slow);
%}
instruct compareAndSwapNAcq_shenandoah(iRegINoSp res, indirect mem, iRegN oldval, iRegN newval, iRegNNoSp tmp, rFlagsReg cr) %{
! predicate(needs_acquiring_load_exclusive(n) && UseShenandoahGC && ShenandoahCASBarrier && n->in(3)->in(1)->bottom_type() != TypeNarrowOop::NULL_PTR);
match(Set res (CompareAndSwapN mem (Binary oldval newval)));
! ins_cost(VOLATILE_REF_COST);
effect(TEMP tmp, KILL cr);
format %{
! "cmpxchgw_acq_shenandoah_narrow_oop $mem, $oldval, $newval\t# (ptr) if $mem == $oldval then $mem <-- $newval with temp $tmp"
"cset $res, EQ\t# $res <-- (EQ ? 1 : 0)"
%}
ins_encode %{
Register tmp = $tmp$$Register;
< prev index next >