[LLVMdev] FP128Ty

Dale Johannesen dalej at apple.com
Tue Feb 17 10:56:59 PST 2009


On Feb 16, 2009, at 6:36 PMPST, Chris Lattner wrote:

>
> On Feb 16, 2009, at 6:12 PM, aparna kotha wrote:
>
>> I am new to llvm and am stuck up with a problem.
>> I am trying to initialize a Value* of type fp128 having the value 0
>>
>> I am using the following construct
>>
>> ConstantFP::get(APFloat(APInt(128,0,false)));
>>
>> This is returning a double instead of a float and I am confused.
>>
>> Thanks a lot for your help.
>
> FP128Ty is stubbed out, but completely untested and not supported by
> any targets yet.

More specifically, the compile-time arithmetic stuff *should* Just  
Work, although nobody has tried it; the conversions of FP128 to and  
from other formats are not done.  They should not be difficult to do  
by copying & modifying existing code.  To do specifically what you're  
trying to do, add the FP128 case to APFloat::initFromAPInt.  The code  
that reads and writes the IR, and writes assembler output, also needs  
to be added.

(The Float in APFloat means "floating point", not the C float type.)




More information about the llvm-dev mailing list