[Mesa-dev] [PATCH 09/41] SQUASH: i965/fs: Change regs_written to be actual hardware registers

Matt Turner mattst88 at gmail.com
Tue Sep 23 10:33:19 PDT 2014


On Sat, Sep 20, 2014 at 10:22 AM, Jason Ekstrand <jason at jlekstrand.net> wrote:
> ---
>  src/mesa/drivers/dri/i965/brw_fs.cpp               | 27 +++++++++++++++++-----
>  src/mesa/drivers/dri/i965/brw_fs_visitor.cpp       | 19 ++++++++-------
>  .../drivers/dri/i965/brw_schedule_instructions.cpp |  7 +++---
>  3 files changed, 36 insertions(+), 17 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
> index 33214fd..9656081 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
> @@ -65,7 +65,23 @@ fs_inst::init(enum opcode opcode, const fs_reg &dst, fs_reg *src, int sources)
>     this->conditional_mod = BRW_CONDITIONAL_NONE;
>
>     /* This will be the case for almost all instructions. */
> -   this->regs_written = 1;
> +   switch (dst.file) {
> +   case GRF:
> +   case HW_REG:
> +   case MRF:
> +      this->regs_written = (dst.width * dst.stride * type_sz(dst.type) + 31) / 32;
> +      break;
> +   case BAD_FILE:
> +      this->regs_written = 0;
> +      break;
> +   case IMM:
> +   case UNIFORM:
> +      unreachable("Invalid destination register file");
> +      break;

break after unreachable

> +   default:
> +      unreachable("Invalid register file");
> +      break;

and here.


More information about the mesa-dev mailing list