[Mesa-dev] [PATCH] i965: Remove the "ARF" register file.

Kenneth Graunke kenneth at whitecape.org
Sat Sep 28 01:39:59 PDT 2013


On 09/27/2013 06:18 PM, Matt Turner wrote:
> The registers in the architecture register file don't share much in
> common, so there's no point in grouping them together. Use the HW_REG
> class instead. The vec4 backend already does this.
> ---
>  src/mesa/drivers/dri/i965/brw_fs.cpp           | 6 ------
>  src/mesa/drivers/dri/i965/brw_fs.h             | 8 ++++----
>  src/mesa/drivers/dri/i965/brw_fs_generator.cpp | 3 ---
>  src/mesa/drivers/dri/i965/brw_shader.h         | 1 -
>  src/mesa/drivers/dri/i965/brw_vec4.h           | 2 +-
>  5 files changed, 5 insertions(+), 15 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
> index 2ebadc8..c33c5c0 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
> @@ -2782,12 +2782,6 @@ fs_visitor::dump_instruction(backend_instruction *be_inst)
>     case UNIFORM:
>        printf("***u%d***", inst->dst.reg);
>        break;
> -   case ARF:
> -      if (inst->dst.reg == BRW_ARF_NULL)
> -         printf("(null)");
> -      else
> -         printf("arf%d", inst->dst.reg);
> -      break;
>     default:
>        printf("???");
>        break;
> diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h
> index b2aa041..ced099f 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs.h
> +++ b/src/mesa/drivers/dri/i965/brw_fs.h
> @@ -75,10 +75,10 @@ public:
>     bool is_one() const;
>     bool is_valid_3src() const;
>  
> -   /** Register file: ARF, GRF, MRF, IMM. */
> +   /** Register file: GRF, MRF, IMM. */
>     enum register_file file;
>     /**
> -    * Register number.  For ARF/MRF, it's the hardware register.  For
> +    * Register number.  For MRF, it's the hardware register.  For
>      * GRF, it's a virtual register number until register allocation
>      */
>     int reg;
> @@ -107,8 +107,8 @@ public:
>  };
>  
>  static const fs_reg reg_undef;
> -static const fs_reg reg_null_f(ARF, BRW_ARF_NULL, BRW_REGISTER_TYPE_F);
> -static const fs_reg reg_null_d(ARF, BRW_ARF_NULL, BRW_REGISTER_TYPE_D);
> +static const fs_reg reg_null_f(retype(brw_null_reg(), BRW_REGISTER_TYPE_F));
> +static const fs_reg reg_null_d(retype(brw_null_reg(), BRW_REGISTER_TYPE_D));
>  
>  class ip_record : public exec_node {
>  public:
> diff --git a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
> index 7ce42c4..8cd96c9 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
> @@ -845,8 +845,6 @@ fs_generator::generate_mov_dispatch_to_flags(fs_inst *inst)
>  static uint32_t brw_file_from_reg(fs_reg *reg)
>  {
>     switch (reg->file) {
> -   case ARF:
> -      return BRW_ARCHITECTURE_REGISTER_FILE;
>     case GRF:
>        return BRW_GENERAL_REGISTER_FILE;
>     case MRF:
> @@ -866,7 +864,6 @@ brw_reg_from_fs_reg(fs_reg *reg)
>  
>     switch (reg->file) {
>     case GRF:
> -   case ARF:
>     case MRF:
>        if (reg->smear == -1) {
>  	 brw_reg = brw_vec8_reg(brw_file_from_reg(reg), reg->reg, 0);
> diff --git a/src/mesa/drivers/dri/i965/brw_shader.h b/src/mesa/drivers/dri/i965/brw_shader.h
> index 55769ff..4dbd38d 100644
> --- a/src/mesa/drivers/dri/i965/brw_shader.h
> +++ b/src/mesa/drivers/dri/i965/brw_shader.h
> @@ -29,7 +29,6 @@
>  
>  enum register_file {
>     BAD_FILE,
> -   ARF,
>     GRF,
>     MRF,
>     IMM,
> diff --git a/src/mesa/drivers/dri/i965/brw_vec4.h b/src/mesa/drivers/dri/i965/brw_vec4.h
> index 689040b..0fac100 100644
> --- a/src/mesa/drivers/dri/i965/brw_vec4.h
> +++ b/src/mesa/drivers/dri/i965/brw_vec4.h
> @@ -97,7 +97,7 @@ swizzle_for_size(int size);
>  class reg
>  {
>  public:
> -   /** Register file: ARF, GRF, MRF, IMM. */
> +   /** Register file: GRF, MRF, IMM. */
>     enum register_file file;
>     /** virtual register number.  0 = fixed hw reg */
>     int reg;
> 

Looks good to me.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>


More information about the mesa-dev mailing list