[Mesa-dev] [PATCH 5/9] nir: Add a flag for lowering fneg/ineg.

Connor Abbott cwabbott0 at gmail.com
Tue Feb 3 16:09:08 PST 2015

On Tue, Feb 3, 2015 at 5:20 PM, Eric Anholt <eric at anholt.net> wrote:
> Connor Abbott <cwabbott0 at gmail.com> writes:
>> I think this logic should be flipped around... you should have a flag
>> 'lower_sub' which is false for vc4 but true for i965, and then if the
>> flag is true we lower sub to add+neg and if false we try and
>> reconstruct sub (and do other things like pulling neg's out of
>> multiplies). That way, eventually we can turn off the lowering in GLSL
>> IR and in the future pass a subtract in the GLSL source all the way
>> down to the driver without lowering it and then un-lowering it.
> I think given that vc4 is pretty much alone in wanting SUBs instead of
> src modifiers, we should probably be the non-default flag value, but I
> don't feel too strongly.

Well, I think that the other way is more consistent with stuff like
lower_pow where some hardware can do the more complicated thing
directly and some can't, plus this is the way it already works in GLSL
IR. But yeah, it's not terribly important and now that I think about
it it could go either way.

More information about the mesa-dev mailing list