asahi: clc: Handle doorbell and stack mapping intrinsics

Also move nir_interleave_agx definition to libagx.h

Signed-off-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
This commit is contained in:
Mary Guillemard 2023-10-27 17:30:04 +02:00 committed by Marge Bot
parent 514d432e50
commit bc8232c4a2
3 changed files with 20 additions and 2 deletions

View file

@ -79,6 +79,19 @@ lower_builtins(nir_builder *b, nir_instr *instr, void *data)
nir_interleave_agx(b, call->params[1].ssa, call->params[2].ssa), 1);
return true;
} else if (strcmp(func->name, "nir_doorbell_agx") == 0) {
b->cursor = nir_instr_remove(&call->instr);
nir_doorbell_agx(b, call->params[0].ssa);
return true;
} else if (strcmp(func->name, "nir_stack_map_agx") == 0) {
b->cursor = nir_instr_remove(&call->instr);
nir_stack_map_agx(b, call->params[0].ssa, call->params[1].ssa);
return true;
} else if (strcmp(func->name, "nir_stack_unmap_agx") == 0) {
b->cursor = nir_instr_remove(&call->instr);
nir_store_deref(b, nir_src_as_deref(call->params[0]),
nir_stack_unmap_agx(b, call->params[1].ssa), 1);
return true;
}
return false;

View file

@ -19,6 +19,13 @@ typedef long int64_t;
typedef int int32_t;
typedef short int16_t;
typedef int int8_t;
/* Define NIR intrinsics for CL */
uint32_t nir_interleave_agx(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);
#endif
#endif

View file

@ -6,8 +6,6 @@
#include "libagx.h"
#include <agx_pack.h>
uint32_t nir_interleave_agx(uint16_t x, uint16_t y);
uint3
libagx_txs(constant struct agx_texture_packed *ptr, uint16_t lod,
unsigned nr_comps, bool is_buffer, bool is_1d, bool is_2d,