[llvm-commits] CVS: llvm/lib/Target/SparcV9/SparcV9CodeEmitter.cpp
Brian Gaeke
gaeke at cs.uiuc.edu
Fri Apr 23 12:12:14 PDT 2004
Changes in directory llvm/lib/Target/SparcV9:
SparcV9CodeEmitter.cpp updated: 1.58 -> 1.59
---
Log message:
Emit SPARC machine code a word at a time instead of a byte at a time.
Use emitWordAt() to emit forward-branch fixups.
---
Diffs of the changes: (+5 -1)
Index: llvm/lib/Target/SparcV9/SparcV9CodeEmitter.cpp
diff -u llvm/lib/Target/SparcV9/SparcV9CodeEmitter.cpp:1.58 llvm/lib/Target/SparcV9/SparcV9CodeEmitter.cpp:1.59
--- llvm/lib/Target/SparcV9/SparcV9CodeEmitter.cpp:1.58 Wed Feb 25 12:44:15 2004
+++ llvm/lib/Target/SparcV9/SparcV9CodeEmitter.cpp Fri Apr 23 12:11:15 2004
@@ -468,12 +468,16 @@
}
void SparcV9CodeEmitter::emitWord(unsigned Val) {
+#if 0 // I think this was used when the Sparc JIT was being tested on X86:
// Output the constant in big endian byte order...
unsigned byteVal;
for (int i = 3; i >= 0; --i) {
byteVal = Val >> 8*i;
MCE.emitByte(byteVal & 255);
}
+#else
+ MCE.emitWord(Val);
+#endif
}
unsigned
@@ -763,7 +767,7 @@
else if (hiBits64) { MI->setOperandHi64(ii); }
DEBUG(std::cerr << "Rewrote BB ref: ");
unsigned fixedInstr = SparcV9CodeEmitter::getBinaryCodeForInstr(*MI);
- *Ref = fixedInstr;
+ MCE.emitWordAt (fixedInstr, Ref);
break;
}
}
More information about the llvm-commits
mailing list