-/* 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(regmask_t, 2 * MAX_REG);
-
-static inline bool
-__regmask_get(regmask_t *regmask, struct ir3_register *reg, unsigned n)
-{
- if (reg->merged) {
- /* 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, n);
- } else {
- n *= 2;
- return BITSET_TEST(*regmask, n) || BITSET_TEST(*regmask, 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, n);
- }
-}
-
-static inline void
-__regmask_set(regmask_t *regmask, struct ir3_register *reg, unsigned n)
-{
- if (reg->merged) {
- /* 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, n);
- } else {
- n *= 2;
- BITSET_SET(*regmask, n);
- BITSET_SET(*regmask, 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, n);
- }
-}
-
-static inline void regmask_init(regmask_t *regmask)
-{
- memset(regmask, 0, sizeof(*regmask));
-}