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

Hatanaka, Akira ahatanaka at mips.com
Thu Jan 12 13:40:42 PST 2012


Please review the attached patches which were rewritten based on the feedback I received.
Any feedback is welcome.

f128-1.patch: Changes in target-independent part.
f128-2.patch: Mips-specific changes.
f128.ll: Test case.

A brief summary of the changes I made:
- f128 is legalized by soft-float in the same way other floating point types are.
- Flag SoftFloatArgsInFPRegs and function setRegisterType were added to TargetLowering so that floating point arguments and floating point return values can be passed and received in floating point registers (see line 61 of the second patch).
- An overloaded version of DAGTypeLegalizer::MakeLibCall was added which bitcasts operands and return values before they are passed to LowerCallTo.
- test case: I haven't looked into the code llc generates in detail, but it seems that the quad library function calls I expect to see are being emitted. I will add more check strings later.

________________________________________
From: Anton Korobeynikov [anton at korobeynikov.info]
Sent: Friday, November 11, 2011 1:15 AM
To: Eli Friedman
Cc: Hatanaka, Akira; llvm-commits at cs.uiuc.edu
Subject: Re: [llvm-commits] [PATCH][Review request] IEEE quad software emulation library call

>>> Well, the fact that it's in two f64 registers is really a property of
>>> the calling convention, not a fundamental property of f128... unlike
>>> f128, ppcf128 is actually a pair of f64's, so it isn't really the best
>>> example to follow.  I'm not sure the calling convention handling code
>>> can handle this properly at the moment, though... if nobody else has a
>>> suggestion, it's okay as-is, I guess, but at least add a comment to
>>> explain what is going on.
>> This is definitely a MIPS-specific stuff. There are a lot of examples
>> of "real" f128, e.g.
>> Sparc and (removed in ToT) z/System. Thus it should be either
>> generalized to allow all possible representations, or, perhaps MIPS
>> can just use ppcf128 as well.
>
> MIPS is using "real" f128 as well; the calling convention just
> requires placing it into two f64 registers.
Well, same for z/System (in fact everything is done there on a pair of
f64 regs). I just introduced special "pair" pseudo-registers
containing the pairs of ordinary f64 and got everything worked.

--
With best regards, Anton Korobeynikov
Faculty of Mathematics and Mechanics, Saint Petersburg State University
-------------- next part --------------
A non-text attachment was scrubbed...
Name: f128-1.patch
Type: text/x-patch
Size: 63993 bytes
Desc: f128-1.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120112/0513067b/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: f128-2.patch
Type: text/x-patch
Size: 8171 bytes
Desc: f128-2.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120112/0513067b/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: f128.ll
Type: application/octet-stream
Size: 8569 bytes
Desc: f128.ll
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120112/0513067b/attachment.obj>


More information about the llvm-commits mailing list