diff mbox

RFR: Fix for large frame size adjusts (resend)

Message ID 1375696064.1953.7.camel@fleetfoot.lan
State Accepted
Headers show

Commit Message

Edward Nevill Aug. 5, 2013, 9:47 a.m. UTC
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?

OK to push?

Ed.

--- CUT HERE ---
exporting patch:
# HG changeset patch
# User Edward Nevill ed@camswl.com
# Date 1375463673 -3600
# Node ID d8e110f4b119bed7019bd4037c3d5fbb8a47d881
# Parent  6a6b3b5dc103536b9c04666219452fff6db5ec3e
Fix for large frame adjust
diff mbox

Patch

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 ---