[Mesa-dev] [PATCH 1/2] r600: make condition clearer

Dieter Nützel Dieter at nuetzel-hh.de
Mon Mar 20 11:45:22 UTC 2017


Hello Constantine,

1/1
- rebase needed
- line wrap needed
apart from that:
Tested-by: Dieter Nützel <Dieter at nuetzel-hh.de>

1/2
Acked-by: Dieter Nützel <Dieter at nuetzel-hh.de>

@Marek:
There are several r600/r600g patches/fixes floating around.
I'll try to test all and who is responsible for them (r600g) and commit 
them later on?

Greetings,
Dieter

Am 19.03.2017 14:53, schrieb Constantine Kharlamov:
> The second check in the old code looked pretty much unreachable, esp.
> because it's not obvious that "max_entries" could be zero. To find out
> that it was intentional I had to run some checks, and to dig into
> the old versions of the file.
> 
> So, rewrite the check to make the intention clear.
> 
> Signed-off-by: Constantine Kharlamov <Hi-Angel at yandex.ru>
> ---
>  src/gallium/drivers/r600/r600_asm.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/src/gallium/drivers/r600/r600_asm.c
> b/src/gallium/drivers/r600/r600_asm.c
> index f85993d451..f8d6883551 100644
> --- a/src/gallium/drivers/r600/r600_asm.c
> +++ b/src/gallium/drivers/r600/r600_asm.c
> @@ -315,7 +315,7 @@ static int is_alu_any_unit_inst(struct
> r600_bytecode *bc, struct r600_bytecode_a
>  static int is_nop_inst(struct r600_bytecode *bc, struct 
> r600_bytecode_alu *alu)
>  {
>  	return alu->op == ALU_OP0_NOP;
> -}
> +}
> 
>  static int assign_alu_units(struct r600_bytecode *bc, struct
> r600_bytecode_alu *alu_first,
>  			    struct r600_bytecode_alu *assignment[5])
> @@ -1688,11 +1688,11 @@ int r600_bytecode_build(struct r600_bytecode 
> *bc)
>  	unsigned addr;
>  	int i, r;
> 
> -	if (!bc->nstack) // If not 0, Stack_size already provided by llvm
> -		bc->nstack = bc->stack.max_entries;
> -
> -	if ((bc->type == PIPE_SHADER_VERTEX || bc->type ==
> PIPE_SHADER_TESS_EVAL || bc->type == PIPE_SHADER_TESS_CTRL) &&
> !bc->nstack) {
> -		bc->nstack = 1;
> +	if (!bc->nstack) { // If not 0, Stack_size already provided by llvm
> +		if (bc->stack.max_entries)
> +			bc->nstack = bc->stack.max_entries;
> +		else if (bc->type == PIPE_SHADER_VERTEX || bc->type ==
> PIPE_SHADER_TESS_EVAL || bc->type == PIPE_SHADER_TESS_CTRL)
> +			bc->nstack = 1;
>  	}
> 
>  	/* first path compute addr of each CF block */


More information about the mesa-dev mailing list