<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><BR><DIV><DIV>On May 23, 2007, at 6:55 AM, Nicolas Geoffray wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Here's a patch to make stubs work in linux/ppc. I'll commit it if</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">there's no objection.</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Chris: Just a question. I noticed on cvsweb that you wrote the lines:</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-converted-space">     </SPAN>MCE.emitWordBE(0x9421ffe0); <SPAN class="Apple-converted-space">    </SPAN>// stwu r1,-32(r1)</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-converted-space">     </SPAN>MCE.emitWordBE(0x7d6802a6); <SPAN class="Apple-converted-space">    </SPAN>// mflr r11</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-converted-space">     </SPAN>MCE.emitWordBE(0x91610028); <SPAN class="Apple-converted-space">    </SPAN>// stw r11, 40(r1)</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Why 32 when calling the stub?</DIV></BLOCKQUOTE><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><BR class="khtml-block-placeholder"></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Parameter area + 16 byte stack alignment.  We only bother to set this up when we're going to call the compilation callback, which will want to store the LR at the very least here.  In a nutshell, the ABI requires it :)</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Cheers,</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Nicolas</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco">Index: lib/Target/PowerPC/PPCJITInfo.cpp</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco">===================================================================</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco">RCS file: /var/cvs/llvm/llvm/lib/Target/PowerPC/PPCJITInfo.cpp,v</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco">retrieving revision 1.37</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco">diff -t -d -u -p -5 -r1.37 PPCJITInfo.cpp</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco">--- lib/Target/PowerPC/PPCJITInfo.cpp<SPAN class="Apple-tab-span" style="white-space:pre">       </SPAN>25 Feb 2007 05:04:13 -0000<SPAN class="Apple-tab-span" style="white-space:pre">  </SPAN>1.37</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco">+++ lib/Target/PowerPC/PPCJITInfo.cpp<SPAN class="Apple-tab-span" style="white-space:pre">     </SPAN>23 May 2007 13:51:52 -0000</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco">@@ -12,10 +12,11 @@</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco"><SPAN class="Apple-converted-space"> </SPAN>//===----------------------------------------------------------------------===//</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco"><SPAN class="Apple-converted-space"> </SPAN></FONT><BR class="khtml-block-placeholder"></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco"><SPAN class="Apple-converted-space"> </SPAN>#define DEBUG_TYPE "jit"</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco"><SPAN class="Apple-converted-space"> </SPAN>#include "PPCJITInfo.h"</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco"><SPAN class="Apple-converted-space"> </SPAN>#include "PPCRelocations.h"</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco">+#include "PPCTargetMachine.h"</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco"><SPAN class="Apple-converted-space"> </SPAN>#include "llvm/CodeGen/MachineCodeEmitter.h"</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco"><SPAN class="Apple-converted-space"> </SPAN>#include "llvm/Config/alloca.h"</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco"><SPAN class="Apple-converted-space"> </SPAN>#include "llvm/Support/Debug.h"</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco"><SPAN class="Apple-converted-space"> </SPAN>#include <set></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco"><SPAN class="Apple-converted-space"> </SPAN>using namespace llvm;</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco">@@ -145,60 +146,56 @@ asm(</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco"><SPAN class="Apple-converted-space"> </SPAN>asm(</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco"><SPAN class="Apple-converted-space">     </SPAN>".text\n"</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco"><SPAN class="Apple-converted-space">     </SPAN>".align 2\n"</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco"><SPAN class="Apple-converted-space">     </SPAN>".globl PPC32CompilationCallback\n"</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco"><SPAN class="Apple-converted-space"> </SPAN>"PPC32CompilationCallback:\n"</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco">-<SPAN class="Apple-converted-space">    </SPAN>// Make space for 8 ints r[3-10] and 13 doubles f[1-13] and the<SPAN class="Apple-converted-space"> </SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco">+<SPAN class="Apple-converted-space">    </SPAN>// Make space for 8 ints r[3-10] and 8 doubles f[1-8] and the<SPAN class="Apple-converted-space"> </SPAN></FONT></DIV></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">This is an ABI change on Darwin, the first 13 fp regs might have arguments in them, and we have to save them, since presumably the compilation callback could clobber anything it wanted.  Please revert this part of the patch.</DIV></DIV><BR><DIV>Thanks,</DIV><DIV>Nate</DIV><DIV><BR class="khtml-block-placeholder"></DIV></BODY></HTML>