<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div><br>
</div>
<div>+  // This is only requried when there is no FP and offsets are greater than</div>
<div>+  // ~256KB (~64Kwords). Thus only for code run on the emulator!</div>
<div><br>
</div>
<div>requried -> required</div>
<div><br>
</div>
<div>
<div>+  // The arbitary value of 0xf000 allows frames of up to ~240KB before spill</div>
<div>+  // slots are added for the use of eliminateFrameIndex() register scavenging.</div>
</div>
<div><br>
</div>
<div>arbitary -> arbitrary</div>
<div><br>
</div>
<div>
<div><br>
</div>
<div>+  // We previously asserted SPAdj == 0.</div>
<div>+  unsigned ScratchOffset = RS->scavengeRegister(&XCore::GRRegsRegClass, II, 0);</div>
<div>+  RS->setUsed(ScratchOffset);</div>
</div>
<div><br>
</div>
<div>
<div>+  // We previously asserted SPAdj == 0.</div>
<div>+  unsigned ScratchBase;</div>
<div>+  if (OpCode==XCore::STWFI) {</div>
</div>
<div><br>
</div>
<div>It’s confusing to refer to the old code in a comment like this, I would just take these comments out before you commit.</div>
<div><br>
</div>
<div>Looks good to me otherwise.</div>
<div><br>
</div>
<div>
<div>On 20 Nov 2013, at 18:19, Robert Lytton <<a href="mailto:robert@xmos.com">robert@xmos.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div ocsi="0" fpstyle="1" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">
<div style="direction: ltr; font-family: Tahoma; font-size: 10pt;">Hi,<br>
<br>
Here is a patch to enhance the XCores handling of large frames.<br>
<br>
Q: is the handling of register scavenging correct below? e.g. the use of RS->setUsed() &  RegState::Kill<br>
      // We previously asserted SPAdj == 0.<br>
      unsigned ScratchOffset = RS->scavengeRegister(&XCore::GRRegsRegClass, II, 0);<br>
      RS->setUsed(ScratchOffset);<br>
      loadConstant(II, TII, ScratchOffset, Offset);<br>
      BuildMI(MBB, II, dl, TII.get(XCore::LDW_3r), Reg)<br>
              .addReg(FrameReg)<br>
              .addReg(ScratchOffset, RegState::Kill);<br>
<br>
Details:<br>
<br>
    eliminateFrameIndex() has been reworked to handle both small & large frames<br>
    with either a FP or SP.<br>
    An additional Slot is required for Scavenging spills when not using FP for large frames.<br>
    Reworked the handling of Register Scavenging.<br>
<br>
    Whether we are using an FP or not, whether it is a large frame or not,<br>
    and whether we are using a large code model or not are now independent.<br>
<br>
Robert<br>
<br>
</div>
<span><PatchLargeFrameHandling></span></div>
</blockquote>
</div>
<br>
</body>
</html>