RFR: AArch64 -- patch to make volatile reads and stores use ldar/stlr (original) (raw)

Andrew Dinn adinn at redhat.com
Wed Apr 22 09:12:10 UTC 2015


On 21/04/15 19:18, Aleksey Shipilev wrote:

There is also a pending idea for x86: try to replace volatile stores with "xchg", instead of "mov + lock addl". It would be nice to make sure the way AArch64 does the replacement would help the future x86 code.

I don't know for sure if this is going to be susceptible to the same sort of implementation as I have provided but I think it is very likely.

As I understand it the x86 code generates the lock addl instruction in response to a MemBarVolatile node. So, a predicate something like the one I provided could be used to identify that the MemBarVolatile belongs to a volatile load or store and hence that the lock addl can be elided.

Similarly, I suspect the rules which generate the mov for normal stores could probably be duplicated and a lower cost variant could use a predicate similar to my needs_releasing_store() and plant an xchg instead of a mov if the predicate decided the store was volatile.

regards,

Andrew Dinn

Senior Principal Software Engineer Red Hat UK Ltd Registered in UK and Wales under Company Registration No. 3798903 Directors: Michael Cunningham (USA), Matt Parson (USA), Charlie Peters (USA), Michael O'Neill (Ireland)



More information about the hotspot-dev mailing list