[Mesa-dev] [PATCH] nir: fix typo in idiv lowering, causing large-udiv-udiv failures

Ilia Mirkin imirkin at alum.mit.edu
Tue Nov 10 16:02:55 PST 2015


On Tue, Nov 10, 2015 at 6:44 PM, Eric Anholt <eric at anholt.net> wrote:
> Ilia Mirkin <imirkin at alum.mit.edu> writes:
>
>> In nv50, and in the python script that Rob circulated, we do:
>>
>>    bld.mkCmp(OP_SET, CC_GE, TYPE_U32, (s = bld.getSSA()), TYPE_U32, m, b);
>>
>> Do the same in the nir div lowering pass. This fixes the large-udiv-udiv
>> piglit tests on freedreno.
>
> I assume you meant *-op-div-large-uint-uint.shader_test.

Yes.

>
> vc4 doesn't have uge yet, but I've got a patch to add it and it does
> fix one subtest.  What this lowering pass is actually doing has never
> really made sense to me, but it works, so:
>
> Acked-by: Eric Anholt <eric at anholt.net>

It's a magical sequence of non-sensical operations which appear to
produce the proper result with high probability... what's so confusing
about that? :)

More seriously, I think there are Newton-Raphson overtones in what
it's doing, but I never fully traced it down. It kind of loses me
after subtracting 2 from the integer representation of the float bits.


More information about the mesa-dev mailing list