Evan Cheng wrote:> I think the easiest thing for you to do is to define a separate CALL > instruction with a different set of Defs. This instruction should > only be selected when the predicate isMacho is true. Also update > PPCRegisterInfo.cpp getCalleeSavedRegs() to return a different list > when subtarget->isMachoABI() is true. >Alright, thx Evan, that's what I did. Here are the final patches I think can be committed. I tried to separate them into independent chunks, but I'm not sure how to do this in a good way because of CVS and since everything is kind of related. CallABIELF.patch file changes PPCISelLowering.cpp file for ELF ABI call support CalleeSavedLinuxPPC.patch changes the callee saved registers for function calls Creqv.patch adds some XLForm_1 classes to PPCInstrFormats.td for the CREQV instruction support Frame.patch modifies PPCFrameInfo.h to take into account the ELF ABI for frame manipulation JITLinuxPPC.patch adds support to detect a Linux/PPC JIT and separate the ELF ABI with the MachO ABI I didn't sign any licence paper for LLVM. Let me know if I have to do something to commit to CVS. I can also give my code without any restriction if someone wants to commit. Cheers, Nicolas -------------- next part -------------- A non-text attachment was scrubbed... Name: CallABIELF.patch Type: text/x-patch Size: 13361 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20070217/299a214d/attachment.bin> -------------- next part -------------- A non-text attachment was scrubbed... Name: CalleeSavedLinuxPPC.patch Type: text/x-patch Size: 9325 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20070217/299a214d/attachment-0001.bin> -------------- next part -------------- A non-text attachment was scrubbed... Name: Creqv.patch Type: text/x-patch Size: 1388 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20070217/299a214d/attachment-0002.bin> -------------- next part -------------- A non-text attachment was scrubbed... Name: Frame.patch Type: text/x-patch Size: 10953 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20070217/299a214d/attachment-0003.bin> -------------- next part -------------- A non-text attachment was scrubbed... Name: JITLinuxPPC.patch Type: text/x-patch Size: 4390 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20070217/299a214d/attachment-0004.bin>
On Sat, 17 Feb 2007, Nicolas Geoffray wrote:> Alright, thx Evan, that's what I did. > > Here are the final patches I think can be committed. I tried to separate > them into independent chunks, but I'm not sure how to do this in a good > way because of CVS and since everything is kind of related.Sorry for the delay, I applied the patches after some cleanups. Please keep code within 80 columns, please don't use nested ?: expressions without parens, and please be careful about indentation. Please verify that mainline CVS has everything you think it should. The one hunk I didn't apply was this one: @@ -1392,12 +1418,13 @@ case MVT::f32: case MVT::f64: - if (isVarArg && isPPC64) { + if (isVarArg || isPPC64) { // Float varargs need to be promoted to double. if (Arg.getValueType() == MVT::f32) Arg = DAG.getNode(ISD::FP_EXTEND, MVT::f64, Arg); This changes the darwin/ppc ABI. It's not clear to me that this was intended, so I just left it out. Thanks a lot for these patches. How well does linux/ppc work now? -Chris -- http://nondot.org/sabre/ http://llvm.org/
Hi Chris, Chris Lattner wrote:> Sorry for the delay, > >No problem. Plus the reviewing may have taken some time. So thx a lot for committing. I talked to Jim who said he wanted to commit his changes before mine -- I hope everything's Ok.> I applied the patches after some cleanups. Please keep code within 80 > columns, please don't use nested ?: expressions without parens, and please > be careful about indentation.Alright, sorry I forgot that. I'll be careful next time. Btw, if i have some bug fixes to do, what should I do? Ask for a write access? Or just do an RFC and waiting for someone to commit?> Please verify that mainline CVS has > everything you think it should. >I just verified and launched some compilations. Everything seems OK.> The one hunk I didn't apply was this one: > > @@ -1392,12 +1418,13 @@ > case MVT::f32: > case MVT::f64: > - if (isVarArg && isPPC64) { > + if (isVarArg || isPPC64) { > // Float varargs need to be promoted to double. > if (Arg.getValueType() == MVT::f32) > Arg = DAG.getNode(ISD::FP_EXTEND, MVT::f64, Arg); > > This changes the darwin/ppc ABI. It's not clear to me that this was > intended, so I just left it out. >Ah yes, I changed this and forgot to mention it (it deserves a different commit - it's, as you noticed not, directly related to the linux/ppc abi). I think it should be a "or" instead of an "and" : floats are promoted to double in a vararg call wether you're on ppc64 or ppc32. Maybe i'm missing something, anyone can confirm?> Thanks a lot for these patches. How well does linux/ppc work now? > >Thanks to you for reviewing and committing. I would like to say it works great :) but I know there is one bug I have to found because I sometimes seem to get an infinite loop. If others have the opportunity to test it, please give us some feedback. Cheers, Nicolas