misc.cc (12104:edd63f9c6184) misc.cc (12106:7784fac1b159)
1/*
2 * Copyright (c) 2010, 2012-2013 ARM Limited
3 * Copyright (c) 2013 Advanced Micro Devices, Inc.
4 * All rights reserved
5 *
6 * The license below extends only to copyright in the software and shall
7 * not be construed as granting a license to any other intellectual
8 * property including but not limited to intellectual property relating

--- 37 unchanged lines hidden (view full) ---

46MrsOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
47{
48 std::stringstream ss;
49 printMnemonic(ss);
50 printIntReg(ss, dest);
51 ss << ", ";
52 bool foundPsr = false;
53 for (unsigned i = 0; i < numSrcRegs(); i++) {
1/*
2 * Copyright (c) 2010, 2012-2013 ARM Limited
3 * Copyright (c) 2013 Advanced Micro Devices, Inc.
4 * All rights reserved
5 *
6 * The license below extends only to copyright in the software and shall
7 * not be construed as granting a license to any other intellectual
8 * property including but not limited to intellectual property relating

--- 37 unchanged lines hidden (view full) ---

46MrsOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
47{
48 std::stringstream ss;
49 printMnemonic(ss);
50 printIntReg(ss, dest);
51 ss << ", ";
52 bool foundPsr = false;
53 for (unsigned i = 0; i < numSrcRegs(); i++) {
54 RegId reg = srcRegIdx(i);
55 if (reg.regClass != MiscRegClass) {
54 const RegId& reg = srcRegIdx(i);
55 if (!reg.isMiscReg()) {
56 continue;
57 }
56 continue;
57 }
58 if (reg.regIdx == MISCREG_CPSR) {
58 if (reg.index() == MISCREG_CPSR) {
59 ss << "cpsr";
60 foundPsr = true;
61 break;
62 }
59 ss << "cpsr";
60 foundPsr = true;
61 break;
62 }
63 if (reg.regIdx == MISCREG_SPSR) {
63 if (reg.index() == MISCREG_SPSR) {
64 ss << "spsr";
65 foundPsr = true;
66 break;
67 }
68 }
69 if (!foundPsr) {
70 ss << "????";
71 }
72 return ss.str();
73}
74
75void
76MsrBase::printMsrBase(std::ostream &os) const
77{
78 printMnemonic(os);
79 bool apsr = false;
80 bool foundPsr = false;
81 for (unsigned i = 0; i < numDestRegs(); i++) {
64 ss << "spsr";
65 foundPsr = true;
66 break;
67 }
68 }
69 if (!foundPsr) {
70 ss << "????";
71 }
72 return ss.str();
73}
74
75void
76MsrBase::printMsrBase(std::ostream &os) const
77{
78 printMnemonic(os);
79 bool apsr = false;
80 bool foundPsr = false;
81 for (unsigned i = 0; i < numDestRegs(); i++) {
82 RegId reg = destRegIdx(i);
83 if (reg.regClass != MiscRegClass) {
82 const RegId& reg = destRegIdx(i);
83 if (!reg.isMiscReg()) {
84 continue;
85 }
84 continue;
85 }
86 if (reg.regIdx == MISCREG_CPSR) {
86 if (reg.index() == MISCREG_CPSR) {
87 os << "cpsr_";
88 foundPsr = true;
89 break;
90 }
87 os << "cpsr_";
88 foundPsr = true;
89 break;
90 }
91 if (reg.regIdx == MISCREG_SPSR) {
91 if (reg.index() == MISCREG_SPSR) {
92 if (bits(byteMask, 1, 0)) {
93 os << "spsr_";
94 } else {
95 os << "apsr_";
96 apsr = true;
97 }
98 foundPsr = true;
99 break;

--- 231 unchanged lines hidden ---
92 if (bits(byteMask, 1, 0)) {
93 os << "spsr_";
94 } else {
95 os << "apsr_";
96 apsr = true;
97 }
98 foundPsr = true;
99 break;

--- 231 unchanged lines hidden ---