diff options
author | Chris Lattner <sabre@nondot.org> | 2010-11-15 06:09:35 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-11-15 06:09:35 +0000 |
commit | 0e3461e417150fc499d99e7fc69cd19d8d200ccf (patch) | |
tree | 699a66e33f7d9d063cc718ae6dab1a23443d423f /llvm/lib/Target/PowerPC/PPCMCCodeEmitter.cpp | |
parent | 70641983979dd9763d354525cb60a962300fc262 (diff) | |
download | bcm5719-llvm-0e3461e417150fc499d99e7fc69cd19d8d200ccf.tar.gz bcm5719-llvm-0e3461e417150fc499d99e7fc69cd19d8d200ccf.zip |
change direct branches to encode with the same encoding method
as direct calls. Change conditional branches to encode with
their own method, simplifying the JIT encoder and making room
for adding an mc fixup.
llvm-svn: 119125
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCMCCodeEmitter.cpp')
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCMCCodeEmitter.cpp | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCMCCodeEmitter.cpp b/llvm/lib/Target/PowerPC/PPCMCCodeEmitter.cpp index 67ab66537a4..29cc2cabcbc 100644 --- a/llvm/lib/Target/PowerPC/PPCMCCodeEmitter.cpp +++ b/llvm/lib/Target/PowerPC/PPCMCCodeEmitter.cpp @@ -58,9 +58,12 @@ public: return Infos[Kind - FirstTargetFixupKind]; } - unsigned getCallTargetEncoding(const MCInst &MI, unsigned OpNo, - SmallVectorImpl<MCFixup> &Fixups) const; - + unsigned getDirectBrEncoding(const MCInst &MI, unsigned OpNo, + SmallVectorImpl<MCFixup> &Fixups) const; + + unsigned getCondBrEncoding(const MCInst &MI, unsigned OpNo, + SmallVectorImpl<MCFixup> &Fixups) const; + unsigned get_crbitm_encoding(const MCInst &MI, unsigned OpNo, SmallVectorImpl<MCFixup> &Fixups) const; @@ -96,8 +99,8 @@ MCCodeEmitter *llvm::createPPCMCCodeEmitter(const Target &, TargetMachine &TM, } unsigned PPCMCCodeEmitter:: -getCallTargetEncoding(const MCInst &MI, unsigned OpNo, - SmallVectorImpl<MCFixup> &Fixups) const { +getDirectBrEncoding(const MCInst &MI, unsigned OpNo, + SmallVectorImpl<MCFixup> &Fixups) const { const MCOperand &MO = MI.getOperand(OpNo); if (MO.isReg() || MO.isImm()) return getMachineOpValue(MI, MO, Fixups); @@ -107,6 +110,17 @@ getCallTargetEncoding(const MCInst &MI, unsigned OpNo, return 0; } +unsigned PPCMCCodeEmitter::getCondBrEncoding(const MCInst &MI, unsigned OpNo, + SmallVectorImpl<MCFixup> &Fixups) const { + const MCOperand &MO = MI.getOperand(OpNo); + if (MO.isReg() || MO.isImm()) return getMachineOpValue(MI, MO, Fixups); + + + + return 0; +} + + unsigned PPCMCCodeEmitter:: get_crbitm_encoding(const MCInst &MI, unsigned OpNo, SmallVectorImpl<MCFixup> &Fixups) const { |