Jason Ekstrand <[email protected]> writes: > @@ -151,8 +153,10 @@ _mesa_snorm_to_snorm(int x, unsigned src_bits, unsigned > dst_bits) > return -MAX_INT(dst_bits); > else if (src_bits < dst_bits) > return EXTEND_NORMALIZED_INT(x, src_bits - 1, dst_bits - 1); > - else > + else if (src_bits > dst_bits) > return x >> (src_bits - dst_bits); > + else > + return x; > }
This part seems pretty unnecessary as it seems pretty unlikely that a compiler couldn't optimise away x >> 0. However I'm happy if you want to land it anyway for consistency. If you wanted to optimise it a bit more you could move the if(src_bits==dst_bits) to above the first if statement because I think it would be tricky the for the compiler to optimise that away. Either way, Reviewed-by: Neil Roberts <[email protected]> Regards, - Neil _______________________________________________ mesa-dev mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-dev
