pan/cs: Return the dump region size when an exception handler is defined

Useful to reserve only what we need for spilling regs.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32353>
This commit is contained in:
Boris Brezillon 2024-11-20 14:23:12 +01:00 committed by Marge Bot
parent cafec54c79
commit d0cff9e4c1

View file

@ -1682,6 +1682,7 @@ struct cs_exception_handler {
struct cs_block block;
struct cs_dirty_tracker dirty;
struct cs_exception_handler_ctx ctx;
unsigned dump_size;
};
static inline struct cs_exception_handler *
@ -1754,6 +1755,8 @@ cs_exception_handler_end(struct cs_builder *b,
last = pos + range;
}
handler->dump_size = BITSET_COUNT(handler->dirty.regs) * sizeof(uint32_t);
/* Make sure the current chunk is able to accommodate the block
* instructions as well as the preamble and postamble.
* Adding 4 instructions (2x wait_slot and the move for the address) as