[Mesa-dev] [PATCH 1/3] i965/fs: Detect multi-register MOVs correctly in register_coalesce.

Francisco Jerez currojerez at riseup.net
Tue Jul 28 07:26:07 PDT 2015


Jason Ekstrand <jason at jlekstrand.net> writes:

> On Jul 28, 2015 2:43 AM, "Francisco Jerez" <currojerez at riseup.net> wrote:
>>
>> register_coalesce() was considering the exec_size of the MOV
>> instruction alone to decide whether the register at offset+1 of the
>> source VGRF was being copied to inst->dst.reg_offset+1 of the
>> destination VGRF, which is only a valid assumption if the move has a
>> 32-bit execution type.  Use regs_read() instead to find out the number
>> of registers copied by the instruction.
>> ---
>>  src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp
> b/src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp
>> index a253c81..4544122 100644
>> --- a/src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp
>> +++ b/src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp
>> @@ -195,7 +195,7 @@ fs_visitor::register_coalesce()
>>              continue;
>>           }
>>           reg_to_offset[offset] = inst->dst.reg_offset;
>> -         if (inst->exec_size == 16)
>> +         if (inst->regs_read(0) > 1)
>>              reg_to_offset[offset + 1] = inst->dst.reg_offset + 1;
>>           mov[offset] = inst;
>>           channels_remaining -= inst->regs_written;
>
> And then we use regs_written directly below...
>
> Off you want it to be more consistent, we could use regs_written for both.
> Either wary,
>
> Reviewed-by: Jason Ekstrand <jason.ekstrand at intel.com>
>
Sure, thanks.

>> --
>> 2.4.6
>>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 212 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150728/302c0bd8/attachment.sig>


More information about the mesa-dev mailing list