[LLVMdev] Help with setting up a software-float supported architecture target

Tim Northover t.p.northover at gmail.com
Mon May 6 12:11:32 PDT 2013


Hi Dan,

> For example, since I have a software-only float architecture, how is it best
> supported for LLVM compilation to have the DAG system know that the
> operations types need to remain as float calls?

I think in most architectures this would be handled by not marking any
floating-point type as legal in XXXISelLowering.cpp. Look for:

    addRegisterClass(MVT::fXXX, ...);

calls and remove them. If you've done that then type legalization
should convert all floating-point operations into library calls
automatically before the DAG combiner gets involved. The DAG combiner
shouldn't undo any of this.

If you *really* need floating types to be legal for some reason, then
you're on the right track, and "setLoadExtAction" will be what
controls the combiner in this particular case. But there may be other
places you've got to help things along. For example the AArch64
backend is in that position with fp128 and has to emit the RTLIB calls
itself to some degree.

As always, see how other backends do it.

Cheers.

Tim.



More information about the llvm-dev mailing list