[Mesa-dev] [PATCH 2/2] prog_to_nir: Remove OPCODE_MOV special case.

Eric Anholt eric at anholt.net
Mon Jun 1 19:20:12 PDT 2015


Kenneth Graunke <kenneth at whitecape.org> writes:

> On Monday, June 01, 2015 01:03:10 PM Matt Turner wrote:
>> OPCODE_MOV is in the op_trans[] array.
>> ---
>>  src/mesa/program/prog_to_nir.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/src/mesa/program/prog_to_nir.c b/src/mesa/program/prog_to_nir.c
>> index 5e104e7..d6f165e 100644
>> --- a/src/mesa/program/prog_to_nir.c
>> +++ b/src/mesa/program/prog_to_nir.c
>> @@ -891,7 +891,7 @@ ptn_emit_instruction(struct ptn_compile *c, struct prog_instruction *prog_inst)
>>        break;
>>  
>>     default:
>> -      if (op_trans[op] != 0 || op == OPCODE_MOV) {
>> +      if (op_trans[op] != 0) {
>>           ptn_alu(b, op_trans[op], dest, src);
>>        } else {
>>           fprintf(stderr, "unknown opcode: %s\n", _mesa_opcode_string(op));
>> 
>
> This was copy and pasted from Eric's TGSI->NIR pass, which special cases
> TGSI_OPCODE_MOV.  Apparently, that's pointless too.

nir_op_fmov was 0, so the op_trans[op] test for != 0 would error out on
TGSI_OPCODE_MOVs.

It looks like nir_op_fmov has changed value since then, so this doesn't
work any more.
-------------- 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/20150601/91cdfffa/attachment.sig>


More information about the mesa-dev mailing list