[LLVMdev] Using CallingConvLower in ARM target
Sandeep Patel
deeppatel1987 at gmail.com
Fri Jan 16 17:26:16 PST 2009
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:
typedef bool CCCustomFn(unsigned ValNo, MVT ValVT,
MVT LocVT, CCValAssign::LocInfo LocInfo,
ISD::ArgFlagsTy ArgFlags, CCState &State, bool &result);
More information about the llvm-dev
mailing list