[Mesa-dev] [PATCH 04/15] i965/fs: Get rid of reladdr

Francisco Jerez currojerez at riseup.net
Thu Dec 10 06:58:16 PST 2015


Jason Ekstrand <jason at jlekstrand.net> writes:

> We aren't using it anymore.

It seems useful to me to be able to represent indirect access as part of
any instruction source or destination register.

The following:

| mov_indirect g0, g1, a0
| foo g2, g0

and the converse case with indirect destination offset (which you don't
seem to represent currently) can be implemented by the hardware more
efficiently using a single instruction in certain cases.  The current IR
is able to represent what the hardware can do, but supporting the
MOV_INDIRECT instruction only would force us to keep the indirection
separate from the instruction that uses it, so it seems like a less
expressive representation to me than the current approach, unless you're
willing to add _INDIRECT variants of most hardware opcodes.

> ---
>  src/mesa/drivers/dri/i965/brw_fs.cpp  | 7 +------
>  src/mesa/drivers/dri/i965/brw_ir_fs.h | 5 +----
>  2 files changed, 2 insertions(+), 10 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
> index 7cc03c5..786c5fb 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
> @@ -433,7 +433,6 @@ fs_reg::fs_reg(struct ::brw_reg reg) :
>  {
>     this->reg_offset = 0;
>     this->subreg_offset = 0;
> -   this->reladdr = NULL;
>     this->stride = 1;
>     if (this->file == IMM &&
>         (this->type != BRW_REGISTER_TYPE_V &&
> @@ -448,7 +447,6 @@ fs_reg::equals(const fs_reg &r) const
>  {
>     return (this->backend_reg::equals(r) &&
>             subreg_offset == r.subreg_offset &&
> -           !reladdr && !r.reladdr &&
>             stride == r.stride);
>  }
>  
> @@ -4716,9 +4714,7 @@ fs_visitor::dump_instruction(backend_instruction *be_inst, FILE *file)
>           break;
>        case UNIFORM:
>           fprintf(file, "u%d", inst->src[i].nr + inst->src[i].reg_offset);
> -         if (inst->src[i].reladdr) {
> -            fprintf(file, "+reladdr");
> -         } else if (inst->src[i].subreg_offset) {
> +         if (inst->src[i].subreg_offset) {
>              fprintf(file, "+%d.%d", inst->src[i].reg_offset,
>                      inst->src[i].subreg_offset);
>           }
> @@ -4829,7 +4825,6 @@ fs_visitor::get_instruction_generating_reg(fs_inst *start,
>  {
>     if (end == start ||
>         end->is_partial_write() ||
> -       reg.reladdr ||
>         !reg.equals(end->dst)) {
>        return NULL;
>     } else {
> diff --git a/src/mesa/drivers/dri/i965/brw_ir_fs.h b/src/mesa/drivers/dri/i965/brw_ir_fs.h
> index c3eec2e..e4f20f4 100644
> --- a/src/mesa/drivers/dri/i965/brw_ir_fs.h
> +++ b/src/mesa/drivers/dri/i965/brw_ir_fs.h
> @@ -58,8 +58,6 @@ public:
>      */
>     int subreg_offset;
>  
> -   fs_reg *reladdr;
> -
>     /** Register region horizontal stride */
>     uint8_t stride;
>  };
> @@ -136,8 +134,7 @@ component(fs_reg reg, unsigned idx)
>  static inline bool
>  is_uniform(const fs_reg &reg)
>  {
> -   return (reg.stride == 0 || reg.is_null()) &&
> -          (!reg.reladdr || is_uniform(*reg.reladdr));
> +   return (reg.stride == 0 || reg.is_null());
>  }
>  
>  /**
> -- 
> 2.5.0.400.gff86faf
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- 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/20151210/860cd4c7/attachment.sig>


More information about the mesa-dev mailing list