nir, asahi: commonize interleave_agx

Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36412>
This commit is contained in:
Simon Perretta 2025-07-30 17:07:15 +01:00 committed by Marge Bot
parent 664ab228da
commit 672541d036
6 changed files with 6 additions and 6 deletions

View file

@ -1894,7 +1894,7 @@ agx_emit_alu(agx_builder *b, nir_alu_instr *instr)
BINOP(iand, and);
BINOP(ior, or);
BINOP(ixor, xor);
BINOP(interleave_agx, intl);
BINOP(interleave, intl);
case nir_op_fadd:
if (instr->def.bit_size == 16)

View file

@ -169,7 +169,7 @@ alu_cost(nir_alu_instr *alu)
case nir_op_u2fmp:
case nir_op_u2f16:
case nir_op_u2f32:
case nir_op_interleave_agx:
case nir_op_interleave:
/* IC */
return 4.0;

View file

@ -43,7 +43,7 @@ index_metadata(uint3 c, uint width, uint height, uint layer_stride)
uint intl_mask = (1 << intl_bits) - 1;
uint2 intl_coords = c.xy & intl_mask;
return nir_interleave_agx(intl_coords.x, intl_coords.y) +
return nir_interleave(intl_coords.x, intl_coords.y) +
((major_coord & ~intl_mask) << intl_bits) + (layer_stride * c.z);
}

View file

@ -7,7 +7,7 @@
#include "compiler/libcl/libcl.h"
uint32_t nir_interleave_agx(uint16_t x, uint16_t y);
uint32_t nir_interleave(uint16_t x, uint16_t y);
void nir_doorbell_agx(uint8_t value);
void nir_stack_map_agx(uint16_t index, uint32_t address);
uint32_t nir_stack_unmap_agx(uint16_t index);

View file

@ -133,7 +133,7 @@ libagx_twiddle_coordinates(ushort2 coord, uint16_t tile_w_px,
uint32_t tile_mask = upsample(tile_mask_vec.y, tile_mask_vec.x);
uint32_t coord_xy = upsample(coord.y, coord.x);
ushort2 offs_px = as_ushort2(coord_xy & tile_mask);
uint32_t offset_within_tile_px = nir_interleave_agx(offs_px.x, offs_px.y);
uint32_t offset_within_tile_px = nir_interleave(offs_px.x, offs_px.y);
/* Get the coordinates of the corner of the tile */
ushort2 tile_px = as_ushort2(coord_xy & ~tile_mask);

View file

@ -1415,7 +1415,7 @@ opcode("bounds_agx", 0, tint, [0, 0, 0],
[tint, tint, tint], False,
"", "src1 <= src2 ? src0 : 0")
binop_convert("interleave_agx", tuint32, tuint16, "", """
binop_convert("interleave", tuint32, tuint16, "", """
dst = 0;
for (unsigned bit = 0; bit < 16; bit++) {
dst |= (src0 & (1 << bit)) << bit;