[9] RFR(S): 8075324: Costs of memory operands in aarch64.ad are inconsistent

Andrew Haley aph at redhat.com
Tue Mar 17 15:37:51 UTC 2015


On 03/17/2015 03:15 PM, Andrew Dinn wrote:

> If you take look at the static methods named loadStore defined in
> the source block you can see how this instruction will actually be
> generated.  PrintAssembly will reveal that it gets translated as
> follows
> 
>     add     R8, R10, #16
>     ldrsbw  R0, [R8, R1 sxtw]

Note that this is faster than ...

     add     R8, R10, R1 sxtw
     ldrsbw  R0, [R8, #16]

... because sign-extending adds are "free" in address arithmetic but
not in regular arithmetic.  Why?  Answers on a postcard...

Therefore, the costs of these two forms shouldn't be equal.  I think
we have this correct at present.

Andrew.


More information about the hotspot-compiler-dev mailing list