[aarch64-port-dev ] /hg/icedtea7-forest-aarch64/hotspot: ensure byte_map_base can be...

Andrew Dinn adinn at redhat.com
Fri Oct 31 11:09:01 UTC 2014


On 31/10/14 10:37, Edward Nevill wrote:
> I think the best thing may be to back out this patch and put in the
> extra ADD instruction. I think it needs an extra ADD, not an extra
> LDR/STR.

Oops, sorry, it does indeed require an add to be inserted not an ldr.
What I was struggling to suggest was that we use Assembler::lea. As in

  long offset;
  __ adrp(dst_reg, CardTable, offset;
  assert((offset & 0x3ff) == 0, "offset must be 0x400 aligned");
  __ lea(dst_reg, Address(dst_reg, offset);

> IE. The existing sequence is something like
> 
>  lsr  Xtmp, Xobject, #9
>  adrp Xtable, CardTable
>  strb zr, [Xtable, Xtmp]
> 
> This becomes
> 
>  lsr  Xtmp, Xobject, #9
>  adrp Xtable, CardTable & ~0xfff
>  add Xtable, Xtable, CardTable & 0xfff
>  strb zr, [Xtable, Xtmp]

Which I believe the above code will achieve.

> I did some experiments with using a global register, and it seems to work ok, but what I am doing is.
> 
>  lsr Xtmp, Xobject, #9
>  mov Xtable, Xcardtable (aka X27)
>  strb zr, [Xtable, Xtmp]
> 
> I am struggling to get a pattern which merges the mov and the strb into a single store.
> 
> So, I think it would be best to simply put in the extra ADD
> instruction which should work and continue experiment on what is the
> most performant way to do it.

Yes, I'll back out the old change and modify the callers of adrp and the
asserts in the reloc code accordingly.

However, there is still one simple improvement we can make. The
intra-page offset is never going to change so the reloc code only needs
to adjust the adrp to fix the 4K aligned page offset. It doesn't care
whetehr or not there is a following add. So, we can forget about the add
if the offset is zero i.e.

  long offset;
  __ adrp(dst_reg, CardTable, offset;
  assert((offset & 0x3ff) == 0, "offset must be 0x400 aligned");
  if (offset != 0) {
    __ lea(dst_reg, Address(dst_reg, offset);
  }



regards,


Andrew Dinn
-----------



More information about the aarch64-port-dev mailing list