[Mesa-dev] [PATCH v2 12/19] i965/fs: Use exec_size for determining regs read/written and partial writes

Jason Ekstrand jason at jlekstrand.net
Tue Jun 30 16:14:57 PDT 2015


On Tue, Jun 30, 2015 at 7:19 AM, Francisco Jerez <currojerez at riseup.net> wrote:
> Jason Ekstrand <jason at jlekstrand.net> writes:
>
>> Reviewed-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
>> ---
>>  src/mesa/drivers/dri/i965/brw_fs.cpp | 8 ++++----
>>  1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
>> index d1e253a..4f56865 100644
>> --- a/src/mesa/drivers/dri/i965/brw_fs.cpp
>> +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
>> @@ -101,7 +101,7 @@ fs_inst::init(enum opcode opcode, uint8_t exec_size, const fs_reg &dst,
>>     case MRF:
>>     case ATTR:
>>        this->regs_written =
>> -         DIV_ROUND_UP(MAX2(dst.width * dst.stride, 1) * type_sz(dst.type), 32);
>> +         DIV_ROUND_UP(MAX2(exec_size * dst.stride, 1) * type_sz(dst.type), 32);
>>        break;
>>     case BAD_FILE:
>>        this->regs_written = 0;
>> @@ -675,7 +675,7 @@ bool
>>  fs_inst::is_partial_write() const
>>  {
>>     return ((this->predicate && this->opcode != BRW_OPCODE_SEL) ||
>> -           (this->dst.width * type_sz(this->dst.type)) < 32 ||
>> +           (this->exec_size * type_sz(this->dst.type)) < 32 ||
>>             !this->dst.is_contiguous());
>>  }
>>
>> @@ -729,8 +729,8 @@ fs_inst::regs_read(int arg) const
>>        if (src[arg].stride == 0) {
>>           return 1;
>>        } else {
>> -         int size = src[arg].width * src[arg].stride * type_sz(src[arg].type);
>> -         return (size + 31) / 32;
>> +         int size = this->exec_size * src[arg].stride * type_sz(src[arg].type);
>> +         return DIV_ROUND_UP(size, 32);
>
> This seems to be wrong for header sources of LOAD_PAYLOAD, since they
> are 8-wide regardless of the instruction execution size.

Thanks.  I've got that fixed now.  For LOAD_PAYLOAD, we'll just return
1 if it's a header source.
--Jason

>>        }
>>     case MRF:
>>        unreachable("MRF registers are not allowed as sources");
>> --
>> 2.4.3
>>
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list