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>
}
/* 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);
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;
}
# 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)
/* 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;
}