[LLVMdev] Need help in converting int to double

John McCall
Thu, 22 Sep 2011 23:05:44 -0000

On Sep 22, 2011, at 3:32 AM, James Molloy wrote:
> It’s in trouble by this point because it needs to do a fptosi on a double
operand, but you’ve got an i64 operand and you can’t reinterpret-cast ints to
floats in LLVM IR (AFAIK)

You can bitcast ints to floats and vice-versa if they're the same size — for
example, i32 to float and i64 to double.

John.