agx: Hook up helper intrinsics into CL

So we can use these intrinsicts from libagx.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616>
This commit is contained in:
Asahi Lina 2023-11-08 15:40:16 +09:00 committed by Marge Bot
parent 30862d7189
commit 05c8b59f5b
2 changed files with 24 additions and 0 deletions

View file

@ -91,6 +91,26 @@ lower_builtins(nir_builder *b, nir_instr *instr, void *data)
nir_store_deref(b, nir_src_as_deref(call->params[0]),
nir_stack_unmap_agx(b, call->params[1].ssa), 1);
return true;
} else if (strcmp(func->name, "nir_load_core_id_agx") == 0) {
b->cursor = nir_instr_remove(&call->instr);
nir_store_deref(b, nir_src_as_deref(call->params[0]),
nir_load_core_id_agx(b), 1);
return true;
} else if (strcmp(func->name, "nir_load_helper_op_id_agx") == 0) {
b->cursor = nir_instr_remove(&call->instr);
nir_store_deref(b, nir_src_as_deref(call->params[0]),
nir_load_helper_op_id_agx(b, 1, 32), 1);
return true;
} else if (strcmp(func->name, "nir_load_helper_arg_lo_agx") == 0) {
b->cursor = nir_instr_remove(&call->instr);
nir_store_deref(b, nir_src_as_deref(call->params[0]),
nir_load_helper_arg_lo_agx(b, 1, 32), 1);
return true;
} else if (strcmp(func->name, "nir_load_helper_arg_hi_agx") == 0) {
b->cursor = nir_instr_remove(&call->instr);
nir_store_deref(b, nir_src_as_deref(call->params[0]),
nir_load_helper_arg_hi_agx(b, 1, 32), 1);
return true;
}
return false;

View file

@ -27,6 +27,10 @@ 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);
uint32_t nir_load_core_id_agx(void);
uint32_t nir_load_helper_op_id_agx(void);
uint32_t nir_load_helper_arg_lo_agx(void);
uint32_t nir_load_helper_arg_hi_agx(void);
#endif