diff --git a/include/avian/codegen/registers.h b/include/avian/codegen/registers.h index f152084605..b5f58c3111 100644 --- a/include/avian/codegen/registers.h +++ b/include/avian/codegen/registers.h @@ -16,7 +16,7 @@ namespace avian { namespace codegen { -class RegisterMask { +class BoundedRegisterMask { public: uint32_t mask; uint8_t start; @@ -25,7 +25,7 @@ class RegisterMask { static unsigned maskStart(uint32_t mask); static unsigned maskLimit(uint32_t mask); - inline RegisterMask(uint32_t mask) + inline BoundedRegisterMask(uint32_t mask) : mask(mask), start(maskStart(mask)), limit(maskLimit(mask)) { } @@ -33,9 +33,9 @@ class RegisterMask { class RegisterFile { public: - RegisterMask allRegisters; - RegisterMask generalRegisters; - RegisterMask floatRegisters; + BoundedRegisterMask allRegisters; + BoundedRegisterMask generalRegisters; + BoundedRegisterMask floatRegisters; inline RegisterFile(uint32_t generalRegisterMask, uint32_t floatRegisterMask) : allRegisters(generalRegisterMask | floatRegisterMask), @@ -48,9 +48,9 @@ class RegisterFile { class RegisterIterator { public: int index; - const RegisterMask& mask; + const BoundedRegisterMask& mask; - inline RegisterIterator(const RegisterMask& mask) + inline RegisterIterator(const BoundedRegisterMask& mask) : index(mask.start), mask(mask) { } diff --git a/src/codegen/registers.cpp b/src/codegen/registers.cpp index 0f13f56244..0404670f37 100644 --- a/src/codegen/registers.cpp +++ b/src/codegen/registers.cpp @@ -13,7 +13,7 @@ namespace avian { namespace codegen { -unsigned RegisterMask::maskStart(uint32_t mask) +unsigned BoundedRegisterMask::maskStart(uint32_t mask) { for (int i = 0; i <= 31; ++i) { if (mask & (1 << i)) @@ -22,7 +22,7 @@ unsigned RegisterMask::maskStart(uint32_t mask) return 32; } -unsigned RegisterMask::maskLimit(uint32_t mask) +unsigned BoundedRegisterMask::maskLimit(uint32_t mask) { for (int i = 31; i >= 0; --i) { if (mask & (1 << i)) diff --git a/unittest/codegen/registers-test.cpp b/unittest/codegen/registers-test.cpp index f565e813d7..392fc8e26e 100644 --- a/unittest/codegen/registers-test.cpp +++ b/unittest/codegen/registers-test.cpp @@ -19,7 +19,7 @@ using namespace vm; TEST(RegisterIterator) { - RegisterMask regs(0x55); + BoundedRegisterMask regs(0x55); assertEqual(0, regs.start); assertEqual(7, regs.limit);