Re: [Mesa-dev] [PATCH 1/2] r600g: Avoid duplicated initialization of TGSI_OPCODE_DFMA

2016-08-28 Thread Rhys Kidd
On Saturday, August 27, 2016, Jan Vesely  wrote:

> On Sat, 2016-08-27 at 12:05 -0400, Rhys Kidd wrote:
> > As reported by Clang, TGSI_OPCODE_DFMA (defined magic number 118) is
> > currently initialized twice for Cayman and Evergreen.
> > When Jan Vesely added double precision FMA opcode it did make sense
> > to locate it immediately after TGSI_OPCODE_DMAD, although this is
> > out of order.
> >
> > This change cleans up the prior magic number definition and ensures
> > any later reordering of this struct will not create problems.
> >
> > Prior change was:
> >
> >   commit 015e2e0fce3eea7884f8df275c2fadc35143a324
> >   Author: Jan Vesely >
> >   Date:   Sat Jul 2 16:14:54 2016 -0400
> >
> >   r600g: Add double precision FMA ops
> >
> >   Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96782
> >   Fixes: 54c4d525da7c7fc1e103d7a3e6db015abb132d5d ("r600g: Enable
> > FMA on chips that support it")
> >
> >   Signed-off-by: Jan Vesely >
> >   Tested-by: James Harvey >
> >   Signed-off-by: Marek Olšák >
> >
> > Signed-off-by: Rhys Kidd >
>
> So much for using magic numbers.
> Reviewed-by: Jan Vesely >
>
> thanks,
> Jan


Thanks for reviewing Jan.


>
> > ---
> >  src/gallium/drivers/r600/r600_shader.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/src/gallium/drivers/r600/r600_shader.c
> > b/src/gallium/drivers/r600/r600_shader.c
> > index 64aacca..a39301f 100644
> > --- a/src/gallium/drivers/r600/r600_shader.c
> > +++ b/src/gallium/drivers/r600/r600_shader.c
> > @@ -9210,7 +9210,7 @@ static const struct
> > r600_shader_tgsi_instruction eg_shader_tgsi_instruction[] =
> >   [TGSI_OPCODE_BREAKC]= { ALU_OP0_NOP,
> > tgsi_unsupported},
> >   [TGSI_OPCODE_KILL_IF]   = { ALU_OP2_KILLGT,
> > tgsi_kill},  /* conditional kill */
> >   [TGSI_OPCODE_END]   = { ALU_OP0_NOP, tgsi_end},  /* aka
> > HALT */
> > - [118]   = { ALU_OP0_NOP,
> > tgsi_unsupported},
> > + /* Refer below for TGSI_OPCODE_DFMA */
> >   [TGSI_OPCODE_F2I]   = { ALU_OP1_FLT_TO_INT, tgsi_f2i},
> >   [TGSI_OPCODE_IDIV]  = { ALU_OP0_NOP, tgsi_idiv},
> >   [TGSI_OPCODE_IMAX]  = { ALU_OP2_MAX_INT, tgsi_op2},
> > @@ -9433,7 +9433,7 @@ static const struct
> > r600_shader_tgsi_instruction cm_shader_tgsi_instruction[] =
> >   [TGSI_OPCODE_BREAKC]= { ALU_OP0_NOP,
> > tgsi_unsupported},
> >   [TGSI_OPCODE_KILL_IF]   = { ALU_OP2_KILLGT,
> > tgsi_kill},  /* conditional kill */
> >   [TGSI_OPCODE_END]   = { ALU_OP0_NOP, tgsi_end},  /* aka
> > HALT */
> > - [118]   = { ALU_OP0_NOP,
> > tgsi_unsupported},
> > + /* Refer below for TGSI_OPCODE_DFMA */
> >   [TGSI_OPCODE_F2I]   = { ALU_OP1_FLT_TO_INT, tgsi_op2},
> >   [TGSI_OPCODE_IDIV]  = { ALU_OP0_NOP, tgsi_idiv},
> >   [TGSI_OPCODE_IMAX]  = { ALU_OP2_MAX_INT, tgsi_op2},
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 1/2] r600g: Avoid duplicated initialization of TGSI_OPCODE_DFMA

2016-08-27 Thread Jan Vesely
On Sat, 2016-08-27 at 12:05 -0400, Rhys Kidd wrote:
> As reported by Clang, TGSI_OPCODE_DFMA (defined magic number 118) is
> currently initialized twice for Cayman and Evergreen.
> When Jan Vesely added double precision FMA opcode it did make sense
> to locate it immediately after TGSI_OPCODE_DMAD, although this is
> out of order.
> 
> This change cleans up the prior magic number definition and ensures
> any later reordering of this struct will not create problems.
> 
> Prior change was:
> 
>   commit 015e2e0fce3eea7884f8df275c2fadc35143a324
>   Author: Jan Vesely 
>   Date:   Sat Jul 2 16:14:54 2016 -0400
> 
>   r600g: Add double precision FMA ops
> 
>   Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96782
>   Fixes: 54c4d525da7c7fc1e103d7a3e6db015abb132d5d ("r600g: Enable
> FMA on chips that support it")
> 
>   Signed-off-by: Jan Vesely 
>   Tested-by: James Harvey 
>   Signed-off-by: Marek Olšák 
> 
> Signed-off-by: Rhys Kidd 

So much for using magic numbers.
Reviewed-by: Jan Vesely 

thanks,
Jan

> ---
>  src/gallium/drivers/r600/r600_shader.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/gallium/drivers/r600/r600_shader.c
> b/src/gallium/drivers/r600/r600_shader.c
> index 64aacca..a39301f 100644
> --- a/src/gallium/drivers/r600/r600_shader.c
> +++ b/src/gallium/drivers/r600/r600_shader.c
> @@ -9210,7 +9210,7 @@ static const struct
> r600_shader_tgsi_instruction eg_shader_tgsi_instruction[] =
>   [TGSI_OPCODE_BREAKC]= { ALU_OP0_NOP,
> tgsi_unsupported},
>   [TGSI_OPCODE_KILL_IF]   = { ALU_OP2_KILLGT,
> tgsi_kill},  /* conditional kill */
>   [TGSI_OPCODE_END]   = { ALU_OP0_NOP, tgsi_end},  /* aka
> HALT */
> - [118]   = { ALU_OP0_NOP,
> tgsi_unsupported},
> + /* Refer below for TGSI_OPCODE_DFMA */
>   [TGSI_OPCODE_F2I]   = { ALU_OP1_FLT_TO_INT, tgsi_f2i},
>   [TGSI_OPCODE_IDIV]  = { ALU_OP0_NOP, tgsi_idiv},
>   [TGSI_OPCODE_IMAX]  = { ALU_OP2_MAX_INT, tgsi_op2},
> @@ -9433,7 +9433,7 @@ static const struct
> r600_shader_tgsi_instruction cm_shader_tgsi_instruction[] =
>   [TGSI_OPCODE_BREAKC]= { ALU_OP0_NOP,
> tgsi_unsupported},
>   [TGSI_OPCODE_KILL_IF]   = { ALU_OP2_KILLGT,
> tgsi_kill},  /* conditional kill */
>   [TGSI_OPCODE_END]   = { ALU_OP0_NOP, tgsi_end},  /* aka
> HALT */
> - [118]   = { ALU_OP0_NOP,
> tgsi_unsupported},
> + /* Refer below for TGSI_OPCODE_DFMA */
>   [TGSI_OPCODE_F2I]   = { ALU_OP1_FLT_TO_INT, tgsi_op2},
>   [TGSI_OPCODE_IDIV]  = { ALU_OP0_NOP, tgsi_idiv},
>   [TGSI_OPCODE_IMAX]  = { ALU_OP2_MAX_INT, tgsi_op2},


signature.asc
Description: This is a digitally signed message part
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 1/2] r600g: Avoid duplicated initialization of TGSI_OPCODE_DFMA

2016-08-27 Thread Rhys Kidd
As reported by Clang, TGSI_OPCODE_DFMA (defined magic number 118) is
currently initialized twice for Cayman and Evergreen.

When Jan Vesely added double precision FMA opcode it did make sense
to locate it immediately after TGSI_OPCODE_DMAD, although this is
out of order.

This change cleans up the prior magic number definition and ensures
any later reordering of this struct will not create problems.

Prior change was:

  commit 015e2e0fce3eea7884f8df275c2fadc35143a324
  Author: Jan Vesely 
  Date:   Sat Jul 2 16:14:54 2016 -0400

  r600g: Add double precision FMA ops

  Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96782
  Fixes: 54c4d525da7c7fc1e103d7a3e6db015abb132d5d ("r600g: Enable FMA on 
chips that support it")

  Signed-off-by: Jan Vesely 
  Tested-by: James Harvey 
  Signed-off-by: Marek Olšák 

Signed-off-by: Rhys Kidd 
---
 src/gallium/drivers/r600/r600_shader.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_shader.c 
b/src/gallium/drivers/r600/r600_shader.c
index 64aacca..a39301f 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -9210,7 +9210,7 @@ static const struct r600_shader_tgsi_instruction 
eg_shader_tgsi_instruction[] =
[TGSI_OPCODE_BREAKC]= { ALU_OP0_NOP, tgsi_unsupported},
[TGSI_OPCODE_KILL_IF]   = { ALU_OP2_KILLGT, tgsi_kill},  /* conditional 
kill */
[TGSI_OPCODE_END]   = { ALU_OP0_NOP, tgsi_end},  /* aka HALT */
-   [118]   = { ALU_OP0_NOP, tgsi_unsupported},
+   /* Refer below for TGSI_OPCODE_DFMA */
[TGSI_OPCODE_F2I]   = { ALU_OP1_FLT_TO_INT, tgsi_f2i},
[TGSI_OPCODE_IDIV]  = { ALU_OP0_NOP, tgsi_idiv},
[TGSI_OPCODE_IMAX]  = { ALU_OP2_MAX_INT, tgsi_op2},
@@ -9433,7 +9433,7 @@ static const struct r600_shader_tgsi_instruction 
cm_shader_tgsi_instruction[] =
[TGSI_OPCODE_BREAKC]= { ALU_OP0_NOP, tgsi_unsupported},
[TGSI_OPCODE_KILL_IF]   = { ALU_OP2_KILLGT, tgsi_kill},  /* conditional 
kill */
[TGSI_OPCODE_END]   = { ALU_OP0_NOP, tgsi_end},  /* aka HALT */
-   [118]   = { ALU_OP0_NOP, tgsi_unsupported},
+   /* Refer below for TGSI_OPCODE_DFMA */
[TGSI_OPCODE_F2I]   = { ALU_OP1_FLT_TO_INT, tgsi_op2},
[TGSI_OPCODE_IDIV]  = { ALU_OP0_NOP, tgsi_idiv},
[TGSI_OPCODE_IMAX]  = { ALU_OP2_MAX_INT, tgsi_op2},
-- 
2.7.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev