rename RegisterMask to BoundedRegisterMask

This commit is contained in:
Joshua Warner 2014-12-04 15:18:54 -07:00
parent 1110d3ff50
commit f187361889
3 changed files with 10 additions and 10 deletions

View File

@ -16,7 +16,7 @@
namespace avian { namespace avian {
namespace codegen { namespace codegen {
class RegisterMask { class BoundedRegisterMask {
public: public:
uint32_t mask; uint32_t mask;
uint8_t start; uint8_t start;
@ -25,7 +25,7 @@ class RegisterMask {
static unsigned maskStart(uint32_t mask); static unsigned maskStart(uint32_t mask);
static unsigned maskLimit(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)) : mask(mask), start(maskStart(mask)), limit(maskLimit(mask))
{ {
} }
@ -33,9 +33,9 @@ class RegisterMask {
class RegisterFile { class RegisterFile {
public: public:
RegisterMask allRegisters; BoundedRegisterMask allRegisters;
RegisterMask generalRegisters; BoundedRegisterMask generalRegisters;
RegisterMask floatRegisters; BoundedRegisterMask floatRegisters;
inline RegisterFile(uint32_t generalRegisterMask, uint32_t floatRegisterMask) inline RegisterFile(uint32_t generalRegisterMask, uint32_t floatRegisterMask)
: allRegisters(generalRegisterMask | floatRegisterMask), : allRegisters(generalRegisterMask | floatRegisterMask),
@ -48,9 +48,9 @@ class RegisterFile {
class RegisterIterator { class RegisterIterator {
public: public:
int index; int index;
const RegisterMask& mask; const BoundedRegisterMask& mask;
inline RegisterIterator(const RegisterMask& mask) inline RegisterIterator(const BoundedRegisterMask& mask)
: index(mask.start), mask(mask) : index(mask.start), mask(mask)
{ {
} }

View File

@ -13,7 +13,7 @@
namespace avian { namespace avian {
namespace codegen { namespace codegen {
unsigned RegisterMask::maskStart(uint32_t mask) unsigned BoundedRegisterMask::maskStart(uint32_t mask)
{ {
for (int i = 0; i <= 31; ++i) { for (int i = 0; i <= 31; ++i) {
if (mask & (1 << i)) if (mask & (1 << i))
@ -22,7 +22,7 @@ unsigned RegisterMask::maskStart(uint32_t mask)
return 32; return 32;
} }
unsigned RegisterMask::maskLimit(uint32_t mask) unsigned BoundedRegisterMask::maskLimit(uint32_t mask)
{ {
for (int i = 31; i >= 0; --i) { for (int i = 31; i >= 0; --i) {
if (mask & (1 << i)) if (mask & (1 << i))

View File

@ -19,7 +19,7 @@ using namespace vm;
TEST(RegisterIterator) TEST(RegisterIterator)
{ {
RegisterMask regs(0x55); BoundedRegisterMask regs(0x55);
assertEqual<unsigned>(0, regs.start); assertEqual<unsigned>(0, regs.start);
assertEqual<unsigned>(7, regs.limit); assertEqual<unsigned>(7, regs.limit);