[aarch64-port-dev ] [10] RFR(S): 8186297: AARCH64: Intrinsify Unsafe.compareAndSetByte and compareAndSetShort

Dmitrij Pochepko dmitrij.pochepko at bell-sw.com
Thu Aug 17 10:38:10 UTC 2017


Hi Andrew,

thank you for catching this! here is a webrev that fixes the issue you 
pointed out to:

http://cr.openjdk.java.net/~dpochepk/8186297/webrev.02/

I believe it’s good enough for the Unsafe intrinsic which is the purpose 
of this fix. I’ll consider adding pair rules and tidy up that area in a 
separate enhancement if you don’t mind.

-Dmitrij


On 16.08.2017 19:44, Andrew Dinn wrote:
> On 16/08/17 17:33, Andrew Haley wrote:
>> On 16/08/17 12:04, dmitrij.pochepko at bell-sw.com wrote:
>>
>>> WeakCompareAndSwap seems to be already implemented.
>> How weird; I wonder how that happened.  OK, the patch is good.
> No, please cancel that.
>
> The case statement in is_CAS should not be modified. It is used by the
> code which optimizes out dmbs and replaces the stores and loads with
> releasing stores and acquiring loads. If you look at the rules for
> CopareAndswapI/L/N/P you will see that they come in pairs. Your single
> rules do not include the matching pair rule. They will be able to
> generate the code that is used when dmb barriers are generated. But the
> change to the is_CAS case switch will stop the barriers being generated.
> If you revert is_CAS back to what it was then your single rules will be ok.
>
> regards,
>
>
> Andrew Dinn
> -----------
> 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 aarch64-port-dev mailing list