Location pick(RegisterMask& alloc, RegisterMask mask) { Unimplemented(); unsigned r = mask & ~alloc; if (r == 0) return unAllocated; for (int reg = 0; ! isSet(r, 0); reg ++, r >>= 1) ; setNth(alloc, reg); // return Location(ireg, reg); /// fix this return Location(); }
void RegisterState::allocatePermanent(Location r) { if (isRegister(r)) { ::allocateRegister(permanent, r); } else if (is_StackLocation(r)) { setNth(stackPerms[whichMask(r)], whichBit(r)); } else { // extra incoming arg etc -- ignore } allocate(r); }
void RegisterState::allocate(Location r) { if (isRegister(r)) { ::allocateRegister(allocated, r); } else if (is_StackLocation(r)) { assert(!isSet(stackAllocs[whichMask(r)], whichBit(r)), "already allocated"); setNth(stackAllocs[whichMask(r)], whichBit(r)); fint tempNo = index_for_StackLocation(r) + 1; if (tempNo >= stackDepth) stackDepth = tempNo; curDepth++; assert(curDepth <= stackDepth, "curDepth too big"); } }
void RegisterState::allocate(Location r) { if (isRegister(r)) { ::allocateRegister(allocated, r); // allocate nonvols down from R31, must save/restore them, so track depth _number_of_saved_nonvolatile_registers = max(_number_of_saved_nonvolatile_registers, 32 - r); } else if (is_StackLocation(r)) { assert(!isSet(stackAllocs[whichMask(r)], whichBit(r)), "already allocated"); setNth(stackAllocs[whichMask(r)], whichBit(r)); fint tempNo = index_for_StackLocation(r) + 1; if (tempNo >= stackDepth) stackDepth = tempNo; curDepth++; assert(curDepth <= stackDepth, "curDepth too big"); } }