[Mesa-dev] [PATCH v2 7/7] i965/nir: Use signed integer type for booleans

Jason Ekstrand jason at jlekstrand.net
Sat Mar 21 12:28:26 PDT 2015


On Fri, Mar 20, 2015 at 2:21 PM, Jason Ekstrand <jason at jlekstrand.net> wrote:
> On Fri, Mar 20, 2015 at 1:56 PM, Matt Turner <mattst88 at gmail.com> wrote:
>> On Fri, Mar 20, 2015 at 1:37 PM, Jason Ekstrand <jason at jlekstrand.net> wrote:
>>> On Fri, Mar 20, 2015 at 1:12 PM, Matt Turner <mattst88 at gmail.com> wrote:
>>>> On Fri, Mar 20, 2015 at 11:24 AM, Jason Ekstrand <jason at jlekstrand.net> wrote:
>>>>> -      emit(MOV(result, masked));
>>>>> +      emit(MOV(retype(result, BRW_REGISTER_TYPE_D), masked));
>>>>
>>>> This hunk isn't necessary. masked is vgrf(glsl_type::int_type).
>>>
>>> This hunk retypes result, not masked.
>>
>> Oh, yeah. But result is set at the top of the function like this:
>>
>>    fs_reg result = get_nir_dest(instr->dest.dest);
>>    result.type = brw_type_for_nir_type(nir_op_infos[instr->op].output_type);
>>
>> Isn't that sufficient? We're only going to be resolving things that
>> were bool-typed to begin with, which should mean that the other
>> changes in this patch handled it.

I just looked at it and remembered what the problem was.  Right now,
iand, ior, and ixor and defined to take and produce unsigned types.
Why?  I don't know.  I guess they seemed more like unsigned operations
to Connor.  We could change that easily enough to make them signed,
but leaving this hunk in makes the FS backend do the right thing
regardless.
--Jason


More information about the mesa-dev mailing list