Re: [Mesa-dev] [PATCH] llvmpipe: convert double to long long instead of unsigned long long

2015-09-04 Thread Ilia Mirkin
On Fri, Sep 4, 2015 at 6:57 PM, Matt Turner wrote: > On Thu, Sep 3, 2015 at 8:15 AM, Oded Gabbay wrote: >> round(val*dscale) produces a double result, as val and dscale are double. >> However, LLVMConstInt receives unsigned long long, so there is an >> implicit conversion from double to unsigned

Re: [Mesa-dev] [PATCH] llvmpipe: convert double to long long instead of unsigned long long

2015-09-04 Thread Matt Turner
On Thu, Sep 3, 2015 at 8:15 AM, Oded Gabbay wrote: > round(val*dscale) produces a double result, as val and dscale are double. > However, LLVMConstInt receives unsigned long long, so there is an > implicit conversion from double to unsigned long long. > This is an undefined behavior. Therefore, we

Re: [Mesa-dev] [PATCH] llvmpipe: convert double to long long instead of unsigned long long

2015-09-04 Thread Jose Fonseca
On 03/09/15 16:26, Tom Stellard wrote: On Thu, Sep 03, 2015 at 06:15:26PM +0300, Oded Gabbay wrote: round(val*dscale) produces a double result, as val and dscale are double. However, LLVMConstInt receives unsigned long long, so there is an implicit conversion from double to unsigned long long. T

Re: [Mesa-dev] [PATCH] llvmpipe: convert double to long long instead of unsigned long long

2015-09-03 Thread Tom Stellard
On Thu, Sep 03, 2015 at 06:15:26PM +0300, Oded Gabbay wrote: > round(val*dscale) produces a double result, as val and dscale are double. > However, LLVMConstInt receives unsigned long long, so there is an > implicit conversion from double to unsigned long long. > This is an undefined behavior. Ther

[Mesa-dev] [PATCH] llvmpipe: convert double to long long instead of unsigned long long

2015-09-03 Thread Oded Gabbay
round(val*dscale) produces a double result, as val and dscale are double. However, LLVMConstInt receives unsigned long long, so there is an implicit conversion from double to unsigned long long. This is an undefined behavior. Therefore, we need to first explicitly convert the round result to long l