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

John Rose john.r.rose at oracle.com
Fri Mar 25 18:24:43 UTC 2016

On Mar 25, 2016, at 9:29 AM, Aleksey Shipilev <aleksey.shipilev at oracle.com> wrote:
> ...Before going further, I have a few open questions:
> a) What mechanism do we usually use for platform-dependent C1
> intrinsics? Current patch does develop_pd flag, but it would be nicer to
> have something akin to C2-ish Matcher::has_match_rule.

The code in Compiler::is_intrinsic_supported looks good for that.
Note that it performs platform (VM version) tests for other intrinsics.

To sense the command line, you should use vmIntrinsics::is_disabled_by_flags.

> b) Should we fold this into LIR_CompareAndSwap node with flag? This is
> technically doable, as patch demonstrates. Would it be a good idea to
> materialize LIR_CompareAndExchange node, similar to what C2 does?

I would make this choice by precedent:  Are there pre-existing LIR nodes
which are overloaded with different functions?  The answer is "yes".
(LIR_Op2 etc.) As a general rule, it appears that you make a new LIR
node only when you need a new shape of inputs and outputs.
But CAE has the same shape as CAS, doesn't it?

— John

More information about the hotspot-compiler-dev mailing list