On Sat, 2017-05-20 at 14:09 -0700, Matt Turner wrote: > On Thu, May 18, 2017 at 2:43 AM, Iago Toral Quiroga <ito...@igalia.co > m> wrote: > > The main change is that we now use round*() instead of IROUND*() > > which only > > worked for signed integer cases. I have also made it so we write > > converted unsigned values the unsigned field in the destination > > union and to > > cast the result from round*() to the target integer type explicitly > > (this is > > redundant now that we we write to the appropriate union field, but > > shouldn't > > hurt). > > > > The series drops the patch that added IROUNDD64 since we no longer > > need > > that macro and adds another patch at the end to remove the > > remaining uses > > of IROUND macros in this function (still used for signed integer > > cases) for > > the sake of consistency. > > Thank you for doing this. > > Assuming my suggestions to use lround/llround/etc don't cause > problems, the series is
Since these functions return a signed integer in all cases, we have the same problems that Nicolai discussed for the IROUND() functions: they won't do the right thing when the floating point value exceeds the signed integer range: #include <stdio.h> #include <math.h> int main() { double f = 10000000000000000000.0; printf("%llu %llu\n", llround(f), (unsigned long long int)f); } ./a.out 9223372036854775808 10000000000000000000 > Reviewed-by: Matt Turner <matts...@gmail.com> Does your review-by still stand for the original version? Iago _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev