[LLVMdev] decimal to floating point conversion

Dale Johannesen dalej at apple.com
Wed Mar 18 12:55:18 PDT 2009


On Mar 18, 2009, at 12:18 PMPDT, aparna kotha wrote:

> Hi all:
>
> I need an instruction that can convert decimal values into floating  
> point numbers.
>
> i.e. say I have a decimal number 1110794174 (== 42355FBE in hex )  
> and  (== 45.3435 as a float)
>
> essentially the mantissa and exponent representation needs to be used.
>
> Is there any way of doing  this in llvm?

Not entirely sure what you're after, but if you want to interpret the  
bits of the int as floating point, use bitcast.




More information about the llvm-dev mailing list