[Mesa-dev] [PATCH] nir: add option to lower slt/sge/seq/sne
Matt Turner
mattst88 at gmail.com
Tue Mar 31 11:20:15 PDT 2015
On Tue, Mar 31, 2015 at 11:11 AM, Rob Clark <robdclark at gmail.com> wrote:
> On Tue, Mar 31, 2015 at 2:03 PM, Kenneth Graunke <kenneth at whitecape.org> wrote:
>> I'm pretty sure you want b2f here, not u2f...the slt/sge/seq/sne opcodes
>> are defined to return either 0.0 or 1.0. flt and friends return 0 or
>> 0xFFFFFFFF. u2f converts the numerical value of the unsigned source to
>> float, so this would return 0.0 or 4294967295.0.
>>
>
> hmm, that is a bit sad (since on the flt/etc cases I'd have to
> multiply by 0xffffffff, which would in turn require a mov for the
> 0xffffffff or perhaps emitting a driver uniform/const), and since it
> makes the b2f more complicated..
Are you saying your hardware returns 0/1 for false/true?
If you can do integer negation as a source mod, you can just negate its uses.
Alternatively, Jason's implemented a pass to "resolve" booleans to
these values, which is necessary for us on i965 Gen4 and Gen5. You
could probably use that.
More information about the mesa-dev
mailing list