summaryrefslogtreecommitdiff
path: root/arch/alpha
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2006-03-14 16:08:32 -0500
committerGabe Black <gblack@eecs.umich.edu>2006-03-14 16:08:32 -0500
commitfa763d2ecfae16e84a9f9d689d19f746d84d08e3 (patch)
tree52474edfd8d1ab010a376b1eb66f4d9990fe4a54 /arch/alpha
parentf045b110cf1db6f9fc70589532b48d9cca339897 (diff)
parentefe46430fac2419a02062e3b282324498a55df28 (diff)
downloadgem5-fa763d2ecfae16e84a9f9d689d19f746d84d08e3.tar.xz
Merge m5.eecs.umich.edu:/bk/newmem
into ewok.(none):/home/gblack/m5/newmem cpu/cpu_exec_context.cc: Hand merge --HG-- rename : arch/alpha/registerfile.hh => arch/alpha/regfile.hh extra : convert_revision : bd18966f7c37c67c2bc7ca2633b58f70ce64409c
Diffstat (limited to 'arch/alpha')
-rw-r--r--arch/alpha/arguments.cc2
-rw-r--r--arch/alpha/ev5.cc2
-rw-r--r--arch/alpha/isa_traits.hh2
-rw-r--r--arch/alpha/regfile.hh (renamed from arch/alpha/registerfile.hh)66
-rw-r--r--arch/alpha/types.hh6
-rw-r--r--arch/alpha/utility.hh2
6 files changed, 66 insertions, 14 deletions
diff --git a/arch/alpha/arguments.cc b/arch/alpha/arguments.cc
index 019390aeb..a782ea330 100644
--- a/arch/alpha/arguments.cc
+++ b/arch/alpha/arguments.cc
@@ -54,7 +54,7 @@ AlphaArguments::getArg(bool fp)
{
if (number < 6) {
if (fp)
- return xc->readFloatRegInt(16 + number);
+ return xc->readFloatRegBits(16 + number);
else
return xc->readIntReg(16 + number);
} else {
diff --git a/arch/alpha/ev5.cc b/arch/alpha/ev5.cc
index 6d45edbff..a5a8851c2 100644
--- a/arch/alpha/ev5.cc
+++ b/arch/alpha/ev5.cc
@@ -134,7 +134,7 @@ AlphaISA::zeroRegisters(CPU *cpu)
// (no longer very clean due to the change in setIntReg() in the
// cpu model. Consider changing later.)
cpu->cpuXC->setIntReg(ZeroReg, 0);
- cpu->cpuXC->setFloatRegDouble(ZeroReg, 0.0);
+ cpu->cpuXC->setFloatReg(ZeroReg, 0.0);
}
Fault
diff --git a/arch/alpha/isa_traits.hh b/arch/alpha/isa_traits.hh
index 1ab3b989d..5f8b00c40 100644
--- a/arch/alpha/isa_traits.hh
+++ b/arch/alpha/isa_traits.hh
@@ -33,7 +33,7 @@ namespace LittleEndianGuest {}
#include "arch/alpha/types.hh"
#include "arch/alpha/constants.hh"
-#include "arch/alpha/registerfile.hh"
+#include "arch/alpha/regfile.hh"
#include "config/full_system.hh"
#include "sim/host.hh"
diff --git a/arch/alpha/registerfile.hh b/arch/alpha/regfile.hh
index 6bdab78f5..8a11a8eb6 100644
--- a/arch/alpha/registerfile.hh
+++ b/arch/alpha/regfile.hh
@@ -26,8 +26,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef __ARCH_ALPHA_REGISTERFILE_HH__
-#define __ARCH_ALPHA_REGISTERFILE_HH__
+#ifndef __ARCH_ALPHA_REGFILE_HH__
+#define __ARCH_ALPHA_REGFILE_HH__
#include "arch/alpha/types.hh"
#include "arch/alpha/constants.hh"
@@ -41,10 +41,64 @@ namespace AlphaISA
typedef IntReg IntRegFile[NumIntRegs];
- typedef union {
- uint64_t q[NumFloatRegs]; // integer qword view
- double d[NumFloatRegs]; // double-precision floating point view
- } FloatRegFile;
+ class FloatRegFile
+ {
+ protected:
+
+ union {
+ uint64_t q[NumFloatRegs]; // integer qword view
+ double d[NumFloatRegs]; // double-precision floating point view
+ };
+
+ public:
+
+ FloatReg readReg(int floatReg)
+ {
+ 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);
+ }
+
+ Fault setReg(int floatReg, const FloatReg &val)
+ {
+ d[floatReg] = val;
+ return NoFault;
+ }
+
+ Fault setReg(int floatReg, const FloatReg &val, int width)
+ {
+ return setReg(floatReg, val);
+ }
+
+ Fault setRegBits(int floatReg, const FloatRegBits &val)
+ {
+ q[floatReg] = val;
+ return NoFault;
+ }
+
+ Fault setRegBits(int floatReg, const FloatRegBits &val, int width)
+ {
+ return setRegBits(floatReg, val);
+ }
+
+ void serialize(std::ostream &os);
+
+ void unserialize(Checkpoint *cp, const std::string &section);
+
+ };
class MiscRegFile {
protected:
diff --git a/arch/alpha/types.hh b/arch/alpha/types.hh
index 7af3bebd8..3cd93c6b0 100644
--- a/arch/alpha/types.hh
+++ b/arch/alpha/types.hh
@@ -54,10 +54,8 @@ namespace AlphaISA
typedef uint64_t IntReg;
// floating point register file entry type
- typedef union {
- uint64_t q;
- double d;
- } FloatReg;
+ typedef double FloatReg;
+ typedef uint64_t FloatRegBits;
// control register file contents
typedef uint64_t MiscReg;
diff --git a/arch/alpha/utility.hh b/arch/alpha/utility.hh
index 92fb66c81..13bc01af4 100644
--- a/arch/alpha/utility.hh
+++ b/arch/alpha/utility.hh
@@ -32,7 +32,7 @@
#include "config/full_system.hh"
#include "arch/alpha/types.hh"
#include "arch/alpha/constants.hh"
-#include "arch/alpha/registerfile.hh"
+#include "arch/alpha/regfile.hh"
#include "base/misc.hh"
namespace AlphaISA