<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><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: normal normal normal 12px/normal Arial; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Would you point me to the Linux/PPC ABI documents you are using so I can better judge what your restrictions are?  These changes also have an effect on debugging and exception handling.</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Arial; min-height: 14px; "><BR></DIV><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; font: normal normal normal 12px/normal Arial; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">-- Jim</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Arial; min-height: 14px; "><BR></DIV><BR><DIV><DIV>On 2-Feb-07, at 08:58 AM, Nicolas Geoffray wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Arial" size="3" style="font: 12.0px Arial">Hi everyone,</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Arial; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Arial" size="3" style="font: 12.0px Arial">I have almost completed the implementation of<SPAN class="Apple-converted-space">  </SPAN>a linux/ppc backend in llvm. There were a few things to modify in</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Arial" size="3" style="font: 12.0px Arial">lib/Target/PowerPC with a lot of "if (!isDarwin)".</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Arial; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Arial" size="3" style="font: 12.0px Arial">There are some places where I need help before saying the port is complete. I attached the diff file as a reference</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Arial; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Arial" size="3" style="font: 12.0px Arial">1) In order to generate a creqv instruction before a vararg call, I created a new instruction in PPCInstrInfo.td: SETCR which</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Arial" size="3" style="font: 12.0px Arial">uses the new XForm_1_ext format. It does not use the XForm_1 format because I wanted to give only one register as operand.</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Arial" size="3" style="font: 12.0px Arial">I'm not sure if this is the correct way to do this, but it works.</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Arial; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Arial" size="3" style="font: 12.0px Arial">2) Line 369 of PPCInstrInfo.td, we declare the non-callee saved registers. However, Linux and Darwin do not have the same set</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Arial" size="3" style="font: 12.0px Arial">of non-callee saved registers. I don't know how to make the if(isDarwin) test in here</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Arial; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Arial" size="3" style="font: 12.0px Arial">3) R31, which replaces R1 as stack pointer when there is a dynamic allocation in a method, must be seen as a callee-saved register and must not be saved and restored like it is actually for Darwin. I don't know how to specify that, when there is a dynamic allocation, R31 must be added to the set of registers that are saved before entering the method and restored at the end.</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Arial; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Arial; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Arial" size="3" style="font: 12.0px Arial">If anyone's kind enough to help me out :)</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Arial; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Arial" size="3" style="font: 12.0px Arial">Cheers,</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Arial" size="3" style="font: 12.0px Arial">Nicolas</FONT></P> </BLOCKQUOTE></DIV><BR></BODY></HTML>