gallivm: don't calculate square root of rho if we use accurate rho method
gallivm: don't calculate square root of rho if we use accurate rho method

While a sqrt here and there shouldn't hurt much (depending on the cpu) it is
possible to completely omit it since rho is only used for calculating lod and
there log2(x) == 0.5*log2(x^2). Depending on the exact path taken for
calculating lod this means we get a simple mul instead of sqrt (in case of
nearest mip filter in fact we don't need to replace the sqrt with something
else at all), only in some not very useful path this doesn't work (combined
brilinear calculation of int level and fractional lod, accurate rho calc but
brilinear filtering seems odd).
Apart from being faster as an added bonus this should increase our crappy
fractional accuracy of lod, since fast_log2 is only good for ~3bits and this
should increase accuracy by one bit (though not used if dimension is just one
as we'd need an extra mul there as we never had the squared rho in the first
place).

v2: use separate ilog2_sqrt function if we have squared rho.

Reviewed-by: Jose Fonseca <61b5a29db2c0650f7c8510f93eece059c1b09320@vmware.com>

metora/MesaGLSLCompiler,benaadams/glsl-optimizer,djreep81/glsl-optimizer,bkaradzic/glsl-optimizer,dellis1972/glsl-optimizer,bkaradzic/glsl-optimizer,metora/MesaGLSLCompiler,zeux/glsl-optimizer,benaadams/glsl-optimizer,mcanthony/glsl-optimizer,mcanthony/glsl-optimizer,jbarczak/glsl-optimizer,jbarczak/glsl-optimizer,wolf96/glsl-optimizer,mcanthony/glsl-optimizer,mapbox/glsl-optimizer,tokyovigilante/glsl-optimizer,jbarczak/glsl-optimizer,tokyovigilante/glsl-optimizer,dellis1972/glsl-optimizer,mapbox/glsl-optimizer,tokyovigilante/glsl-optimizer,zeux/glsl-optimizer,dellis1972/glsl-optimizer,tokyovigilante/glsl-optimizer,tokyovigilante/glsl-optimizer,mapbox/glsl-optimizer,wolf96/glsl-optimizer,djreep81/glsl-optimizer,dellis1972/glsl-optimizer,wolf96/glsl-optimizer,benaadams/glsl-optimizer,zeux/glsl-optimizer,jbarczak/glsl-optimizer,zz85/glsl-optimizer,zz85/glsl-optimizer,mapbox/glsl-optimizer,benaadams/glsl-optimizer,bkaradzic/glsl-optimizer,djreep81/glsl-optimizer,wolf96/glsl-optimizer,zz85/glsl-optimizer,djreep81/glsl-optimizer,djreep81/glsl-optimizer,mcanthony/glsl-optimizer,zz85/glsl-optimizer,wolf96/glsl-optimizer,mapbox/glsl-optimizer,bkaradzic/glsl-optimizer,metora/MesaGLSLCompiler,bkaradzic/glsl-optimizer,mcanthony/glsl-optimizer,zeux/glsl-optimizer,dellis1972/glsl-optimizer,zz85/glsl-optimizer,zeux/glsl-optimizer,jbarczak/glsl-optimizer,zz85/glsl-optimizer,benaadams/glsl-optimizer,benaadams/glsl-optimizer