summaryrefslogtreecommitdiff
path: root/src/arch/sparc
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2009-07-08 23:02:20 -0700
committerGabe Black <gblack@eecs.umich.edu>2009-07-08 23:02:20 -0700
commit0cb180ea0dcece9157ad71b4136d557c2dbcf209 (patch)
treef65b3376cfe8cdad517f6a2a3a8c9e2cf69c987a /src/arch/sparc
parent25884a87733cd35ef6613aaef9a8a08194267552 (diff)
downloadgem5-0cb180ea0dcece9157ad71b4136d557c2dbcf209.tar.xz
Registers: Eliminate the ISA defined floating point register file.
Diffstat (limited to 'src/arch/sparc')
-rw-r--r--src/arch/sparc/SConscript1
-rw-r--r--src/arch/sparc/floatregfile.cc80
-rw-r--r--src/arch/sparc/floatregfile.hh74
-rw-r--r--src/arch/sparc/regfile.cc23
-rw-r--r--src/arch/sparc/regfile.hh10
-rw-r--r--src/arch/sparc/sparc_traits.hh3
6 files changed, 2 insertions, 189 deletions
diff --git a/src/arch/sparc/SConscript b/src/arch/sparc/SConscript
index eb0d21598..2b10951d9 100644
--- a/src/arch/sparc/SConscript
+++ b/src/arch/sparc/SConscript
@@ -34,7 +34,6 @@ Import('*')
if env['TARGET_ISA'] == 'sparc':
Source('asi.cc')
Source('faults.cc')
- Source('floatregfile.cc')
Source('intregfile.cc')
Source('isa.cc')
Source('miscregfile.cc')
diff --git a/src/arch/sparc/floatregfile.cc b/src/arch/sparc/floatregfile.cc
deleted file mode 100644
index 6fdc36489..000000000
--- a/src/arch/sparc/floatregfile.cc
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 2003-2005 The Regents of The University of Michigan
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met: redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer;
- * redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution;
- * neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * Authors: Gabe Black
- * Ali Saidi
- */
-
-#include "arch/sparc/floatregfile.hh"
-#include "base/trace.hh"
-#include "sim/byteswap.hh"
-#include "sim/serialize.hh"
-
-#include <string.h>
-
-using namespace SparcISA;
-using namespace std;
-
-class Checkpoint;
-
-void FloatRegFile::clear()
-{
- memset(regs.q, 0, sizeof(regs.q));
-}
-
-FloatReg FloatRegFile::readReg(int floatReg)
-{
- return regs.s[floatReg];
-}
-
-FloatRegBits FloatRegFile::readRegBits(int floatReg)
-{
- return regs.q[floatReg];
-}
-
-Fault FloatRegFile::setReg(int floatReg, const FloatReg &val)
-{
- regs.s[floatReg] = val;
- return NoFault;
-}
-
-Fault FloatRegFile::setRegBits(int floatReg, const FloatRegBits &val)
-{
- regs.q[floatReg] = val;
- return NoFault;
-}
-
-void FloatRegFile::serialize(std::ostream &os)
-{
- SERIALIZE_ARRAY(regs.q, NumFloatRegs);
-}
-
-void FloatRegFile::unserialize(Checkpoint *cp, const std::string &section)
-{
- UNSERIALIZE_ARRAY(regs.q, NumFloatRegs);
-}
-
diff --git a/src/arch/sparc/floatregfile.hh b/src/arch/sparc/floatregfile.hh
deleted file mode 100644
index d1ac39842..000000000
--- a/src/arch/sparc/floatregfile.hh
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2003-2005 The Regents of The University of Michigan
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met: redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer;
- * redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution;
- * neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * Authors: Gabe Black
- * Ali Saidi
- */
-
-#ifndef __ARCH_SPARC_FLOATREGFILE_HH__
-#define __ARCH_SPARC_FLOATREGFILE_HH__
-
-#include "arch/sparc/faults.hh"
-#include "arch/sparc/isa_traits.hh"
-#include "arch/sparc/types.hh"
-
-#include <string>
-
-class Checkpoint;
-
-namespace SparcISA
-{
- const int NumFloatArchRegs = 64;
- const int NumFloatRegs = 64;
-
- class FloatRegFile
- {
- protected:
- union {
- uint32_t q[NumFloatRegs];
- float s[NumFloatRegs];
- } regs;
-
- public:
-
- void clear();
-
- FloatReg readReg(int floatReg);
-
- FloatRegBits readRegBits(int floatReg);
-
- Fault setReg(int floatReg, const FloatReg &val);
-
- Fault setRegBits(int floatReg, const FloatRegBits &val);
-
- void serialize(std::ostream &os);
-
- void unserialize(Checkpoint *cp, const std::string &section);
- };
-}
-
-#endif
diff --git a/src/arch/sparc/regfile.cc b/src/arch/sparc/regfile.cc
index 287516f9a..83a3dbcc2 100644
--- a/src/arch/sparc/regfile.cc
+++ b/src/arch/sparc/regfile.cc
@@ -70,30 +70,9 @@ void RegFile::setNextNPC(Addr val)
void RegFile::clear()
{
- floatRegFile.clear();
intRegFile.clear();
}
-FloatReg RegFile::readFloatReg(int floatReg)
-{
- return floatRegFile.readReg(floatReg);
-}
-
-FloatRegBits RegFile::readFloatRegBits(int floatReg)
-{
- return floatRegFile.readRegBits(floatReg);
-}
-
-void RegFile::setFloatReg(int floatReg, const FloatReg &val)
-{
- floatRegFile.setReg(floatReg, val);
-}
-
-void RegFile::setFloatRegBits(int floatReg, const FloatRegBits &val)
-{
- floatRegFile.setRegBits(floatReg, val);
-}
-
IntReg RegFile::readIntReg(int intReg)
{
return intRegFile.readReg(intReg);
@@ -108,7 +87,6 @@ void
RegFile::serialize(EventManager *em, ostream &os)
{
intRegFile.serialize(os);
- floatRegFile.serialize(os);
SERIALIZE_SCALAR(pc);
SERIALIZE_SCALAR(npc);
SERIALIZE_SCALAR(nnpc);
@@ -118,7 +96,6 @@ void
RegFile::unserialize(EventManager *em, Checkpoint *cp, const string &section)
{
intRegFile.unserialize(cp, section);
- floatRegFile.unserialize(cp, section);
UNSERIALIZE_SCALAR(pc);
UNSERIALIZE_SCALAR(npc);
UNSERIALIZE_SCALAR(nnpc);
diff --git a/src/arch/sparc/regfile.hh b/src/arch/sparc/regfile.hh
index a9d9be200..c28a5274f 100644
--- a/src/arch/sparc/regfile.hh
+++ b/src/arch/sparc/regfile.hh
@@ -34,7 +34,6 @@
#include <string>
-#include "arch/sparc/floatregfile.hh"
#include "arch/sparc/intregfile.hh"
#include "arch/sparc/isa_traits.hh"
#include "arch/sparc/miscregfile.hh"
@@ -64,20 +63,11 @@ namespace SparcISA
protected:
IntRegFile intRegFile; // integer register file
- FloatRegFile floatRegFile; // floating point register file
public:
void clear();
- FloatReg readFloatReg(int floatReg);
-
- FloatRegBits readFloatRegBits(int floatReg);
-
- void setFloatReg(int floatReg, const FloatReg &val);
-
- void setFloatRegBits(int floatReg, const FloatRegBits &val);
-
IntReg readIntReg(int intReg);
void setIntReg(int intReg, const IntReg &val);
diff --git a/src/arch/sparc/sparc_traits.hh b/src/arch/sparc/sparc_traits.hh
index e154ba274..b8e3c2aef 100644
--- a/src/arch/sparc/sparc_traits.hh
+++ b/src/arch/sparc/sparc_traits.hh
@@ -49,7 +49,8 @@ namespace SparcISA
// const int NumIntRegs =
// NumRegularIntRegs +
// NumMicroIntRegs;
-// const int NumFloatRegs = 64;
+ const int NumFloatRegs = 64;
+ const int NumFloatArchRegs = NumFloatRegs;
// const int NumMiscRegs = 40;
}