diff options
author | Rob Clark <[email protected]> | 2020-06-12 20:42:36 -0700 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-06-18 02:46:28 +0000 |
commit | 47decc88c2b442e6c52c77b3bde8bd90acc61bbb (patch) | |
tree | fa79934938da1c9b927d2fb86203f558d9a7ece2 /src/freedreno/ir3/ir3.h | |
parent | 46cdcf590b8ca384015cfb55f15a98a87872f3e8 (diff) |
freedreno/ir3: move mergedreg state out of reg
It is only needed one place, let's move it there.
Signed-off-by: Rob Clark <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5458>
Diffstat (limited to 'src/freedreno/ir3/ir3.h')
-rw-r--r-- | src/freedreno/ir3/ir3.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/freedreno/ir3/ir3.h b/src/freedreno/ir3/ir3.h index b191c0af44c..d3e4a988dd9 100644 --- a/src/freedreno/ir3/ir3.h +++ b/src/freedreno/ir3/ir3.h @@ -121,9 +121,7 @@ struct ir3_register { * Note the size field isn't important for relative const (since * we don't have to do register allocation for constants). */ - unsigned size : 15; - - bool merged : 1; /* half-regs conflict with full regs (ie >= a6xx) */ + unsigned size : 16; /* normal registers: * the component is in the low two bits of the reg #, so @@ -1763,13 +1761,14 @@ INSTR0(META_TEX_PREFETCH); typedef BITSET_DECLARE(regmaskstate_t, 2 * MAX_REG); typedef struct { + bool mergedregs; regmaskstate_t mask; } regmask_t; static inline bool __regmask_get(regmask_t *regmask, struct ir3_register *reg, unsigned n) { - if (reg->merged) { + if (regmask->mergedregs) { /* a6xx+ case, with merged register file, we track things in terms * of half-precision registers, with a full precisions register * using two half-precision slots: @@ -1794,7 +1793,7 @@ __regmask_get(regmask_t *regmask, struct ir3_register *reg, unsigned n) static inline void __regmask_set(regmask_t *regmask, struct ir3_register *reg, unsigned n) { - if (reg->merged) { + if (regmask->mergedregs) { /* a6xx+ case, with merged register file, we track things in terms * of half-precision registers, with a full precisions register * using two half-precision slots: @@ -1816,9 +1815,10 @@ __regmask_set(regmask_t *regmask, struct ir3_register *reg, unsigned n) } } -static inline void regmask_init(regmask_t *regmask) +static inline void regmask_init(regmask_t *regmask, bool mergedregs) { - memset(regmask, 0, sizeof(*regmask)); + memset(®mask->mask, 0, sizeof(regmask->mask)); + regmask->mergedregs = mergedregs; } static inline void regmask_set(regmask_t *regmask, struct ir3_register *reg) @@ -1835,6 +1835,9 @@ static inline void regmask_set(regmask_t *regmask, struct ir3_register *reg) static inline void regmask_or(regmask_t *dst, regmask_t *a, regmask_t *b) { + assert(dst->mergedregs == a->mergedregs); + assert(dst->mergedregs == b->mergedregs); + for (unsigned i = 0; i < ARRAY_SIZE(dst->mask); i++) dst->mask[i] = a->mask[i] | b->mask[i]; } |