[LLVMdev] problem with function arguments in ARM EABI

Evan Cheng evan.cheng at apple.com
Fri Feb 9 00:03:14 PST 2007


On Feb 8, 2007, at 10:46 AM, Lauro Ramos Venancio wrote:

> I'm facing a problem with functions arguments. ARM EABI defines that
> 8-bytes arguments must be 8-bytes aligned. For example:
>
> void @f(i32 %a, i64 %b)
>
> ARM EABI:
> r0 <- %a
> r2,r3 <- %b

Ok. I suppose this makes it easier to use 64 bit store instructions.

>
> Darwin:
> r0 <- %a
> r1,r2 <- %b
>
> void @g(i32 %a, i32 %b, i32 %c)
>
> ARM EABI or Darwin:
> r0 <- %a
> r1 <- %b
> r2 <- %c
>
> The problem is: I can't differ a i64 argument of two i32 arguments in
> ISD::CALL (ARM doesn't have i64 registers). The function
> TargetLowering::LowerCallTo transforms all i64 arguments in two i32
> arguments.
>
> A possible solution is override TargetLowering::LowerCallTo and do not
> expand i64 arguments. I don't know if it's a good solution. None
> backend overrides this function.

Yes, you need to override both LowerArguments and LowerCallTo. All of  
the current targets / abi's use the default implementation in  
SelectionDAGISel.cpp But I guess ARM EABI will be the first. :-) As  
far as I can see, this is the only clean way to do it.  I expect the  
ARM EABI specific implementation will be quite a bit simpler than the  
default implementation though.

Evan


>
> Any ideas?
>
> Lauro
> _______________________________________________
> 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