[Mesa-dev] Mesa (master): r600g: Use default mul/mad function for tgsi-to-llvm

Alex Deucher alexdeucher at gmail.com
Thu Dec 6 10:35:22 PST 2012

On Thu, Dec 6, 2012 at 1:27 PM, Alex Deucher <alexdeucher at gmail.com> wrote:
> On Thu, Dec 6, 2012 at 1:21 PM, Vincent Lejeune <vljn at ovi.com> wrote:
>> Sorry for the inconvenience.
>> I think the r600g backend work because of this patch, which switch MUL and MUL_IEEE definition :
>> http://lists.freedesktop.org/archives/mesa-dev/2012-November/030748.html
>> The rationale behind the patch is use the fmul instead of a custom intrinsic for OpenGL path.
>> Glsl-to-llvm generates as "vanilla" instructions as possible and uses fmul, this consolidates behaviour
>> between tgsi-to-llvm and glsl-to-llvm.
>> IMHO emitting MUL and MUL_IEEE should be decided with the presence of some "fast-math" arg to the backend,
>> or some context variable telling if we have a glsl or an opencl shader.
> MUL and MUL_IEEE are not related to performance, rather to behavior:
> MUL            Floating-point multiply. 0*anything = 0.
> MUL_IEEE  IEEE Floating-point multiply. Uses IEEE rules for 0*anything.

IIRC, we want the MUL behavior in GL.  In the pre-LLVM days we used
MUL_IEEE and switching to MUL fixed a bunch of piglit tests.


More information about the mesa-dev mailing list