[LLVMdev] Linux/ppc backend

Jim Laskey jlaskey at apple.com
Mon Feb 12 03:41:54 PST 2007


Nicolas,

Thank you.

I was most interested in the linkage area, ie., the amount of space  
between TOS and the parameter area.  My only concern is being able to  
locate the frame pointer (when FP != SP) during stack unwinding  
(debugging and eh.)  If r31 is always saved at -4/-8 (i.e/. a  
constant distance) from previous frame (first saved register) then  
things should be fine.

Cheers,

-- Jim

On 12-Feb-07, at 07:09 AM, Nicolas Geoffray wrote:

> Hi Jim,
>
> I didn't use any documents, but intensively looked at gcc's output. I
> think this document:
> http://refspecs.freestandards.org/elf/elfspec_ppc.pdf
>
> is the last specification of the ABI.
>
> Cheers,
> Nicolas
>
> Jim Laskey wrote:
>> Nicolas,
>>
>> 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.
>>
>> Cheers,
>>
>> -- Jim
>>
>>
>> On 2-Feb-07, at 08:58 AM, Nicolas Geoffray wrote:
>>
>>> Hi everyone,
>>>
>>>
>>> I have almost completed the implementation of  a linux/ppc  
>>> backend in
>>> llvm. There were a few things to modify in
>>>
>>> lib/Target/PowerPC with a lot of "if (!isDarwin)".
>>>
>>>
>>> There are some places where I need help before saying the port is
>>> complete. I attached the diff file as a reference
>>>
>>>
>>> 1) In order to generate a creqv instruction before a vararg call, I
>>> created a new instruction in PPCInstrInfo.td: SETCR which
>>>
>>> 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.
>>>
>>> I'm not sure if this is the correct way to do this, but it works.
>>>
>>>
>>> 2) Line 369 of PPCInstrInfo.td, we declare the non-callee saved
>>> registers. However, Linux and Darwin do not have the same set
>>>
>>> of non-callee saved registers. I don't know how to make the
>>> if(isDarwin) test in here
>>>
>>>
>>> 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.
>>>
>>>
>>>
>>> If anyone's kind enough to help me out :)
>>>
>>>
>>> Cheers,
>>>
>>> Nicolas
>>>
>>
>> --------------------------------------------------------------------- 
>> ---
>>
>> _______________________________________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>>
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list