mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-28 12:30:09 +01:00
pan/bi: Add Valhall-specific zero builder
When emitting code during or after register allocation, we need to be able to
emit constants without running the constant->{LUT, move, uniform} pass running
after. In particular, we need to access the constant 0 to implement spill code.
Add a Valhall-specific zero for this purpose.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>
This commit is contained in:
parent
666b714a37
commit
38625af010
1 changed files with 25 additions and 0 deletions
|
|
@ -790,6 +790,31 @@ bi_fau(enum bir_fau value, bool hi)
|
|||
};
|
||||
}
|
||||
|
||||
/*
|
||||
* Builder for Valhall LUT entries. Generally, constants are modeled with
|
||||
* BI_INDEX_IMMEDIATE in the intermediate representation. This helper is only
|
||||
* necessary for passes running after lowering constants, as well as when
|
||||
* lowering constants.
|
||||
*
|
||||
*/
|
||||
static inline bi_index
|
||||
va_lut(unsigned index)
|
||||
{
|
||||
return bi_fau((enum bir_fau) (BIR_FAU_IMMEDIATE | (index >> 1)),
|
||||
index & 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* va_lut_zero is like bi_zero but only works on Valhall. It is intended for
|
||||
* use by late passes that run after constants are lowered, specifically
|
||||
* register allocation. bi_zero() is preferred where possible.
|
||||
*/
|
||||
static inline bi_index
|
||||
va_zero_lut()
|
||||
{
|
||||
return va_lut(0);
|
||||
}
|
||||
|
||||
static inline unsigned
|
||||
bi_max_temp(bi_context *ctx)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue