free_list.cc revision 1060
1#include "cpu/beta_cpu/free_list.hh"
2
3SimpleFreeList::SimpleFreeList(unsigned _numLogicalIntRegs,
4                               unsigned _numPhysicalIntRegs,
5                               unsigned _numLogicalFloatRegs,
6                               unsigned _numPhysicalFloatRegs)
7    : numLogicalIntRegs(_numLogicalIntRegs),
8      numPhysicalIntRegs(_numPhysicalIntRegs),
9      numLogicalFloatRegs(_numLogicalFloatRegs),
10      numPhysicalFloatRegs(_numPhysicalFloatRegs),
11      numPhysicalRegs(numPhysicalIntRegs + numPhysicalFloatRegs)
12{
13
14    // Put all of the extra physical registers onto the free list.  This
15    // means excluding all of the base logical registers.
16    for (PhysRegIndex i = numLogicalIntRegs;
17         i < numPhysicalIntRegs; ++i)
18    {
19        freeIntRegs.push(i);
20    }
21
22    // Put all of the extra physical registers onto the free list.  This
23    // means excluding all of the base logical registers.  Because the
24    // float registers' indices start where the physical registers end,
25    // some math must be done to determine where the free registers start.
26    for (PhysRegIndex i = numPhysicalIntRegs + numLogicalFloatRegs;
27         i < numPhysicalRegs; ++i)
28    {
29        cprintf("Free List: Adding register %i to float list.\n", i);
30        freeFloatRegs.push(i);
31    }
32}
33
34