getAndAddInt() breaks AOT compilation for AArch64

Andrew Haley aph at redhat.com
Mon Jun 4 16:21:35 UTC 2018


On 06/04/2018 03:58 PM, stewartd.qdt wrote:
> It is essentially the same as Zhongwei proposed and does not contain any advanced handling for immediates. I think at this point simpler is better. It also appeared to me that Hotspot does not have special handling for the immediate cases either

It does so!

instruct get_and_addL(indirect mem, iRegLNoSp newval, iRegL incr) %{
  match(Set newval (GetAndAddL mem incr));
  ins_cost(INSN_COST * 10);
  format %{ "get_and_addL $newval, [$mem], $incr" %}
  ins_encode %{
    __ atomic_add($newval$$Register, $incr$$Register, as_Register($mem$$base));
  %}
  ins_pipe(pipe_serial);
%}

instruct get_and_addLi(indirect mem, iRegLNoSp newval, immLAddSub incr) %{
  match(Set newval (GetAndAddL mem incr));
  ins_cost(INSN_COST * 10);
  format %{ "get_and_addL $newval, [$mem], $incr" %}
  ins_encode %{
    __ atomic_add($newval$$Register, $incr$$constant, as_Register($mem$$base));
  %}
  ins_pipe(pipe_serial);
%}

> so I chose the simple route. 

Hmm.  Given that actually fixing it properly with an immediate increment
isn't hard, I'm not sure I agree.  Sure, it's not a huge deal.

-- 
Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671


More information about the graal-dev mailing list