[Mesa-dev] [PATCH] i965/fs: Reimplement nir_op_uadd_carry and _usub_borrow without accumulator.

Ilia Mirkin imirkin at alum.mit.edu
Fri Jul 10 07:42:16 PDT 2015


On Thu, Jul 9, 2015 at 4:11 PM, Francisco Jerez <currojerez at riseup.net> wrote:
> Ilia Mirkin <imirkin at alum.mit.edu> writes:
>
>> FYI there's already a lowering pass that does this in the GLSL IR
>> (CARRY_TO_ARITH in lower_instructions). Perhaps the right place to do
>> this is NIR though, just wanted to let you know.
>>
> Ah, I wasn't aware of that flag, that seems even better.  I just tried
> it and it seems to generate one instruction more per op than my assembly
> code (apparently because our implementation of b2i is suboptimal, could
> probably be fixed), but it would also work to get rid of the no16()
> calls, which is all I care about right now.
>
> I'll resend using your approach tomorrow.

Ideally nir would be smart enough to combine ops back into
carry/borrow ops in its algebraic pass (assuming backend support for
GS5), which should hopefully allow CSE to also operate properly here.

Cheers,

  -ilia


More information about the mesa-dev mailing list