changeset 781969fbeca9 in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=781969fbeca9
description:
Registers: Get rid of the float register width parameter.
diffstat:
46 files changed, 154 insertions(+), 1181 deletions(-)
src/arch/alpha/floatregfile.hh | 33 ------
src/arch/alpha/regfile.hh | 24 ----
src/arch/arm/regfile/float_regfile.hh | 57 +----------
src/arch/arm/regfile/regfile.hh | 32 +-----
src/arch/arm/types.hh | 8 -
src/arch/isa_parser.py | 49 +--------
src/arch/mips/isa/formats/fp.isa | 34 +-----
src/arch/mips/regfile.cc | 28 -----
src/arch/mips/regfile/float_regfile.cc | 95 ++----------------
src/arch/mips/regfile/float_regfile.hh | 26 +----
src/arch/mips/regfile/regfile.cc | 36 +-----
src/arch/mips/regfile/regfile.hh | 8 -
src/arch/mips/types.hh | 8 -
src/arch/sparc/floatregfile.cc | 139 ++-------------------------
src/arch/sparc/floatregfile.hh | 28 +----
src/arch/sparc/regfile.cc | 33 ------
src/arch/sparc/regfile.hh | 8 -
src/arch/sparc/types.hh | 4
src/arch/x86/floatregfile.cc | 8 -
src/arch/x86/floatregfile.hh | 14 --
src/arch/x86/regfile.cc | 33 ------
src/arch/x86/regfile.hh | 8 -
src/cpu/checker/cpu.hh | 36 ------
src/cpu/checker/thread_context.hh | 18 ---
src/cpu/exec_context.hh | 17 ---
src/cpu/inorder/cpu.cc | 18 +--
src/cpu/inorder/cpu.hh | 12 --
src/cpu/inorder/inorder_dyn_inst.cc | 39 +------
src/cpu/inorder/inorder_dyn_inst.hh | 28 +----
src/cpu/inorder/resources/execution_unit.cc | 3
src/cpu/inorder/resources/use_def.cc | 23 +---
src/cpu/inorder/thread_context.cc | 25 ----
src/cpu/inorder/thread_context.hh | 8 -
src/cpu/legiontrace.cc | 6 -
src/cpu/o3/cpu.cc | 52 ----------
src/cpu/o3/cpu.hh | 16 ---
src/cpu/o3/dyn_inst.hh | 25 ----
src/cpu/o3/regfile.hh | 62 ------------
src/cpu/o3/thread_context.hh | 8 -
src/cpu/o3/thread_context_impl.hh | 64 ------------
src/cpu/ozone/cpu.hh | 8 -
src/cpu/ozone/cpu_impl.hh | 53 ----------
src/cpu/ozone/dyn_inst.hh | 30 -----
src/cpu/simple/base.hh | 27 -----
src/cpu/simple_thread.hh | 24 ----
src/cpu/thread_context.hh | 20 ---
diffs (truncated from 2565 to 300 lines):
diff -r 95f69a436c82 -r 781969fbeca9 src/arch/alpha/floatregfile.hh
--- a/src/arch/alpha/floatregfile.hh Wed Jul 08 23:02:20 2009 -0700
+++ b/src/arch/alpha/floatregfile.hh Wed Jul 08 23:02:20 2009 -0700
@@ -42,18 +42,9 @@
namespace AlphaISA {
-const int SingleWidth = 32;
-const int SingleBytes = SingleWidth / 4;
-const int DoubleWidth = 64;
-const int DoubleBytes = DoubleWidth / 4;
-const int QuadWidth = 128;
-const int QuadBytes = QuadWidth / 4;
-
class FloatRegFile
{
public:
- static const int regWidth = DoubleWidth;
-
union {
uint64_t q[NumFloatRegs]; // integer qword view
double d[NumFloatRegs]; // double-precision floating point view
@@ -70,24 +61,12 @@
return d[floatReg];
}
- FloatReg
- readReg(int floatReg, int width)
- {
- return readReg(floatReg);
- }
-
FloatRegBits
readRegBits(int floatReg)
{
return q[floatReg];
}
- FloatRegBits
- readRegBits(int floatReg, int width)
- {
- return readRegBits(floatReg);
- }
-
void
setReg(int floatReg, const FloatReg &val)
{
@@ -95,23 +74,11 @@
}
void
- setReg(int floatReg, const FloatReg &val, int width)
- {
- setReg(floatReg, val);
- }
-
- void
setRegBits(int floatReg, const FloatRegBits &val)
{
q[floatReg] = val;
}
- void
- setRegBits(int floatReg, const FloatRegBits &val, int width)
- {
- setRegBits(floatReg, val);
- }
-
};
} // namespace AlphaISA
diff -r 95f69a436c82 -r 781969fbeca9 src/arch/alpha/regfile.hh
--- a/src/arch/alpha/regfile.hh Wed Jul 08 23:02:20 2009 -0700
+++ b/src/arch/alpha/regfile.hh Wed Jul 08 23:02:20 2009 -0700
@@ -112,24 +112,12 @@
return floatRegFile.d[floatReg];
}
- FloatReg
- readFloatReg(int floatReg, int width)
- {
- return readFloatReg(floatReg);
- }
-
FloatRegBits
readFloatRegBits(int floatReg)
{
return floatRegFile.q[floatReg];
}
- FloatRegBits
- readFloatRegBits(int floatReg, int width)
- {
- return readFloatRegBits(floatReg);
- }
-
void
setFloatReg(int floatReg, const FloatReg &val)
{
@@ -137,23 +125,11 @@
}
void
- setFloatReg(int floatReg, const FloatReg &val, int width)
- {
- setFloatReg(floatReg, val);
- }
-
- void
setFloatRegBits(int floatReg, const FloatRegBits &val)
{
floatRegFile.q[floatReg] = val;
}
- void
- setFloatRegBits(int floatReg, const FloatRegBits &val, int width)
- {
- setFloatRegBits(floatReg, val);
- }
-
IntReg
readIntReg(int intReg)
{
diff -r 95f69a436c82 -r 781969fbeca9 src/arch/arm/regfile/float_regfile.hh
--- a/src/arch/arm/regfile/float_regfile.hh Wed Jul 08 23:02:20 2009 -0700
+++ b/src/arch/arm/regfile/float_regfile.hh Wed Jul 08 23:02:20 2009 -0700
@@ -75,21 +75,12 @@
Cause_Field = 11
};
- const int SingleWidth = 32;
- const int SingleBytes = SingleWidth / 4;
-
- const int DoubleWidth = 64;
- const int DoubleBytes = DoubleWidth / 4;
-
- const int QuadWidth = 128;
- const int QuadBytes = QuadWidth / 4;
-
class FloatRegFile
{
protected:
union {
FloatRegBits qregs[NumFloatRegs];
- FloatRegVal regs[NumFloatRegs];
+ FloatReg regs[NumFloatRegs];
};
public:
@@ -107,38 +98,17 @@
regs[15] = 10.0;
}
- FloatRegVal readReg(int floatReg, int width)
+ FloatReg readReg(int floatReg)
{
return regs[floatReg];
}
- FloatRegBits readRegBits(int floatReg, int width)
+ FloatRegBits readRegBits(int floatReg)
{
- //return qregs[floatReg];
- switch(width)
- {
- case SingleWidth:
- {
- union {
- float f;
- uint32_t i;
- } s;
- s.f = (float) regs[floatReg];
- return s.i;
- }
- case DoubleWidth:
- {
- uint64_t tmp = (qregs[floatReg]<<32|qregs[floatReg]>>32);
- return tmp;
- }
- default:
- panic("Attempted to read a %d bit floating point "
- "register!", width);
-
- }
+ return qregs[floatReg];
}
- Fault setReg(int floatReg, const FloatRegVal &val, int width)
+ Fault setReg(int floatReg, const FloatReg &val)
{
if (floatReg > 7)
panic("Writing to a hard-wired FP register");
@@ -146,23 +116,12 @@
return NoFault;
}
- Fault setRegBits(int floatReg, const FloatRegBits &val, int width)
+ Fault setRegBits(int floatReg, const FloatRegBits &val)
{
if (floatReg > 7)
panic("Writing to a hard-wired FP register");
- switch(width)
- {
- case DoubleWidth:
- {
- uint64_t tmp = (val << 32 | val >> 32);
- qregs[floatReg] = tmp;
- return NoFault;
- }
- case SingleWidth:
- default:
- panic("Attempted to write a %d bit floating point "
- "register!", width);
- }
+ qregs[floatReg] = val;
+ return NoFault;
}
void serialize(std::ostream &os)
diff -r 95f69a436c82 -r 781969fbeca9 src/arch/arm/regfile/regfile.hh
--- a/src/arch/arm/regfile/regfile.hh Wed Jul 08 23:02:20 2009 -0700
+++ b/src/arch/arm/regfile/regfile.hh Wed Jul 08 23:02:20 2009 -0700
@@ -57,44 +57,24 @@
floatRegFile.clear();
}
- FloatRegVal readFloatReg(int floatReg)
+ FloatReg readFloatReg(int floatReg)
{
- return floatRegFile.readReg(floatReg,SingleWidth);
- }
-
- FloatRegVal readFloatReg(int floatReg, int width)
- {
- return floatRegFile.readReg(floatReg,width);
+ return floatRegFile.readReg(floatReg);
}
FloatRegBits readFloatRegBits(int floatReg)
{
- return floatRegFile.readRegBits(floatReg,SingleWidth);
+ return floatRegFile.readRegBits(floatReg);
}
- FloatRegBits readFloatRegBits(int floatReg, int width)
+ void setFloatReg(int floatReg, const FloatReg &val)
{
- return floatRegFile.readRegBits(floatReg,width);
- }
-
- void setFloatReg(int floatReg, const FloatRegVal &val)
- {
- floatRegFile.setReg(floatReg, val, SingleWidth);
- }
-
- void setFloatReg(int floatReg, const FloatRegVal &val, int width)
- {
- floatRegFile.setReg(floatReg, val, width);
+ floatRegFile.setReg(floatReg, val);
}
void setFloatRegBits(int floatReg, const FloatRegBits &val)
{
- floatRegFile.setRegBits(floatReg, val, SingleWidth);
- }
-
- void setFloatRegBits(int floatReg, const FloatRegBits &val, int width)
- {
- floatRegFile.setRegBits(floatReg, val, width);
+ floatRegFile.setRegBits(floatReg, val);
}
IntReg readIntReg(int intReg)
diff -r 95f69a436c82 -r 781969fbeca9 src/arch/arm/types.hh
--- a/src/arch/arm/types.hh Wed Jul 08 23:02:20 2009 -0700
+++ b/src/arch/arm/types.hh Wed Jul 08 23:02:20 2009 -0700
@@ -120,12 +120,8 @@
// Need to use 64 bits to make sure that read requests get handled properly
// floating point register file entry type
- typedef uint32_t FloatReg32;
- typedef uint64_t FloatReg64;
- typedef uint64_t FloatRegBits;
-
- typedef double FloatRegVal;
- typedef double FloatReg;
+ typedef uint32_t FloatRegBits;
+ typedef float FloatReg;
// cop-0/cop-1 system control register
typedef uint64_t MiscReg;
diff -r 95f69a436c82 -r 781969fbeca9 src/arch/isa_parser.py
--- a/src/arch/isa_parser.py Wed Jul 08 23:02:20 2009 -0700
+++ b/src/arch/isa_parser.py Wed Jul 08 23:02:20 2009 -0700
@@ -1173,10 +1173,9 @@
# (e.g., "32-bit integer register").
#
class Operand(object):
- def buildReadCode(self, func = None, width = None):
+ def buildReadCode(self, func = None):
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev