Minor changes for FP ... MIPS now works for floating-point programs...
authorKorey Sewell <ksewell@umich.edu>
Sun, 7 May 2006 18:09:19 +0000 (14:09 -0400)
committerKorey Sewell <ksewell@umich.edu>
Sun, 7 May 2006 18:09:19 +0000 (14:09 -0400)
Now we are to the point where more benchmarks and instruction-coverage
is necessary to totally verify/validate correct operation across
all MIPS instructions

arch/mips/isa_traits.hh:
    fix for reading double values ... must rearrange bits before using void* to read double.
configs/test/hello_mips:
    real hello world MIPS binary

--HG--
extra : convert_revision : 153de1f8a830882c6972bd0bdb56da818f614def

arch/mips/isa_traits.hh
configs/test/hello_mips

index 3879eaf40f6f04537615e5eea15d9fb3b43f4b13..74947c6ddde2a849e57b3a1a0da5c6bad117285f 100644 (file)
@@ -190,6 +190,7 @@ namespace MipsISA
     };
 
     typedef float FloatReg;
+    typedef double FPVal;
 
     typedef uint32_t FloatReg32;
     typedef uint64_t FloatReg64;
@@ -230,7 +231,8 @@ namespace MipsISA
                 return *(float *) float_ptr;
 
               case DoubleWidth:
-                void *double_ptr = &regs[floatReg];
+                uint64_t double_val = (FloatReg64)regs[floatReg + 1] << 32 | regs[floatReg];
+                void *double_ptr = &double_val;
                 return *(double *) double_ptr;
 
               default:
@@ -255,7 +257,7 @@ namespace MipsISA
             }
         }
 
-        Fault setReg(int floatReg, const FloatReg &val, int width)
+        Fault setReg(int floatReg, const FPVal &val, int width)
         {
 
             switch(width)
index 33d9fbb5880bfa0f884a1d6088c90e90e2ccaf90..a3db001ec870fe17678195527e6720c511722a1c 100755 (executable)
Binary files a/configs/test/hello_mips and b/configs/test/hello_mips differ