RFR (M) 8152753: C1 intrinsics for CompareAndExchange (x86)

Roland Westrelin rwestrel at redhat.com
Fri Apr 8 13:54:32 UTC 2016

> CompareAndSwap produces boolean result, and kills cmp_value and
> new_value. CompareAndExchange produces the "old"/null value result,
> which is stored at the same position as cmp_value.
> So, if you omit that line, LinearScan asserts when you are trying to use
> the result of CompareAndExchange. AFAIU, removing the "input" property
> from cmp_value, but leaving "temp" makes things back in order for
> CompareAndExchange.

That assert seems too restrictive but making that change to c1_LIR.cpp
is asking for trouble, I think. I would suggest moving the final move to
the result register to the platform dependent code (see attached patch).
Also, I noticed you don't pass the result as the correct argument of cas_*.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: cas.patch
Type: text/x-patch
Size: 2704 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20160408/c72b08b6/cas.patch>

More information about the hotspot-compiler-dev mailing list