pan/bi: Move bi_constant_field to bifrost.h

It's a hardware invariant, and useful for the scheduler (not just
packing).

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8354>
This commit is contained in:
Alyssa Rosenzweig 2021-02-05 18:12:59 -05:00 committed by Marge Bot
parent ee78628f78
commit 649e45234f
2 changed files with 15 additions and 11 deletions

View File

@ -86,17 +86,6 @@ bi_lookup_constant(bi_clause *clause, uint32_t cons, bool *hi)
unreachable("Invalid constant accessed");
}
static unsigned
bi_constant_field(unsigned idx)
{
assert(idx <= 5);
const unsigned values[] = {
4, 5, 6, 7, 2, 3
};
return values[idx] << 4;
}
static bool
bi_assign_fau_idx_single(bi_registers *regs,

View File

@ -28,6 +28,7 @@
#include <stdint.h>
#include <stdbool.h>
#include <assert.h>
#define BIFROST_DBG_MSGS 0x0001
#define BIFROST_DBG_SHADERS 0x0002
@ -602,4 +603,18 @@ struct bi_constants {
enum bi_constmod mods[6];
};
/* FAU selectors for constants are out-of-order, construct the top bits
* here given a embedded constant index in a clause */
static inline unsigned
bi_constant_field(unsigned idx)
{
const unsigned values[] = {
4, 5, 6, 7, 2, 3
};
assert(idx <= 5);
return values[idx] << 4;
}
#endif