summaryrefslogtreecommitdiff
path: root/src/arch/arm/insts/pred_inst.cc
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2010-06-02 12:58:02 -0500
committerGabe Black <gblack@eecs.umich.edu>2010-06-02 12:58:02 -0500
commit7939b4826506bde98d299e1ba7a38e17cd1fa785 (patch)
tree795354a368ad0d00a88e5d6a75c79e9a8daaa417 /src/arch/arm/insts/pred_inst.cc
parentb66e3aec43a4adc85fb057db350c8984acf0bc40 (diff)
downloadgem5-7939b4826506bde98d299e1ba7a38e17cd1fa785.tar.xz
ARM: Implement disassembly for the new data processing classes.
Diffstat (limited to 'src/arch/arm/insts/pred_inst.cc')
-rw-r--r--src/arch/arm/insts/pred_inst.cc49
1 files changed, 47 insertions, 2 deletions
diff --git a/src/arch/arm/insts/pred_inst.cc b/src/arch/arm/insts/pred_inst.cc
index b1b21677c..94386e400 100644
--- a/src/arch/arm/insts/pred_inst.cc
+++ b/src/arch/arm/insts/pred_inst.cc
@@ -48,7 +48,16 @@ std::string
PredIntOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
{
std::stringstream ss;
- printDataInst(ss, false);
+ unsigned rotate = machInst.rotate * 2;
+ uint32_t imm = machInst.imm;
+ imm = (imm << (32 - rotate)) | (imm >> rotate);
+ printDataInst(ss, false, machInst.opcode4 == 0, machInst.sField,
+ (IntRegIndex)(uint32_t)machInst.rd,
+ (IntRegIndex)(uint32_t)machInst.rn,
+ (IntRegIndex)(uint32_t)machInst.rm,
+ (IntRegIndex)(uint32_t)machInst.rs,
+ machInst.shiftSize, (ArmShiftType)(uint32_t)machInst.shift,
+ imm);
return ss.str();
}
@@ -56,7 +65,43 @@ std::string
PredImmOpBase::generateDisassembly(Addr pc, const SymbolTable *symtab) const
{
std::stringstream ss;
- printDataInst(ss, true);
+ unsigned rotate = machInst.rotate * 2;
+ uint32_t imm = machInst.imm;
+ imm = (imm << (32 - rotate)) | (imm >> rotate);
+ printDataInst(ss, true, machInst.opcode4 == 0, machInst.sField,
+ (IntRegIndex)(uint32_t)machInst.rd,
+ (IntRegIndex)(uint32_t)machInst.rn,
+ (IntRegIndex)(uint32_t)machInst.rm,
+ (IntRegIndex)(uint32_t)machInst.rs,
+ machInst.shiftSize, (ArmShiftType)(uint32_t)machInst.shift,
+ imm);
+ return ss.str();
+}
+
+std::string
+DataImmOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+{
+ std::stringstream ss;
+ printDataInst(ss, true, false, /*XXX not really s*/ false, dest, op1,
+ INTREG_ZERO, INTREG_ZERO, 0, LSL, imm);
+ return ss.str();
+}
+
+std::string
+DataRegOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+{
+ std::stringstream ss;
+ printDataInst(ss, false, true, /*XXX not really s*/ false, dest, op1,
+ op2, INTREG_ZERO, shiftAmt, shiftType, 0);
+ return ss.str();
+}
+
+std::string
+DataRegRegOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+{
+ std::stringstream ss;
+ printDataInst(ss, false, false, /*XXX not really s*/ false, dest, op1,
+ op2, shift, 0, shiftType, 0);
return ss.str();
}