Deleted Added
sdiff udiff text old ( 11793:ef606668d247 ) new ( 12104:edd63f9c6184 )
full compact
1/*
2 * Copyright (c) 2004-2005 The Regents of The University of Michigan
3 * Copyright (c) 2013 Advanced Micro Devices, Inc.
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met: redistributions of source code must retain the above copyright

--- 90 unchanged lines hidden (view full) ---

99
100 floatMap.init(TheISA::NumFloatRegs, &(freeList->floatList), _floatZeroReg);
101
102 ccMap.init(TheISA::NumCCRegs, &(freeList->ccList), (RegIndex)-1);
103}
104
105
106UnifiedRenameMap::RenameInfo
107UnifiedRenameMap::rename(RegId arch_reg)
108{
109 switch (arch_reg.regClass) {
110 case IntRegClass:
111 return renameInt(arch_reg.regIdx);
112
113 case FloatRegClass:
114 return renameFloat(arch_reg.regIdx);
115
116 case CCRegClass:
117 return renameCC(arch_reg.regIdx);
118
119 case MiscRegClass:
120 return renameMisc(arch_reg.regIdx);
121
122 default:
123 panic("rename rename(): unknown reg class %s\n",
124 RegClassStrings[arch_reg.regClass]);
125 }
126}
127
128
129PhysRegIndex
130UnifiedRenameMap::lookup(RegId arch_reg) const
131{
132 switch (arch_reg.regClass) {
133 case IntRegClass:
134 return lookupInt(arch_reg.regIdx);
135
136 case FloatRegClass:
137 return lookupFloat(arch_reg.regIdx);
138
139 case CCRegClass:
140 return lookupCC(arch_reg.regIdx);
141
142 case MiscRegClass:
143 return lookupMisc(arch_reg.regIdx);
144
145 default:
146 panic("rename lookup(): unknown reg class %s\n",
147 RegClassStrings[arch_reg.regClass]);
148 }
149}
150
151void
152UnifiedRenameMap::setEntry(RegId arch_reg, PhysRegIndex phys_reg)
153{
154 switch (arch_reg.regClass) {
155 case IntRegClass:
156 return setIntEntry(arch_reg.regIdx, phys_reg);
157
158 case FloatRegClass:
159 return setFloatEntry(arch_reg.regIdx, phys_reg);
160
161 case CCRegClass:
162 return setCCEntry(arch_reg.regIdx, phys_reg);
163
164 case MiscRegClass:
165 // Misc registers do not actually rename, so don't change
166 // their mappings. We end up here when a commit or squash
167 // tries to update or undo a hardwired misc reg nmapping,
168 // which should always be setting it to what it already is.
169 assert(phys_reg == lookupMisc(arch_reg.regIdx));
170 return;
171
172 default:
173 panic("rename setEntry(): unknown reg class %s\n",
174 RegClassStrings[arch_reg.regClass]);
175 }
176}