recognized 32 & 64 bit unsigned integer types and set the width appropriately
arch/mips/isa_traits.hh:
debug statements to be taken out real soon like...
--HG--
extra : convert_revision : 4e9abcb99c991db93328d01d7606a2bb942b29ee
This commit is contained in:
@@ -1226,6 +1226,10 @@ class FloatRegOperand(Operand):
|
||||
width = 64;
|
||||
else:
|
||||
func = 'readFloatRegBits'
|
||||
if (self.ctype == 'uint32_t'):
|
||||
width = 32;
|
||||
elif (self.ctype == 'uint64_t'):
|
||||
width = 64;
|
||||
if (self.size != self.dflt_size):
|
||||
bit_select = 1
|
||||
if width:
|
||||
@@ -1251,6 +1255,9 @@ class FloatRegOperand(Operand):
|
||||
elif (self.ctype == 'double'):
|
||||
width = 64
|
||||
func = 'setFloatReg'
|
||||
elif (self.ctype == 'uint32_t'):
|
||||
func = 'setFloatRegBits'
|
||||
width = 32
|
||||
elif (self.ctype == 'uint64_t'):
|
||||
func = 'setFloatRegBits'
|
||||
width = 64
|
||||
|
||||
@@ -226,14 +226,20 @@ namespace MipsISA
|
||||
|
||||
double readReg(int floatReg, int width)
|
||||
{
|
||||
using namespace std;
|
||||
|
||||
switch(width)
|
||||
{
|
||||
case SingleWidth:
|
||||
void *float_ptr = ®s[floatReg];
|
||||
cout << "reading as float, reg." << floatReg << ": " << *(float *) float_ptr << endl;
|
||||
cout << "reading as uint32_t, reg." << floatReg << ": " << *(uint32_t *) float_ptr << endl;
|
||||
return *(float *) float_ptr;
|
||||
|
||||
case DoubleWidth:
|
||||
void *double_ptr = ®s[floatReg];
|
||||
cout << "reading as double, reg." << floatReg <<": " << *(double *) double_ptr << endl;
|
||||
cout << "reading as uint64_t, reg." << floatReg << hex << ": 0x" << *(uint64_t *) float_ptr << endl;
|
||||
return *(double *) double_ptr;
|
||||
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user