[llvm-commits] [PATCH][Review request] IEEE quad software emulation library call

Hatanaka, Akira ahatanaka at mips.com
Thu Jan 26 16:17:35 PST 2012


I have been thinking about this for a while but haven't been able to come up with a solution that is much better.

Nodes in a DAG is legalized top-down, and f128 nodes have to be transformed to integer type nodes and then expanded into smaller type nodes to make forward progress, so it seems difficult to not legalize operands of nodes that require library calls without making drastic changes in the code. Bitcasting an i128 to f128 is silly, but I think it is a lot simpler.

I have attached another patch which basically takes the same approach but is cleaner than the previous one.
Properties of f128 are set by the target if it needs to have arguments passed in floating point registers:
    setRegisterType(MVT::f128, MVT::f64);
    setNumRegisters(MVT::f128, 2);
    setTypeToTransformTo(MVT::f128, MVT::f128);


If this isn't the preferred way to legalize f128, I can do pure soft-float legalization in LegalizeFloatTypes.cpp, in the same way other floating point types are legalized, and do i128 <-> f128 conversion in MipsSelLowering.cpp, but that would require changes in LowerCall's API.

________________________________________
From: Anton Korobeynikov [anton at korobeynikov.info]
Sent: Wednesday, January 25, 2012 5:46 AM
To: Hatanaka, Akira
Cc: Eli Friedman; baldrick at free.fr; llvm-commits at cs.uiuc.edu
Subject: Re: [llvm-commits] [PATCH][Review request] IEEE quad software emulation library call

Akira,

> Okay, if that doesn't work, I think I will have to legalize f128 during type legalization.
> Is the patch fine as it is now? Or does it need further changes?
I'm still thinking about better approach. It seems silly to legalize
f128 to i128, and try to "recover" from this afterwards.
Maybe we can somehow not legalize arguments to libcalls here... ? And
use the common codegenerator code to do all necessary CC stuff.

Do you have any ideas here?

--
With best regards, Anton Korobeynikov
Faculty of Mathematics and Mechanics, Saint Petersburg State University
-------------- next part --------------
A non-text attachment was scrubbed...
Name: f128.patch
Type: text/x-patch
Size: 62489 bytes
Desc: f128.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120127/433a6e2b/attachment.bin>


More information about the llvm-commits mailing list