[aarch64-port-dev ] RFR: Fix for large frame size adjusts

Andrew Haley aph at redhat.com
Tue Aug 6 03:20:11 PDT 2013


On 08/02/2013 06:20 PM, edward.nevill at linaro.org wrote:
> Hi,
> 
> The following fixes failures when the frame size is greater than 1<<12.
> 
> With the fix it handles frame sizes up to 1<<24 wich should be enough?

Looking at the JVM spec, the number of locals is limited to 65536.

> OK to push?

I think you need to explain "S flag not set".
Why is it only allowed for sp?

Andrew.


> 
> Ed.
> 
> --- CUT HERE ---
> exporting patch:
> # HG changeset patch
> # User Edward Nevill ed at camswl.com
> # Date 1375463673 -3600
> # Node ID d8e110f4b119bed7019bd4037c3d5fbb8a47d881
> # Parent  6a6b3b5dc103536b9c04666219452fff6db5ec3e
> Fix for large frame adjust
> 
> diff -r 6a6b3b5dc103 -r d8e110f4b119 src/cpu/aarch64/vm/macroAssembler_aarch64.cpp
> --- a/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp	Fri Aug 02 16:50:44 2013 +0100
> +++ b/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp	Fri Aug 02 18:14:33 2013 +0100
> @@ -1524,7 +1524,14 @@
>    if (operand_valid_for_add_sub_immediate((int)imm)) {
>      (this->*insn1)(Rd, Rn, imm);
>    } else {
> -    assert_different_registers(Rd, Rn);
> +    if (Rd == Rn) {
> +       assert(Rd == sp, "only allowed for sp");
> +       // We know S flag not set so can do this as sequence of add/sub
> +       assert(labs(imm) < (1 << 24), "sp adjust too big");
> +       (this->*insn1)(Rd, Rn, imm & -(1 << 12));
> +       (this->*insn1)(Rd, Rd, imm & ((1 << 12)-1));
> +       return;
> +    }
>      assert(Rd != zr, "overflow in immediate operand");
>      mov(Rd, (uint64_t)imm);
>      (this->*insn2)(Rd, Rn, Rd, LSL, 0);
> --- CUT HERE ---
> 




More information about the aarch64-port-dev mailing list