!myMnemonic.compare("mtxer") ||
!myMnemonic.compare("mtlr") ||
!myMnemonic.compare("mtctr") ||
- !myMnemonic.compare("cmpi") ||
!myMnemonic.compare("mttar")) {
printDest = false;
} else if (!myMnemonic.compare("mfcr") ||
}
+std::string
+IntCompOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
+{
+ std::stringstream ss;
+ bool printFieldPrefix = false;
+ bool printLength = true;
+
+ // Generate the correct mnemonic
+ std::string myMnemonic(mnemonic);
+
+ // Special cases
+ if (!myMnemonic.compare("cmp")) {
+ if (length) {
+ myMnemonic = "cmpd";
+ } else {
+ myMnemonic = "cmpw";
+ }
+ printFieldPrefix = true;
+ printLength = false;
+ } else if (!myMnemonic.compare("cmpl")) {
+ if (length) {
+ myMnemonic = "cmpld";
+ } else {
+ myMnemonic = "cmplw";
+ }
+ printFieldPrefix = true;
+ printLength = false;
+ }
+
+ ccprintf(ss, "%-10s ", myMnemonic);
+
+ // Print the first destination only
+ if (printFieldPrefix) {
+ if (field > 0) {
+ ss << "cr" << field;
+ }
+ } else {
+ ss << field;
+ }
+
+ // Print the length
+ if (printLength) {
+ if (!printFieldPrefix || field > 0) {
+ ss << ", ";
+ }
+ ss << length;
+ }
+
+ // Print the first source register
+ if (_numSrcRegs > 0) {
+ if (!printFieldPrefix || field > 0 || printLength) {
+ ss << ", ";
+ }
+ printReg(ss, srcRegIdx(0));
+
+ // Print the second source register
+ if (_numSrcRegs > 1) {
+ ss << ", ";
+ printReg(ss, srcRegIdx(1));
+ }
+ }
+
+ return ss.str();
+}
+
+
+std::string
+IntImmCompOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
+{
+ std::stringstream ss;
+ bool printFieldPrefix = false;
+ bool printLength = true;
+
+ // Generate the correct mnemonic
+ std::string myMnemonic(mnemonic);
+
+ // Special cases
+ if (!myMnemonic.compare("cmpi")) {
+ if (length) {
+ myMnemonic = "cmpdi";
+ } else {
+ myMnemonic = "cmpwi";
+ }
+ printFieldPrefix = true;
+ printLength = false;
+ }
+
+ ccprintf(ss, "%-10s ", myMnemonic);
+
+ // Print the first destination only
+ if (printFieldPrefix) {
+ if (field > 0) {
+ ss << "cr" << field;
+ }
+ } else {
+ ss << field;
+ }
+
+ // Print the length
+ if (printLength) {
+ if (!printFieldPrefix || field > 0) {
+ ss << ", ";
+ }
+ ss << length;
+ }
+
+ // Print the first source register
+ if (_numSrcRegs > 0) {
+ if (!printFieldPrefix || field > 0 || printLength) {
+ ss << ", ";
+ }
+ printReg(ss, srcRegIdx(0));
+ }
+
+ // Print the immediate value
+ ss << ", " << simm;
+
+ return ss.str();
+}
+
+
+std::string
+IntImmCompLogicOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
+{
+ std::stringstream ss;
+ bool printFieldPrefix = false;
+ bool printLength = true;
+
+ // Generate the correct mnemonic
+ std::string myMnemonic(mnemonic);
+
+ // Special cases
+ if (!myMnemonic.compare("cmpli")) {
+ if (length) {
+ myMnemonic = "cmpldi";
+ } else {
+ myMnemonic = "cmplwi";
+ }
+ printFieldPrefix = true;
+ printLength = false;
+ }
+
+ ccprintf(ss, "%-10s ", myMnemonic);
+
+ // Print the first destination only
+ if (printFieldPrefix) {
+ if (field > 0) {
+ ss << "cr" << field;
+ }
+ } else {
+ ss << field;
+ }
+
+ // Print the mode
+ if (printLength) {
+ if (!printFieldPrefix || field > 0) {
+ ss << ", ";
+ }
+ ss << length;
+ }
+
+ // Print the first source register
+ if (_numSrcRegs > 0) {
+ if (!printFieldPrefix || field > 0 || printLength) {
+ ss << ", ";
+ }
+ printReg(ss, srcRegIdx(0));
+ }
+
+ // Print the immediate value
+ ss << ", " << uimm;
+
+ return ss.str();
+}
+
+
std::string
IntShiftOp::generateDisassembly(
Addr pc, const Loader::SymbolTable *symtab) const