[LLVMdev] Struct parameter

Hwalin dodohack at gmail.com
Wed Mar 3 22:40:38 PST 2010


Hi, guys,

If there is a struct {i8, i8, i32}, and there are several parameter
GPRs(32bits), say, r0, r1~r5, I can make this struct to be passed in r0, r1
because LLVM_SHOULD_PASS_AGGREGATE_IN_INTEGER_REGS is true in DefaultABI,
neither it passed by value, nor it passed as FCA.

But if the first parameter register r0 is occupied by other argument, in
DefaultABI, that struct passed as a i64, and i64 requires 8 bytes alignment
in my target, therefore, r1 is skipped for this reason, this is not what I
want.
I have tried to pass struct as FCA or byval, but pass as FCA do not pass
those 2 i8 elements in one register, and byval does not obey the
ABI definition of my target, my target wants that struct passes in 2 general
registers with 4 bytes alignment, not 8 byte alignment.

Should I implement another ABI class for my target in llvm-gcc?

-- 
Aries at AndesHZ
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100304/3e384bd5/attachment.html>


More information about the llvm-dev mailing list