[Mesa-dev] [Mesa-stable] [PATCH 3/3] st/glsl_to_tgsi: the second destination doesn't support relative addressing
Marek Olšák
maraeo at gmail.com
Tue Oct 10 18:18:27 UTC 2017
For the series:
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Marek
On Tue, Oct 10, 2017 at 2:11 PM, Nicolai Hähnle <nhaehnle at gmail.com> wrote:
> From: Nicolai Hähnle <nicolai.haehnle at amd.com>
>
> It's not used -- DFRACEXP gets array indexes of its exponent out-parameter
> lowered earlier -- and it wouldn't have worked correctly anyway when both
> dst and dst1 use relative addressing.
> ---
> src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> index 235690510b9..394d39ade63 100644
> --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> @@ -382,42 +382,39 @@ glsl_to_tgsi_visitor::emit_asm(ir_instruction *ir, unsigned op,
> int num_reladdr = 0, i, j;
> bool dst_is_64bit[2];
>
> op = get_opcode(op, dst, src0, src1);
>
> /* If we have to do relative addressing, we want to load the ARL
> * reg directly for one of the regs, and preload the other reladdr
> * sources into temps.
> */
> num_reladdr += dst.reladdr != NULL || dst.reladdr2;
> - num_reladdr += dst1.reladdr != NULL || dst1.reladdr2;
> + assert(!dst1.reladdr); /* should be lowered in earlier passes */
> num_reladdr += src0.reladdr != NULL || src0.reladdr2 != NULL;
> num_reladdr += src1.reladdr != NULL || src1.reladdr2 != NULL;
> num_reladdr += src2.reladdr != NULL || src2.reladdr2 != NULL;
> num_reladdr += src3.reladdr != NULL || src3.reladdr2 != NULL;
>
> reladdr_to_temp(ir, &src3, &num_reladdr);
> reladdr_to_temp(ir, &src2, &num_reladdr);
> reladdr_to_temp(ir, &src1, &num_reladdr);
> reladdr_to_temp(ir, &src0, &num_reladdr);
>
> if (dst.reladdr || dst.reladdr2) {
> if (dst.reladdr)
> emit_arl(ir, address_reg, *dst.reladdr);
> if (dst.reladdr2)
> emit_arl(ir, address_reg2, *dst.reladdr2);
> num_reladdr--;
> }
> - if (dst1.reladdr) {
> - emit_arl(ir, address_reg, *dst1.reladdr);
> - num_reladdr--;
> - }
> +
> assert(num_reladdr == 0);
>
> /* inst->op has only 8 bits. */
> STATIC_ASSERT(TGSI_OPCODE_LAST <= 255);
>
> inst->op = op;
> inst->precise = this->precise;
> inst->info = tgsi_get_opcode_info(op);
> inst->dst[0] = dst;
> inst->dst[1] = dst1;
> --
> 2.11.0
>
> _______________________________________________
> mesa-stable mailing list
> mesa-stable at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-stable
More information about the mesa-dev
mailing list