diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2006-08-29 16:02:54 -0400 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2006-08-29 16:02:54 -0400 |
commit | 292d3ae14ab927acfea988306b3cb8c8ec1559b7 (patch) | |
tree | 057713d32db3c5c2efedacd48bdcd6ead6ea9e5a /src | |
parent | 7ac1d10eb527aad02b69ae6a20d2616a0cf0693e (diff) | |
download | gem5-292d3ae14ab927acfea988306b3cb8c8ec1559b7.tar.xz |
Fiddled with the floating point accessors.
--HG--
extra : convert_revision : 78cbd0c28d3fa1109eb2eacaf2a8009f13158a9b
Diffstat (limited to 'src')
-rw-r--r-- | src/arch/sparc/floatregfile.cc | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/arch/sparc/floatregfile.cc b/src/arch/sparc/floatregfile.cc index 3cacbb278..3afe6ef54 100644 --- a/src/arch/sparc/floatregfile.cc +++ b/src/arch/sparc/floatregfile.cc @@ -63,23 +63,28 @@ FloatReg FloatRegFile::readReg(int floatReg, int width) //In each of these cases, we have to copy the value into a temporary //variable. This is because we may otherwise try to access an //unaligned portion of memory. + FloatReg result; switch(width) { case SingleWidth: float32_t result32; memcpy(&result32, regSpace + 4 * floatReg, sizeof(result32)); - return htog(result32); + result = htog(result32); + break; case DoubleWidth: float64_t result64; memcpy(&result64, regSpace + 4 * floatReg, sizeof(result64)); - return htog(result64); + result = htog(result64); + break; case QuadWidth: float128_t result128; memcpy(&result128, regSpace + 4 * floatReg, sizeof(result128)); - return htog(result128); + result = htog(result128); + break; default: panic("Attempted to read a %d bit floating point register!", width); } + return result; } FloatRegBits FloatRegFile::readRegBits(int floatReg, int width) @@ -87,23 +92,28 @@ FloatRegBits FloatRegFile::readRegBits(int floatReg, int width) //In each of these cases, we have to copy the value into a temporary //variable. This is because we may otherwise try to access an //unaligned portion of memory. + FloatRegBits result; switch(width) { case SingleWidth: uint32_t result32; memcpy(&result32, regSpace + 4 * floatReg, sizeof(result32)); - return htog(result32); + result = htog(result32); + break; case DoubleWidth: uint64_t result64; memcpy(&result64, regSpace + 4 * floatReg, sizeof(result64)); - return htog(result64); + result = htog(result64); + break; case QuadWidth: uint64_t result128; memcpy(&result128, regSpace + 4 * floatReg, sizeof(result128)); - return htog(result128); + result = htog(result128); + break; default: panic("Attempted to read a %d bit floating point register!", width); } + return result; } Fault FloatRegFile::setReg(int floatReg, const FloatReg &val, int width) @@ -114,7 +124,6 @@ Fault FloatRegFile::setReg(int floatReg, const FloatReg &val, int width) uint32_t result32; uint64_t result64; - DPRINTF(Sparc, "Setting floating point register %d\n", floatReg); switch(width) { case SingleWidth: |