[LLVMdev] Using CallingConvLower in ARM target

Evan Cheng evan.cheng at apple.com
Mon Jan 19 10:18:58 PST 2009


On Jan 16, 2009, at 5:26 PM, Sandeep Patel wrote:

> On Sat, Jan 3, 2009 at 11:46 AM, Dan Gohman <gohman at apple.com> wrote:
>>
>> One problem with this approach is that since i64 isn't legal, the
>> bitcast would require custom C++ code in the ARM target to
>> handle properly.  It might make sense to introduce something
>> like
>>
>>   CCIfType<[f64], CCCustom>
>>
>> where CCCustom is a new entity that tells the calling convention
>> code to to let the target do something not easily representable
>> in the tablegen minilanguage.
>
> I am thinking that this requires two changes: add a flag to
> CCValAssign (take a bit from HTP) to indicate isCustom and a way to
> author an arbitrary CCAction by including the source directly in the
> TableGen mini-language. This latter change might want a generic change
> to the TableGen language. For example, the syntax might be like:
>
> class foo : CCCustomAction {
> code <<< EOF
>      ....multi-line C++ code goes here that allocates regs & mem and
> sets CCValAssign::isCustom....
> EOF
> }
>
> Does this seem reasonable? An alternative is for CCCustom to take a
> string that names a function to be called:
>
> CCIfType<[f64], CCCustom<"MyCustomLoweringFunc">>
>
> the function signature for such functions will have to return two
> results: if the CC processing is finished and if it the func succeeded
> or failed:

I like the second solution better. It seems rather cumbersome to embed  
multi-line c++ code in td files.

Evan
>
>
> typedef bool CCCustomFn(unsigned ValNo, MVT ValVT,
>                        MVT LocVT, CCValAssign::LocInfo LocInfo,
>                        ISD::ArgFlagsTy ArgFlags, CCState &State,  
> bool &result);
> _______________________________________________
> 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