atomic add

Deneau, Tom tom.deneau at amd.com
Mon Sep 9 14:29:16 PDT 2013


HSAIL has an atomic_add instruction.  I would like this instruction to be emitted when we see something like 

       AtomicInteger atomicInt = new AtomicInteger();
       xxx = atomicInt.getAndAdd(amount);

What are the steps necessary to get this to happen?

I would prefer not to go thru a cas for this.
(I see on amd64 that the above code maps to a lock cmpxchg sequence)

-- Tom




More information about the graal-dev mailing list