[Mesa-dev] [PATCH 3/3] nir: Simplify ine/ieq(ineg(a), a) -> ine/ieq(a, 0)

Thomas Helland thomashelland90 at gmail.com
Thu Aug 6 12:49:16 PDT 2015


2015-08-06 16:22 GMT+02:00 Boyan Ding <boyan.j.ding at gmail.com>:
> But, isn't -INT_MIN == INT_MIN?
>
> Regards,
> Boyan Ding
>

Yup. That's correct. Thanks for pointing that out.
That means this patch is wrong, so I NAK myself on this one.

Regards,
ThoHel

> 2015-08-06 19:36 GMT+08:00 Thomas Helland <thomashelland90 at gmail.com>:
>> The same rationale as in the other patches.
>> No shader-db changes.
>>
>> Signed-off-by: Thomas Helland <thomashelland90 at gmail.com>
>> ---
>>  src/glsl/nir/nir_opt_algebraic.py | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/src/glsl/nir/nir_opt_algebraic.py b/src/glsl/nir/nir_opt_algebraic.py
>> index 3e483fb..d005f81 100644
>> --- a/src/glsl/nir/nir_opt_algebraic.py
>> +++ b/src/glsl/nir/nir_opt_algebraic.py
>> @@ -115,6 +115,8 @@ optimizations = [
>>     (('sne', a, b), ('b2f', ('fne', a, b)), 'options->lower_scmp'),
>>     (('fne', ('fneg', a), a), ('fne', a, 0.0)),
>>     (('feq', ('fneg', a), a), ('feq', a, 0.0)),
>> +   (('ine', ('ineg', a), a), ('ine', a, 0)),
>> +   (('ieq', ('ineg', a), a), ('ieq', a, 0)),
>>     # Emulating booleans
>>     (('imul', ('b2i', a), ('b2i', b)), ('b2i', ('iand', a, b))),
>>     (('fmul', ('b2f', a), ('b2f', b)), ('b2f', ('iand', a, b))),
>> --
>> 2.5.0
>>
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list