agx: Require an immediate for nest

There's no good reason to allow non-immediate nesting values, and this lets us
use the (smaller) mov_imm instruction without special casing. This matches what
Metal produces, so it seems like a good preference.

   total bytes in shared programs: 11720338 -> 11717310 (-0.03%)
   bytes in affected programs: 2341580 -> 2338552 (-0.13%)
   helped: 1385
   HURT: 0
   Bytes are helped.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
This commit is contained in:
Alyssa Rosenzweig
2023-07-29 21:46:52 -04:00
committed by Marge Bot
parent 85d6f162ad
commit a30c668e44
3 changed files with 5 additions and 5 deletions

View File

@@ -1706,7 +1706,7 @@ agx_emit_jump(agx_builder *b, nir_jump_instr *instr)
}
/* Update the counter and flush */
agx_nest(b, agx_immediate(nestings));
agx_nest(b, nestings);
/* Jumps must come at the end of a block */
agx_emit_logical_end(b);
@@ -1960,7 +1960,7 @@ emit_first_cf(agx_context *ctx)
return;
agx_builder _b = agx_init_builder(ctx, agx_after_block(ctx->current_block));
agx_nest(&_b, agx_immediate(0));
agx_nest(&_b, 0);
ctx->any_cf = true;
}

View File

@@ -403,5 +403,5 @@ op("unit_test", _, dests = 0, srcs = 1, can_eliminate = False)
# to be coalesced during RA, rather than lowered to a real move.
op("preload", _, srcs = 1)
# Set the nesting counter. Lowers to mov r0l, x after RA.
op("nest", _, dests = 0, srcs = 1, can_eliminate = False)
# Set the nesting counter. Lowers to mov_imm r0l, #nest after RA.
op("nest", _, dests = 0, imms = [IMM], can_eliminate = False)

View File

@@ -1243,7 +1243,7 @@ agx_ra(agx_context *ctx)
/* Writes to the nesting counter lowered to the real register */
case AGX_OPCODE_NEST: {
agx_builder b = agx_init_builder(ctx, agx_before_instr(I));
agx_mov_to(&b, agx_register(0, AGX_SIZE_16), I->src[0]);
agx_mov_imm_to(&b, agx_register(0, AGX_SIZE_16), I->imm);
agx_remove_instruction(I);
break;
}