ir3: Use bitset range operations.
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

This sped up the debugoptimized compile of a fossil I was looking at by
7%.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37777>
This commit is contained in:
Emma Anholt 2025-10-07 17:57:30 -07:00 committed by Marge Bot
parent aa85e3331f
commit f8729ee920

View file

@ -3333,27 +3333,21 @@ static inline bool
__regmask_get(regmask_t *regmask, enum ir3_reg_file file, unsigned n, unsigned size)
{
BITSET_WORD *regs = __regmask_file(regmask, file);
for (unsigned i = 0; i < size; i++) {
if (BITSET_TEST(regs, n + i))
return true;
}
return false;
return BITSET_TEST_RANGE(regs, n, n + size - 1);
}
static inline void
__regmask_set(regmask_t *regmask, enum ir3_reg_file file, unsigned n, unsigned size)
{
BITSET_WORD *regs = __regmask_file(regmask, file);
for (unsigned i = 0; i < size; i++)
BITSET_SET(regs, n + i);
BITSET_SET_RANGE(regs, n, n + size - 1);
}
static inline void
__regmask_clear(regmask_t *regmask, enum ir3_reg_file file, unsigned n, unsigned size)
{
BITSET_WORD *regs = __regmask_file(regmask, file);
for (unsigned i = 0; i < size; i++)
BITSET_CLEAR(regs, n + i);
BITSET_CLEAR_RANGE(regs, n, n + size - 1);
}
static inline void