-/* split this out or find some helper to use.. like main/bitset.h.. */
-
-#include <string.h>
-#include "util/bitset.h"
-
-#define MAX_REG 256
-
-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 (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:
- */
- if (reg->flags & IR3_REG_HALF) {
- return BITSET_TEST(regmask->mask, n);
- } else {
- n *= 2;
- return BITSET_TEST(regmask->mask, n) ||
- BITSET_TEST(regmask->mask, n+1);
- }
- } else {
- /* pre a6xx case, with separate register file for half and full
- * precision:
- */
- if (reg->flags & IR3_REG_HALF)
- n += MAX_REG;
- return BITSET_TEST(regmask->mask, n);
- }
-}
-
-static inline void
-__regmask_set(regmask_t *regmask, struct ir3_register *reg, unsigned n)
-{
- 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:
- */
- if (reg->flags & IR3_REG_HALF) {
- BITSET_SET(regmask->mask, n);
- } else {
- n *= 2;
- BITSET_SET(regmask->mask, n);
- BITSET_SET(regmask->mask, n+1);
- }
- } else {
- /* pre a6xx case, with separate register file for half and full
- * precision:
- */
- if (reg->flags & IR3_REG_HALF)
- n += MAX_REG;
- BITSET_SET(regmask->mask, n);
- }
-}
-
-static inline void regmask_init(regmask_t *regmask, bool mergedregs)
-{
- memset(®mask->mask, 0, sizeof(regmask->mask));
- regmask->mergedregs = mergedregs;
-}