diff options
author | Misha Brukman <brukman+llvm@gmail.com> | 2004-10-14 06:07:25 +0000 |
---|---|---|
committer | Misha Brukman <brukman+llvm@gmail.com> | 2004-10-14 06:07:25 +0000 |
commit | d37faba5b485eefe94e36e0f88da899b8fec42e5 (patch) | |
tree | 8f5f1acf056918b3b6432b542199913c59958ded | |
parent | bab2adf49691014fedcffe0744e22e0277ddf1b8 (diff) | |
download | external_llvm-d37faba5b485eefe94e36e0f88da899b8fec42e5.zip external_llvm-d37faba5b485eefe94e36e0f88da899b8fec42e5.tar.gz external_llvm-d37faba5b485eefe94e36e0f88da899b8fec42e5.tar.bz2 |
* Include the real (generated) version of getBinaryCodeForInstr()
* Add implementation of getMachineOpValue() for generated code emitter
* Convert assert()s in unimplemented functions to abort()s so that non-debug
builds fail predictably
* Add file header comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16981 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/PowerPC/PPCCodeEmitter.cpp | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/lib/Target/PowerPC/PPCCodeEmitter.cpp b/lib/Target/PowerPC/PPCCodeEmitter.cpp index b08ce92..bf6ea41 100644 --- a/lib/Target/PowerPC/PPCCodeEmitter.cpp +++ b/lib/Target/PowerPC/PPCCodeEmitter.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// // +// This file defines the PowerPC 32-bit CodeEmitter and associated machinery to +// JIT-compile bytecode to native PowerPC. // //===----------------------------------------------------------------------===// @@ -24,6 +26,8 @@ namespace { TargetMachine &TM; MachineCodeEmitter &MCE; + int64_t getMachineOpValue(MachineInstr &MI, MachineOperand &MO); + public: PPC32CodeEmitter(TargetMachine &T, MachineCodeEmitter &M) : TM(T), MCE(M) {} @@ -41,12 +45,14 @@ namespace { /// emitWord - write a 32-bit word to memory at the current PC /// void emitWord(unsigned w) { MCE.emitWord(w); } - - unsigned getValueBit(int64_t Val, unsigned bit); + + /// getValueBit - return the particular bit of Val + /// + unsigned getValueBit(int64_t Val, unsigned bit) { return (Val >> bit) & 1; } /// getBinaryCodeForInstr - returns the assembled code for an instruction /// - unsigned getBinaryCodeForInstr(MachineInstr &MI) { return 0; } + unsigned getBinaryCodeForInstr(MachineInstr &MI); }; } @@ -60,7 +66,7 @@ bool PPC32TargetMachine::addPassesToEmitMachineCode(FunctionPassManager &PM, MachineCodeEmitter &MCE) { // Machine code emitter pass for PowerPC PM.add(new PPC32CodeEmitter(*this, MCE)); - // Delete machine code for this function after emitting it: + // Delete machine code for this function after emitting it PM.add(createMachineCodeDeleter()); // We don't yet support machine code emission return true; @@ -80,22 +86,26 @@ void PPC32CodeEmitter::emitBasicBlock(MachineBasicBlock &MBB) { emitWord(getBinaryCodeForInstr(*I)); } -unsigned PPC32CodeEmitter::getValueBit(int64_t Val, unsigned bit) { - Val >>= bit; - return (Val & 1); +int64_t PPC32CodeEmitter::getMachineOpValue(MachineInstr &MI, + MachineOperand &MO) { + abort(); + return 0; } + void *PPC32JITInfo::getJITStubForFunction(Function *F, MachineCodeEmitter &MCE) { - assert (0 && "PPC32JITInfo::getJITStubForFunction not implemented"); + std::cerr << "PPC32JITInfo::getJITStubForFunction not implemented\n"; + abort(); return 0; } void PPC32JITInfo::replaceMachineCodeForFunction (void *Old, void *New) { - assert (0 && "PPC32JITInfo::replaceMachineCodeForFunction not implemented"); + std::cerr << "PPC32JITInfo::replaceMachineCodeForFunction not implemented\n"; + abort(); } -//#include "PowerPCGenCodeEmitter.inc" +#include "PPC32GenCodeEmitter.inc" } // end llvm namespace |