[Mesa-dev] [PATCH v4 2/3] i965/fs: Use NIR's scalarizing abilities and stop handling vectors

Eric Anholt eric at anholt.net
Wed Jan 28 16:48:55 PST 2015


Matt Turner <mattst88 at gmail.com> writes:

> On Tue, Jan 27, 2015 at 5:31 PM, Jason Ekstrand <jason at jlekstrand.net> wrote:
>> +      emit(MUL(acc, op[0], op[1]));
>> +      emit(MACH(reg_null_d, op[0], op[1]));
>> +      emit(MOV(result, fs_reg(acc)));
>>        break;
>>     }
>>
>> @@ -773,72 +767,38 @@ fs_visitor::nir_emit_alu(nir_alu_instr *instr)
>>     case nir_op_ball_fequal3:
>>     case nir_op_ball_iequal3:
>>     case nir_op_ball_fequal4:
>> -   case nir_op_ball_iequal4: {
>> -      unsigned num_components = nir_op_infos[instr->op].input_sizes[0];
>> -      fs_reg temp = vgrf(num_components);
>> -      emit_percomp(CMP(temp, op[0], op[1], BRW_CONDITIONAL_Z),
>> -                   (1 << num_components) - 1);
>> -      emit_reduction(BRW_OPCODE_AND, result, temp, num_components);
>> -      break;
>> -   }
>> -
>> +   case nir_op_ball_iequal4:
>
> We can save it for later, but it might be interesting to let the fs
> backend get the vector comparisons directly, if that's possible.
>
> See https://bugs.freedesktop.org/show_bug.cgi?id=77456

I think you want to peephole it instead of relying on the language,
since you also want avoid the ANDs for non-vector conditions like "a < 0
&& b < 0".

(I've been thinking about this too)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150128/ad949cab/attachment.sig>


More information about the mesa-dev mailing list