[llvm-commits] [PATCH] UINT_TO_FP of vectors

Dirk Steinke steinke.dirk.ml at googlemail.com
Wed Mar 16 15:40:01 PDT 2011


Hi Steve,

On 03/16/2011 11:29 PM, Dirk Steinke wrote:
> On 03/16/2011 10:29 PM, Stephen Canon wrote:
[snip]
>>
>> You are mistaken.
>>
>> You cannot implement uint -> fp as you describe, as it introduces a
>> double-rounding for certain values. There are many, but here is one
[snip]
> The only other thing I could come up with right now, is changing the
> partitioning from like
> SINT_TO_FP(high 16 bits) * (2^16) + SINT_TO_FP(low 16 bits)
> to
> SINT_TO_FP(high 31 bits) * (2) + SINT_TO_FP(low 1 bit)
Which of course wouldn't work anyway for the reason, you already 
described. I guess I must be much more careful when thinking about
floating point operations.

Dirk



More information about the llvm-commits mailing list