[aarch64-port-dev ] RFR(XS): 8211320: Aarch64: unsafe.compareAndSetByte() and unsafe.compareAndSetShort() c2 intrinsics broken with negative expected value
adinn at redhat.com
Mon Oct 1 10:50:08 UTC 2018
On 01/10/18 11:43, Andrew Haley wrote:
> On 10/01/2018 11:09 AM, Roland Westrelin wrote:
>> Intrinsics for unsafe.compareAndSetByte() and
>> unsafe.compareAndSetShort() don't properly deal with sign extension:
>> load exclusive doesn't sign extend loaded value but comparison is done
>> with sign extended value.
> Ooh, that's tricky. I wonder if we should do this inside cmpxchg().
> Mind you, that would cause cmpxchg() to have a side effect on an input
You seem to have answered that question (correctly?) in the negative :-)
If you moved the sign extend into the cmpxchg method the C2 code would
still have to copy the input to a temporary register and pass the temp
into cmpxchg. Since this is the only place where a cmpxchgb actually
occurs that doesn't seem like a better solution.
Senior Principal Software Engineer
Red Hat UK Ltd
Registered in England and Wales under Company Registration No. 03798903
Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander
More information about the hotspot-compiler-dev