From 486a820bc675a84546cbc88e24637d9a9edc789b Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Wed, 14 Oct 2020 19:26:58 -0400 Subject: [PATCH] pan/bi: Add bi_spill helper Generates STORE to TLS. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/bi_ra.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/panfrost/bifrost/bi_ra.c b/src/panfrost/bifrost/bi_ra.c index e488f53ed25..f45e21ee7ae 100644 --- a/src/panfrost/bifrost/bi_ra.c +++ b/src/panfrost/bifrost/bi_ra.c @@ -174,6 +174,29 @@ bi_install_registers(bi_context *ctx, struct lcra_state *l) } } +static bi_instruction +bi_spill(unsigned node, uint64_t offset, unsigned channels) +{ + bi_instruction store = { + .type = BI_STORE, + .segment = BI_SEGMENT_TLS, + .vector_channels = channels, + .src = { + node, + BIR_INDEX_CONSTANT, + BIR_INDEX_CONSTANT | 32, + }, + .src_types = { + nir_type_uint32, + nir_type_uint32, + nir_type_uint32 + }, + .constant = { .u64 = offset }, + }; + + return store; +} + /* If register allocation fails, find the best spill node */ static signed