free_list.cc revision 1060
12623SN/A#include "cpu/beta_cpu/free_list.hh" 22623SN/A 32623SN/ASimpleFreeList::SimpleFreeList(unsigned _numLogicalIntRegs, 42623SN/A unsigned _numPhysicalIntRegs, 52623SN/A unsigned _numLogicalFloatRegs, 62623SN/A unsigned _numPhysicalFloatRegs) 72623SN/A : numLogicalIntRegs(_numLogicalIntRegs), 82623SN/A numPhysicalIntRegs(_numPhysicalIntRegs), 92623SN/A numLogicalFloatRegs(_numLogicalFloatRegs), 102623SN/A numPhysicalFloatRegs(_numPhysicalFloatRegs), 112623SN/A numPhysicalRegs(numPhysicalIntRegs + numPhysicalFloatRegs) 122623SN/A{ 132623SN/A 142623SN/A // Put all of the extra physical registers onto the free list. This 152623SN/A // means excluding all of the base logical registers. 162623SN/A for (PhysRegIndex i = numLogicalIntRegs; 172623SN/A i < numPhysicalIntRegs; ++i) 182623SN/A { 192623SN/A freeIntRegs.push(i); 202623SN/A } 212623SN/A 222623SN/A // Put all of the extra physical registers onto the free list. This 232623SN/A // means excluding all of the base logical registers. Because the 242623SN/A // float registers' indices start where the physical registers end, 252623SN/A // some math must be done to determine where the free registers start. 262623SN/A for (PhysRegIndex i = numPhysicalIntRegs + numLogicalFloatRegs; 272665Ssaidi@eecs.umich.edu i < numPhysicalRegs; ++i) 282665Ssaidi@eecs.umich.edu { 292623SN/A cprintf("Free List: Adding register %i to float list.\n", i); 302623SN/A freeFloatRegs.push(i); 312623SN/A } 322623SN/A} 332623SN/A 342623SN/A