diff options
| author | Brian Gaeke <gaeke@uiuc.edu> | 2004-04-23 17:11:15 +0000 |
|---|---|---|
| committer | Brian Gaeke <gaeke@uiuc.edu> | 2004-04-23 17:11:15 +0000 |
| commit | fe277c2809a2483d1b96bef80f81607628116e18 (patch) | |
| tree | 71cec20dbeb2722eb40c253639ac6a3f3b090b3d /llvm/lib/Target/SparcV9/SparcV9CodeEmitter.cpp | |
| parent | 0c4fb283f36fffcfb88957225110dae1e3090894 (diff) | |
| download | bcm5719-llvm-fe277c2809a2483d1b96bef80f81607628116e18.tar.gz bcm5719-llvm-fe277c2809a2483d1b96bef80f81607628116e18.zip | |
Emit SPARC machine code a word at a time instead of a byte at a time.
Use emitWordAt() to emit forward-branch fixups.
llvm-svn: 13119
Diffstat (limited to 'llvm/lib/Target/SparcV9/SparcV9CodeEmitter.cpp')
| -rw-r--r-- | llvm/lib/Target/SparcV9/SparcV9CodeEmitter.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Target/SparcV9/SparcV9CodeEmitter.cpp b/llvm/lib/Target/SparcV9/SparcV9CodeEmitter.cpp index 8f8946e0c2a..a0d9a6a28c5 100644 --- a/llvm/lib/Target/SparcV9/SparcV9CodeEmitter.cpp +++ b/llvm/lib/Target/SparcV9/SparcV9CodeEmitter.cpp @@ -468,12 +468,16 @@ SparcV9CodeEmitter::~SparcV9CodeEmitter() { } 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 @@ bool SparcV9CodeEmitter::runOnMachineFunction(MachineFunction &MF) { else if (hiBits64) { MI->setOperandHi64(ii); } DEBUG(std::cerr << "Rewrote BB ref: "); unsigned fixedInstr = SparcV9CodeEmitter::getBinaryCodeForInstr(*MI); - *Ref = fixedInstr; + MCE.emitWordAt (fixedInstr, Ref); break; } } |

