pan/bi: Add bi_spill helper

Generates STORE to TLS.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7206>
This commit is contained in:
Alyssa Rosenzweig
2020-10-14 19:26:58 -04:00
committed by Marge Bot
parent 171bf19917
commit 486a820bc6
+23
View File
@@ -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