RFR: AArch64 remaining CAS-obj impls

Andrew Haley aph at redhat.com
Thu Nov 17 14:50:22 UTC 2016


On 17/11/16 12:56, Roman Kennke wrote:

> I am wondering about the acquire and release flags.
> 
> Release always seems to be 'true' thus making the store-exclusive
> ordered, which I think must always be the case.

So far.  That function is only used in aarch64.ad.  However,
VarHandle.compareAndExchangeAcquire() seems to exist, and it is
documented as having only acquire semantics.  We don't implement
it yet.

> There seem to be acquiring versions of some CASes, which pass 'true'
> for acquire, making the load-exclusive variants ordered too. However,
> as far as I can tell, those instructions would never match because they
> have a preceding non-acquiring instruction that has no predicate (or
> weaker predicate). Is there a reason for the acquiring CASes, or can we
> just drop them altogether?
> 
> This would get rid of those two flags, and leaves us with weak vs.
> strong which I would replace by an enum.

Nice.  It could be done with a simple bitmask-valued enum.  That'd be
super.

  enc_class aarch64_enc_cmpxchgw_acq(memory mem, iRegINoSp oldval, iRegINoSp newval) %{
    MacroAssembler _masm(&cbuf);
    guarantee($mem$$index == -1 && $mem$$disp == 0, "impossible encoding");
    __ cmpxchg($mem$$base$$Register, $oldval$$Register, $newval$$Register,
               Assembler::word, CAS::Acq | CAS::Rel | CAS::Weak);
  %}

... or something.  But right now I'd settle for comments at the call
site.

Andrew.


More information about the shenandoah-dev mailing list