Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

Instruction Class Reference

#include <Instruction.h>

List of all members.

Public Member Functions

 Instruction ()
 Instruction (uint32_t bits)
 ~Instruction ()
bool isZero ()
uint32_t bits ()
bool isCondBranch ()
bool isJump ()
bool isReturn ()
bool isCondReturn ()
bool isCall ()
bool isIndirectJump ()
bool isIndirectJumpCtr ()
bool isIndirectJumpLnk ()
bool isOtherBranch ()
bool isAddBeforeJump ()
bool isLoadBeforeJump ()
bool definesLeaders ()
bool hasTargetAddress ()
uint64_t getTargetAddress (uint64_t insnAddr)
bool definesJTEntryCount ()
uint32_t getJTEntryCount ()
bool definesJTBaseAddress ()
int32_t getJTBaseOffsetTOC ()
bool definesJTBaseAddrIndir ()
int32_t getJTBaseAddrIndirOffset ()
void print (uint64_t insnAddr, bool is64Bit)
uint32_t getJTBaseAddrTarget ()
uint32_t getJTBaseAddrIndirSrc ()
uint32_t getLoadBeforeJumpSrc1 ()
bool isMemoryDForm ()
bool isMemoryDsForm ()
bool isMemoryXForm ()
bool isMemoryOperation ()
bool isUnhandledMemoryOp ()
bool isFloatAForm ()
bool isFloatXForm ()
bool isFloatPOperation ()
uint32_t getDFormSrc1 ()
uint32_t getDFormTgt ()
int32_t getDFormImmediate ()
int32_t getDsFormImmediate ()
uint32_t getXFormSrc1 ()
uint32_t getXFormSrc2 ()
bool isMemoryXFormButNoSrc2 ()
bool isMemoryDFormFloat ()

Static Public Member Functions

void print (char *buffer, uint64_t baseAddress, uint32_t sizeInBytes, bool is64Bit)
BitSetinitMemoryOperationXops ()
bool isInJumpInsnRange (uint64_t from, uint64_t to)
bool isInLoadOffsetInsnRange (int32_t value)
Instruction generateCompare (uint32_t reg1, uint32_t reg2, uint32_t field)
Instruction generateJumpInsn (uint64_t from, uint64_t to)
Instruction generateCallToCTR ()
Instruction generateReturnToLnk ()
Instruction generateCallToImmediate (uint64_t from, uint64_t to)
Instruction generateCondBranch (uint32_t field, uint32_t op, uint32_t tf, int32_t distance)
Instruction generateMoveReg (uint32_t from, uint32_t to)
Instruction multiplyImmediate (uint32_t tgt, uint32_t src, int32_t imm)
Instruction generateAdd (uint32_t tgt, uint32_t src1, uint32_t src2)
Instruction generateAddImm (uint32_t tgt, uint32_t src, int32_t value)
Instruction generateIncrement (uint32_t reg, int32_t value)
Instruction generateLoadImmediate (uint32_t reg, int32_t value)
Instruction generateAddImmShifted (uint32_t tgt, uint32_t src, int32_t imm)
Instruction generateLoad32BitHigh (uint32_t reg, int32_t value)
Instruction generateOrImm (uint32_t tgt, uint32_t src, int32_t imm)
Instruction generateLoad32BitLow (uint32_t reg, int32_t value)
Instruction generateXorImm (uint32_t tgt, uint32_t src, int32_t imm)
Instruction generateXorImmShifted (uint32_t tgt, uint32_t src, int32_t imm)
Instruction generateStoreDouble (uint32_t src, uint32_t base, int32_t offset)
Instruction generateLoadDouble (uint32_t tgt, uint32_t base, int32_t offset)
Instruction generateLoadWord (uint32_t tgt, uint32_t base, int32_t offset)
Instruction generateStoreWord (uint32_t src, uint32_t base, int32_t offset)
Instruction generateLoadWordIndx (uint32_t tgt, uint32_t base1, uint32_t base2)
Instruction generateStoreWordIndx (uint32_t src, uint32_t base1, uint32_t base2)
Instruction generateLoadDoubleIndx (uint32_t tgt, uint32_t base1, uint32_t base2)
Instruction generateStoreDoubleIndx (uint32_t src, uint32_t base1, uint32_t base2)
Instruction generateStoreDoubleFloat (uint32_t src, uint32_t base, int32_t offset)
Instruction generateLoadDoubleFloat (uint32_t tgt, uint32_t base, int32_t offset)
Instruction generateStoreWordFloat (uint32_t src, uint32_t base, int32_t offset)
Instruction generateLoadWordFloat (uint32_t tgt, uint32_t base, int32_t offset)
Instruction generateMoveToSPR (uint32_t tgt, uint32_t regcode)
Instruction generateMoveFromSPR (uint32_t tgt, uint32_t regcode)
Instruction generateMoveFromCR (uint32_t tgt)
Instruction generateMoveToCR (uint32_t src)
Instruction generateMoveFromFPSCR (uint32_t tgt)
Instruction generateMoveToFPSCR (uint32_t src)
Instruction generateSPIncrementWord (int32_t offset)
Instruction generateSPIncrementDouble (int32_t offset)
Instruction generateAnd (uint32_t tgt, uint32_t src1, uint32_t src2)

Protected Attributes

PowerPCInstruction ppci

Static Protected Attributes

BitSetmemoryOperationXops = Instruction::initMemoryOperationXops()


Constructor & Destructor Documentation

Instruction::Instruction  )  [inline]
 

Definition at line 67 of file Instruction.h.

References PowerPCInstruction::bits, and ppci.

Instruction::Instruction uint32_t  bits  )  [inline]
 

Definition at line 68 of file Instruction.h.

References PowerPCInstruction::bits, and ppci.

Instruction::~Instruction  )  [inline]
 

Definition at line 69 of file Instruction.h.


Member Function Documentation

uint32_t Instruction::bits  )  [inline]
 

Definition at line 72 of file Instruction.h.

References PowerPCInstruction::bits, and ppci.

Referenced by BasicBlock::findMemoryFloatOps(), CountAllBlocks::generateCodeForInst(), CacheSimulator::generateCodeForInst(), BasicBlockTracer::generateCodeForInst(), and BasicBlockCounter::generateCodeForInst().

bool Instruction::definesJTBaseAddress  ) 
 

Definition at line 182 of file Instruction.C.

References PowerPCInstruction::d, PowerPCInstruction::ds, IS_LD, IS_LWZ, ppci, DsForm::ra, DForm::ra, and REG_TOC.

Referenced by getJTBaseOffsetTOC(), and Function::getJumpTableInformation().

bool Instruction::definesJTBaseAddrIndir  ) 
 

Definition at line 220 of file Instruction.C.

References IS_ADDI, and ppci.

Referenced by getJTBaseAddrIndirOffset(), and Function::getJumpTableInformation().

bool Instruction::definesJTEntryCount  ) 
 

Definition at line 201 of file Instruction.C.

References IS_CMPLI, and ppci.

Referenced by Function::getJumpTableInformation().

bool Instruction::definesLeaders  )  [inline]
 

Definition at line 86 of file Instruction.h.

References isCall(), isCondBranch(), isIndirectJump(), isJump(), and isReturn().

Referenced by BasicBlock::findFirstInstPoint(), and Function::generateCFG().

Instruction Instruction::generateAdd uint32_t  tgt,
uint32_t  src1,
uint32_t  src2
[static]
 

Definition at line 383 of file Instruction.C.

References XoForm::oe, XoForm::opc, opcode_AddOC, ppci, XoForm::ra, XoForm::rb, XoForm::rc, XoForm::rt, xcode_AddOC, XoForm::xo, and PowerPCInstruction::xo.

Referenced by CacheSimulator::generateCodeForInst(), and BasicBlockTracer::generateSharedLibFuncWrapper().

Instruction Instruction::generateAddImm uint32_t  tgt,
uint32_t  src,
int32_t  value
[static]
 

Definition at line 395 of file Instruction.C.

References ASSERT, PowerPCInstruction::d, DForm::d_ui_si, isInLoadOffsetInsnRange(), DForm::opc, opcode_Addi, ppci, DForm::ra, and DForm::rt_s_bf.

Referenced by CacheSimulator::generateCodeForInst(), generateIncrement(), and generateLoadImmediate().

Instruction Instruction::generateAddImmShifted uint32_t  tgt,
uint32_t  src,
int32_t  imm
[static]
 

Definition at line 412 of file Instruction.C.

References ASSERT, PowerPCInstruction::d, DForm::d_ui_si, isInLoadOffsetInsnRange(), DForm::opc, opcode_Addis, ppci, DForm::ra, and DForm::rt_s_bf.

Referenced by generateLoad32BitHigh().

Instruction Instruction::generateAnd uint32_t  tgt,
uint32_t  src1,
uint32_t  src2
[static]
 

Definition at line 436 of file Instruction.C.

References XForm::opc, opcode_AndC, ppci, XForm::ra_sr, XForm::rb_sh, XForm::rc, XForm::rt_s_bf, PowerPCInstruction::x, xcode_AndC, and XForm::xo.

Instruction Instruction::generateCallToCTR  )  [static]
 

Definition at line 652 of file Instruction.C.

References XlForm::ba_bi, XlForm::bb, XlForm::bt_bo, XlForm::lk, XlForm::opc, opcode_BcctrL, ppci, xcode_BcctrL, PowerPCInstruction::xl, and XlForm::xo.

Referenced by CountAllBlocks::generateSharedLibFuncWrapper(), CommonMethods::generateSharedLibFuncWrapper(), and BasicBlockTracer::generateSharedLibFuncWrapper().

Instruction Instruction::generateCallToImmediate uint64_t  from,
uint64_t  to
[static]
 

Definition at line 674 of file Instruction.C.

References generateJumpInsn(), PowerPCInstruction::i, IForm::lk, and ppci.

Referenced by CacheSimulator::generateCodeForInst(), CountAllBlocks::generateFuncCallFull(), and CommonMethods::generateFuncCallFull().

Instruction Instruction::generateCompare uint32_t  reg1,
uint32_t  reg2,
uint32_t  field
[static]
 

Definition at line 714 of file Instruction.C.

References XForm::opc, opcode_Cmpl, ppci, XForm::ra_sr, XForm::rb_sh, XForm::rt_s_bf, PowerPCInstruction::x, xcode_Cmpl, and XForm::xo.

Referenced by CacheSimulator::generateCodeForInst().

Instruction Instruction::generateCondBranch uint32_t  field,
uint32_t  op,
uint32_t  tf,
int32_t  distance
[static]
 

Definition at line 724 of file Instruction.C.

References BForm::aa, ASSERT, PowerPCInstruction::b, BForm::bd, BForm::bi, BForm::bo, isInLoadOffsetInsnRange(), BForm::lk, BForm::opc, opcode_BcLA, and ppci.

Referenced by CacheSimulator::generateCodeForInst().

Instruction Instruction::generateIncrement uint32_t  reg,
int32_t  value
[static]
 

Definition at line 405 of file Instruction.C.

References generateAddImm().

Referenced by CountAllBlocks::generateCodeForInst(), CacheSimulator::generateCodeForInst(), BasicBlockCounter::generateCodeForInst(), CountAllBlocks::generateSharedLibFuncWrapper(), and CommonMethods::generateSharedLibFuncWrapper().

Instruction Instruction::generateJumpInsn uint64_t  from,
uint64_t  to
[static]
 

Definition at line 372 of file Instruction.C.

References IForm::aa, ASSERT, PowerPCInstruction::i, isInJumpInsnRange(), IForm::li, IForm::lk, IForm::opc, opcode_BLA, and ppci.

Referenced by generateCallToImmediate(), CountAllBlocks::generateCodeForInst(), CacheSimulator::generateCodeForInst(), BasicBlockTracer::generateCodeForInst(), and BasicBlockCounter::generateCodeForInst().

Instruction Instruction::generateLoad32BitHigh uint32_t  reg,
int32_t  value
[static]
 

Definition at line 421 of file Instruction.C.

References generateAddImmShifted().

Referenced by CountAllBlocks::generateCodeForInst(), CacheSimulator::generateCodeForInst(), BasicBlockTracer::generateCodeForInst(), BasicBlockCounter::generateCodeForInst(), CountAllBlocks::generateSharedLibFuncWrapper(), and CommonMethods::generateSharedLibFuncWrapper().

Instruction Instruction::generateLoad32BitLow uint32_t  reg,
int32_t  value
[static]
 

Definition at line 432 of file Instruction.C.

References generateOrImm().

Referenced by CountAllBlocks::generateCodeForInst(), CacheSimulator::generateCodeForInst(), BasicBlockTracer::generateCodeForInst(), BasicBlockCounter::generateCodeForInst(), CountAllBlocks::generateSharedLibFuncWrapper(), and CommonMethods::generateSharedLibFuncWrapper().

Instruction Instruction::generateLoadDouble uint32_t  tgt,
uint32_t  base,
int32_t  offset
[static]
 

Definition at line 526 of file Instruction.C.

References ASSERT, DsForm::ds, PowerPCInstruction::ds, isInLoadOffsetInsnRange(), DsForm::opc, opcode_Ld, ppci, DsForm::ra, DsForm::rt_s, xcode_Ld, and DsForm::xo.

Referenced by CountAllBlocks::generateCodeForInst(), CacheSimulator::generateCodeForInst(), BasicBlockTracer::generateCodeForInst(), BasicBlockCounter::generateCodeForInst(), CountAllBlocks::generateFuncCallFull(), CountAllBlocks::generateSharedLibFuncWrapper(), CommonMethods::generateSharedLibFuncWrapper(), BasicBlockTracer::generateSharedLibFuncWrapper(), CommonMethods::restCTRRegister(), CommonMethods::restEXRRegister(), and CommonMethods::restLNKRegister().

Instruction Instruction::generateLoadDoubleFloat uint32_t  tgt,
uint32_t  base,
int32_t  offset
[static]
 

Definition at line 483 of file Instruction.C.

References ASSERT, PowerPCInstruction::d, DForm::d_ui_si, isInLoadOffsetInsnRange(), DForm::opc, opcode_Lfd, ppci, DForm::ra, and DForm::rt_s_bf.

Referenced by CountAllBlocks::generateSharedLibFuncWrapper(), CommonMethods::generateSharedLibFuncWrapper(), and BasicBlockTracer::generateSharedLibFuncWrapper().

Instruction Instruction::generateLoadDoubleIndx uint32_t  tgt,
uint32_t  base1,
uint32_t  base2
[static]
 

Definition at line 570 of file Instruction.C.

References XForm::opc, opcode_Ldx, ppci, XForm::ra_sr, XForm::rb_sh, XForm::rc, XForm::rt_s_bf, PowerPCInstruction::x, xcode_Ldx, and XForm::xo.

Referenced by CountAllBlocks::generateCodeForInst(), CacheSimulator::generateCodeForInst(), and BasicBlockCounter::generateCodeForInst().

Instruction Instruction::generateLoadImmediate uint32_t  reg,
int32_t  value
[static]
 

Definition at line 408 of file Instruction.C.

References generateAddImm().

Referenced by CacheSimulator::generateCodeForInst().

Instruction Instruction::generateLoadWord uint32_t  tgt,
uint32_t  base,
int32_t  offset
[static]
 

Definition at line 591 of file Instruction.C.

References ASSERT, PowerPCInstruction::d, DForm::d_ui_si, isInLoadOffsetInsnRange(), DForm::opc, opcode_Lwz, ppci, DForm::ra, and DForm::rt_s_bf.

Referenced by CountAllBlocks::generateCodeForInst(), CacheSimulator::generateCodeForInst(), BasicBlockCounter::generateCodeForInst(), CountAllBlocks::generateFuncCallFull(), CountAllBlocks::generateSharedLibFuncWrapper(), CommonMethods::generateSharedLibFuncWrapper(), BasicBlockTracer::generateSharedLibFuncWrapper(), and CommonMethods::restCRRegister().

Instruction Instruction::generateLoadWordFloat uint32_t  tgt,
uint32_t  base,
int32_t  offset
[static]
 

Definition at line 503 of file Instruction.C.

References ASSERT, PowerPCInstruction::d, DForm::d_ui_si, isInLoadOffsetInsnRange(), DForm::opc, opcode_Lfs, ppci, DForm::ra, and DForm::rt_s_bf.

Referenced by CountAllBlocks::generateSharedLibFuncWrapper(), and CommonMethods::restFPSCRRegister().

Instruction Instruction::generateLoadWordIndx uint32_t  tgt,
uint32_t  base1,
uint32_t  base2
[static]
 

Definition at line 549 of file Instruction.C.

References XForm::opc, opcode_Lwzx, ppci, XForm::ra_sr, XForm::rb_sh, XForm::rc, XForm::rt_s_bf, PowerPCInstruction::x, xcode_Lwzx, and XForm::xo.

Referenced by CountAllBlocks::generateCodeForInst(), CacheSimulator::generateCodeForInst(), and BasicBlockCounter::generateCodeForInst().

Instruction Instruction::generateMoveFromCR uint32_t  tgt  )  [static]
 

Definition at line 618 of file Instruction.C.

References XfxForm::opc, opcode_Mfcr, ppci, XfxForm::rt_rs, XfxForm::spr_tbr, xcode_Mfcr, PowerPCInstruction::xfx, and XfxForm::xo.

Referenced by CountAllBlocks::generateFuncCallFull(), and CommonMethods::saveCRRegister().

Instruction Instruction::generateMoveFromFPSCR uint32_t  tgt  )  [static]
 

Definition at line 634 of file Instruction.C.

References XForm::opc, opcode_MffsC, ppci, XForm::rc, XForm::rt_s_bf, PowerPCInstruction::x, xcode_MffsC, and XForm::xo.

Referenced by CountAllBlocks::generateSharedLibFuncWrapper(), and CommonMethods::saveFPSCRRegister().

Instruction Instruction::generateMoveFromSPR uint32_t  tgt,
uint32_t  regcode
[static]
 

Definition at line 610 of file Instruction.C.

References XfxForm::opc, opcode_Mfspr, ppci, XfxForm::rt_rs, XfxForm::spr_tbr, xcode_Mfspr, PowerPCInstruction::xfx, and XfxForm::xo.

Referenced by CountAllBlocks::generateFuncCallFull(), CountAllBlocks::generateSharedLibFuncWrapper(), CommonMethods::generateSharedLibFuncWrapper(), BasicBlockTracer::generateSharedLibFuncWrapper(), CommonMethods::saveCTRRegister(), CommonMethods::saveEXRRegister(), and CommonMethods::saveLNKRegister().

Instruction Instruction::generateMoveReg uint32_t  from,
uint32_t  to
[static]
 

Definition at line 680 of file Instruction.C.

References XForm::opc, opcode_OrC, ppci, XForm::ra_sr, XForm::rb_sh, XForm::rc, XForm::rt_s_bf, PowerPCInstruction::x, xcode_OrC, and XForm::xo.

Referenced by CountAllBlocks::generateSharedLibFuncWrapper(), CommonMethods::generateSharedLibFuncWrapper(), and BasicBlockTracer::generateSharedLibFuncWrapper().

Instruction Instruction::generateMoveToCR uint32_t  src  )  [static]
 

Definition at line 626 of file Instruction.C.

References XfxForm::opc, opcode_Mtcrf, ppci, XfxForm::rt_rs, XfxForm::spr_tbr, xcode_Mtcrf, PowerPCInstruction::xfx, and XfxForm::xo.

Referenced by CountAllBlocks::generateFuncCallFull(), and CommonMethods::restCRRegister().

Instruction Instruction::generateMoveToFPSCR uint32_t  src  )  [static]
 

Definition at line 642 of file Instruction.C.

References XflForm::flm, XflForm::frb, XflForm::opc, opcode_MtfsfC, ppci, XflForm::rc, xcode_MtfsfC, PowerPCInstruction::xfl, and XflForm::xo.

Referenced by CountAllBlocks::generateSharedLibFuncWrapper(), and CommonMethods::restFPSCRRegister().

Instruction Instruction::generateMoveToSPR uint32_t  tgt,
uint32_t  regcode
[static]
 

Definition at line 601 of file Instruction.C.

References XfxForm::opc, opcode_Mtspr, ppci, XfxForm::rt_rs, XfxForm::spr_tbr, xcode_Mtspr, PowerPCInstruction::xfx, and XfxForm::xo.

Referenced by CountAllBlocks::generateFuncCallFull(), CountAllBlocks::generateSharedLibFuncWrapper(), CommonMethods::generateSharedLibFuncWrapper(), BasicBlockTracer::generateSharedLibFuncWrapper(), CommonMethods::restCTRRegister(), CommonMethods::restEXRRegister(), and CommonMethods::restLNKRegister().

Instruction Instruction::generateOrImm uint32_t  tgt,
uint32_t  src,
int32_t  imm
[static]
 

Definition at line 424 of file Instruction.C.

References PowerPCInstruction::d, DForm::d_ui_si, DForm::opc, opcode_Ori, ppci, DForm::ra, and DForm::rt_s_bf.

Referenced by generateLoad32BitLow().

Instruction Instruction::generateReturnToLnk  )  [static]
 

Definition at line 663 of file Instruction.C.

References XlForm::ba_bi, XlForm::bb, XlForm::bt_bo, XlForm::lk, XlForm::opc, opcode_BclrL, ppci, xcode_BclrL, PowerPCInstruction::xl, and XlForm::xo.

Referenced by CountAllBlocks::generateSharedLibFuncWrapper(), CommonMethods::generateSharedLibFuncWrapper(), and BasicBlockTracer::generateSharedLibFuncWrapper().

Instruction Instruction::generateSPIncrementDouble int32_t  offset  )  [static]
 

Definition at line 701 of file Instruction.C.

References ASSERT, DsForm::ds, PowerPCInstruction::ds, isInLoadOffsetInsnRange(), DsForm::opc, opcode_Stdu, ppci, DsForm::ra, REG_SP, DsForm::rt_s, xcode_Stdu, and DsForm::xo.

Referenced by CountAllBlocks::generateSharedLibFuncWrapper(), CommonMethods::generateSharedLibFuncWrapper(), and BasicBlockTracer::generateSharedLibFuncWrapper().

Instruction Instruction::generateSPIncrementWord int32_t  offset  )  [static]
 

Definition at line 691 of file Instruction.C.

References ASSERT, PowerPCInstruction::d, DForm::d_ui_si, isInLoadOffsetInsnRange(), DForm::opc, opcode_Stwu, ppci, DForm::ra, REG_SP, and DForm::rt_s_bf.

Referenced by CountAllBlocks::generateSharedLibFuncWrapper(), CommonMethods::generateSharedLibFuncWrapper(), and BasicBlockTracer::generateSharedLibFuncWrapper().

Instruction Instruction::generateStoreDouble uint32_t  src,
uint32_t  base,
int32_t  offset
[static]
 

Definition at line 514 of file Instruction.C.

References ASSERT, DsForm::ds, PowerPCInstruction::ds, isInLoadOffsetInsnRange(), DsForm::opc, opcode_Std, ppci, DsForm::ra, DsForm::rt_s, xcode_Std, and DsForm::xo.

Referenced by CountAllBlocks::generateCodeForInst(), CacheSimulator::generateCodeForInst(), BasicBlockTracer::generateCodeForInst(), BasicBlockCounter::generateCodeForInst(), CountAllBlocks::generateFuncCallFull(), CountAllBlocks::generateSharedLibFuncWrapper(), CommonMethods::generateSharedLibFuncWrapper(), BasicBlockTracer::generateSharedLibFuncWrapper(), CommonMethods::saveCTRRegister(), CommonMethods::saveEXRRegister(), and CommonMethods::saveLNKRegister().

Instruction Instruction::generateStoreDoubleFloat uint32_t  src,
uint32_t  base,
int32_t  offset
[static]
 

Definition at line 473 of file Instruction.C.

References ASSERT, PowerPCInstruction::d, DForm::d_ui_si, isInLoadOffsetInsnRange(), DForm::opc, opcode_Stfd, ppci, DForm::ra, and DForm::rt_s_bf.

Referenced by CountAllBlocks::generateSharedLibFuncWrapper(), CommonMethods::generateSharedLibFuncWrapper(), and BasicBlockTracer::generateSharedLibFuncWrapper().

Instruction Instruction::generateStoreDoubleIndx uint32_t  src,
uint32_t  base1,
uint32_t  base2
[static]
 

Definition at line 580 of file Instruction.C.

References XForm::opc, opcode_Stdx, ppci, XForm::ra_sr, XForm::rb_sh, XForm::rc, XForm::rt_s_bf, PowerPCInstruction::x, xcode_Stdx, and XForm::xo.

Referenced by CountAllBlocks::generateCodeForInst(), CacheSimulator::generateCodeForInst(), and BasicBlockCounter::generateCodeForInst().

Instruction Instruction::generateStoreWord uint32_t  src,
uint32_t  base,
int32_t  offset
[static]
 

Definition at line 539 of file Instruction.C.

References ASSERT, PowerPCInstruction::d, DForm::d_ui_si, isInLoadOffsetInsnRange(), DForm::opc, opcode_Stw, ppci, DForm::ra, and DForm::rt_s_bf.

Referenced by CountAllBlocks::generateCodeForInst(), CacheSimulator::generateCodeForInst(), BasicBlockCounter::generateCodeForInst(), CountAllBlocks::generateFuncCallFull(), and CommonMethods::saveCRRegister().

Instruction Instruction::generateStoreWordFloat uint32_t  src,
uint32_t  base,
int32_t  offset
[static]
 

Definition at line 493 of file Instruction.C.

References ASSERT, PowerPCInstruction::d, DForm::d_ui_si, isInLoadOffsetInsnRange(), DForm::opc, opcode_Stfs, ppci, DForm::ra, and DForm::rt_s_bf.

Referenced by CountAllBlocks::generateSharedLibFuncWrapper(), and CommonMethods::saveFPSCRRegister().

Instruction Instruction::generateStoreWordIndx uint32_t  src,
uint32_t  base1,
uint32_t  base2
[static]
 

Definition at line 559 of file Instruction.C.

References XForm::opc, opcode_Stwx, ppci, XForm::ra_sr, XForm::rb_sh, XForm::rc, XForm::rt_s_bf, PowerPCInstruction::x, xcode_Stwx, and XForm::xo.

Referenced by CountAllBlocks::generateCodeForInst(), CacheSimulator::generateCodeForInst(), and BasicBlockCounter::generateCodeForInst().

Instruction Instruction::generateXorImm uint32_t  tgt,
uint32_t  src,
int32_t  imm
[static]
 

Definition at line 447 of file Instruction.C.

References PowerPCInstruction::d, DForm::d_ui_si, DForm::opc, opcode_Xori, ppci, DForm::ra, and DForm::rt_s_bf.

Referenced by CountAllBlocks::updateTOCRegister(), and CommonMethods::updateTOCRegister().

Instruction Instruction::generateXorImmShifted uint32_t  tgt,
uint32_t  src,
int32_t  imm
[static]
 

Definition at line 455 of file Instruction.C.

References PowerPCInstruction::d, DForm::d_ui_si, DForm::opc, opcode_Xoris, ppci, DForm::ra, and DForm::rt_s_bf.

Referenced by CountAllBlocks::updateTOCRegister(), and CommonMethods::updateTOCRegister().

int32_t Instruction::getDFormImmediate  ) 
 

Definition at line 333 of file Instruction.C.

References PowerPCInstruction::d, DForm::d_ui_si, and ppci.

Referenced by MemoryOperation::getAddressOperand2().

uint32_t Instruction::getDFormSrc1  ) 
 

Definition at line 325 of file Instruction.C.

References PowerPCInstruction::d, ppci, and DForm::ra.

Referenced by MemoryOperation::getAddressOperand1().

uint32_t Instruction::getDFormTgt  ) 
 

Definition at line 329 of file Instruction.C.

References PowerPCInstruction::d, ppci, and DForm::rt_s_bf.

Referenced by CacheSimulator::byteCountForInst(), and CacheSimulator::generateCodeForInst().

int32_t Instruction::getDsFormImmediate  ) 
 

Definition at line 337 of file Instruction.C.

References DsForm::ds, PowerPCInstruction::ds, and ppci.

Referenced by MemoryOperation::getAddressOperand2().

int32_t Instruction::getJTBaseAddrIndirOffset  ) 
 

Definition at line 224 of file Instruction.C.

References ASSERT, PowerPCInstruction::d, DForm::d_ui_si, definesJTBaseAddrIndir(), and ppci.

Referenced by Function::getJumpTableInformation().

uint32_t Instruction::getJTBaseAddrIndirSrc  ) 
 

Definition at line 229 of file Instruction.C.

References PowerPCInstruction::d, ppci, and DForm::ra.

Referenced by Function::getJumpTableInformation().

uint32_t Instruction::getJTBaseAddrTarget  ) 
 

Definition at line 197 of file Instruction.C.

References PowerPCInstruction::d, ppci, and DForm::rt_s_bf.

Referenced by Function::getJumpTableInformation().

int32_t Instruction::getJTBaseOffsetTOC  ) 
 

Definition at line 189 of file Instruction.C.

References ASSERT, PowerPCInstruction::d, DForm::d_ui_si, definesJTBaseAddress(), DsForm::ds, PowerPCInstruction::ds, IS_LD, IS_LWZ, and ppci.

Referenced by Function::getJumpTableInformation().

uint32_t Instruction::getJTEntryCount  ) 
 

Definition at line 204 of file Instruction.C.

References PowerPCInstruction::d, DForm::d_ui_si, and ppci.

Referenced by Function::getJumpTableInformation().

uint32_t Instruction::getLoadBeforeJumpSrc1  ) 
 

Definition at line 216 of file Instruction.C.

References ppci, XForm::ra_sr, and PowerPCInstruction::x.

Referenced by Function::getJumpTableInformation().

uint64_t Instruction::getTargetAddress uint64_t  insnAddr  ) 
 

Definition at line 97 of file Instruction.C.

References LkForm::aa, ASSERT, PowerPCInstruction::b, BForm::bd, PowerPCInstruction::i, IS_B, IS_BC, isCondBranch(), isJump(), IForm::li, PowerPCInstruction::lk, and ppci.

Referenced by Function::generateCFG().

uint32_t Instruction::getXFormSrc1  ) 
 

Definition at line 341 of file Instruction.C.

References ppci, XForm::ra_sr, and PowerPCInstruction::x.

Referenced by MemoryOperation::getAddressOperand1().

uint32_t Instruction::getXFormSrc2  ) 
 

Definition at line 345 of file Instruction.C.

References ppci, XForm::rb_sh, and PowerPCInstruction::x.

Referenced by MemoryOperation::getAddressOperand2().

bool Instruction::hasTargetAddress  )  [inline]
 

Definition at line 89 of file Instruction.h.

References isCondBranch(), and isJump().

Referenced by Function::generateCFG().

BitSet * Instruction::initMemoryOperationXops  )  [static]
 

Definition at line 27 of file Instruction.C.

References BitSet< T >::insert(), INVALID_XOP, xcode_Lbzux, xcode_Lbzx, xcode_Ldarx, xcode_Ldux, xcode_Ldx, xcode_Lfdux, xcode_Lfdx, xcode_Lfsux, xcode_Lfsx, xcode_Lhaux, xcode_Lhax, xcode_Lhbrx, xcode_Lhzux, xcode_Lhzx, xcode_LscbxC, xcode_Lswi, xcode_Lswx, xcode_Lwarx, xcode_Lwaux, xcode_Lwax, xcode_Lwbrx, xcode_Lwzux, xcode_Lwzx, xcode_Stbux, xcode_Stbx, xcode_Stdcxc, xcode_Stdux, xcode_Stdx, xcode_Stfdux, xcode_Stfdx, xcode_Stfiwx, xcode_Stfsux, xcode_Stfsx, xcode_Sthbrx, xcode_Sthux, xcode_Sthx, xcode_Stswi, xcode_Stswx, xcode_Stwbrx, xcode_Stwcxc, xcode_Stwux, and xcode_Stwx.

bool Instruction::isAddBeforeJump  ) 
 

Definition at line 208 of file Instruction.C.

References IS_ADD, and ppci.

Referenced by Function::getJumpTableInformation().

bool Instruction::isCall  ) 
 

Definition at line 83 of file Instruction.C.

References PowerPCInstruction::b, BForm::bo, BRANCH_ALWAYS, XlForm::bt_bo, IS_B, IS_BC, IS_BCCTR, IS_BCLR, LkForm::lk, PowerPCInstruction::lk, ppci, and PowerPCInstruction::xl.

Referenced by definesLeaders(), Function::generateCFG(), and print().

bool Instruction::isCondBranch  ) 
 

Definition at line 45 of file Instruction.C.

References PowerPCInstruction::b, BForm::bo, BRANCH_ALWAYS, IS_BC, LkForm::lk, PowerPCInstruction::lk, and ppci.

Referenced by definesLeaders(), Function::generateCFG(), getTargetAddress(), hasTargetAddress(), and print().

bool Instruction::isCondReturn  ) 
 

Definition at line 74 of file Instruction.C.

References BRANCH_ALWAYS, XlForm::bt_bo, IS_BCLR, LkForm::lk, PowerPCInstruction::lk, ppci, and PowerPCInstruction::xl.

Referenced by Function::generateCFG(), isReturn(), and print().

bool Instruction::isFloatAForm  ) 
 

Definition at line 313 of file Instruction.C.

References FOP_AFORM_MASK, FOP_AFORM_MATCH, OcForm::opc, PowerPCInstruction::opc, opcode_Fcmpu, opcode_FdivsC, ppci, PowerPCInstruction::x, and XForm::xo.

Referenced by isFloatPOperation(), and print().

bool Instruction::isFloatPOperation  )  [inline]
 

Definition at line 120 of file Instruction.h.

References isFloatAForm(), and isFloatXForm().

Referenced by BasicBlock::findMemoryFloatOps().

bool Instruction::isFloatXForm  ) 
 

Definition at line 318 of file Instruction.C.

References FOP_AFORM_MASK, FOP_AFORM_MATCH, FOP_CONDREG_MASK, FOP_CONDREG_MATCH, OcForm::opc, PowerPCInstruction::opc, opcode_Fcmpu, ppci, PowerPCInstruction::x, xcode_Mcrfs, and XForm::xo.

Referenced by isFloatPOperation(), and print().

bool Instruction::isIndirectJump  ) 
 

Definition at line 146 of file Instruction.C.

References isIndirectJumpCtr(), and isIndirectJumpLnk().

Referenced by definesLeaders(), Function::generateCFG(), and print().

bool Instruction::isIndirectJumpCtr  ) 
 

Definition at line 150 of file Instruction.C.

References BRANCH_ALWAYS, XlForm::bt_bo, IS_BCCTR, LkForm::lk, PowerPCInstruction::lk, ppci, and PowerPCInstruction::xl.

Referenced by Function::getJumpTableInformation(), isIndirectJump(), and Function::parseJumpTable().

bool Instruction::isIndirectJumpLnk  ) 
 

Definition at line 157 of file Instruction.C.

References BRANCH_ALWAYS, XlForm::bt_bo, GET_BH, IS_BCLR, LkForm::lk, PowerPCInstruction::lk, ppci, and PowerPCInstruction::xl.

Referenced by Function::getJumpTableInformation(), and isIndirectJump().

bool Instruction::isInJumpInsnRange uint64_t  from,
uint64_t  to
[static]
 

Definition at line 362 of file Instruction.C.

References ASSERT.

Referenced by CountAllBlocks::byteCountForInst(), CacheSimulator::byteCountForInst(), BasicBlockTracer::byteCountForInst(), BasicBlockCounter::byteCountForInst(), CountAllBlocks::generateCodeForInst(), CacheSimulator::generateCodeForInst(), BasicBlockTracer::generateCodeForInst(), BasicBlockCounter::generateCodeForInst(), and generateJumpInsn().

bool Instruction::isInLoadOffsetInsnRange int32_t  value  )  [static]
 

Definition at line 354 of file Instruction.C.

Referenced by CountAllBlocks::byteCountForInst(), CacheSimulator::byteCountForInst(), BasicBlockCounter::byteCountForInst(), generateAddImm(), generateAddImmShifted(), CountAllBlocks::generateCodeForInst(), CacheSimulator::generateCodeForInst(), BasicBlockCounter::generateCodeForInst(), generateCondBranch(), generateLoadDouble(), generateLoadDoubleFloat(), generateLoadWord(), generateLoadWordFloat(), generateSPIncrementDouble(), generateSPIncrementWord(), generateStoreDouble(), generateStoreDoubleFloat(), generateStoreWord(), generateStoreWordFloat(), multiplyImmediate(), CountAllBlocks::reserveDataForInstrumentation(), CommonMethods::reserveDataForInstrumentation(), BasicBlockTracer::reserveDataForInstrumentation(), and CacheSimulator::selectInstrumentationPoints().

bool Instruction::isJump  ) 
 

Definition at line 53 of file Instruction.C.

References PowerPCInstruction::b, BForm::bo, BRANCH_ALWAYS, IS_B, IS_BC, LkForm::lk, PowerPCInstruction::lk, and ppci.

Referenced by definesLeaders(), getTargetAddress(), hasTargetAddress(), and print().

bool Instruction::isLoadBeforeJump  ) 
 

Definition at line 212 of file Instruction.C.

References IS_LDX, IS_LWZX, and ppci.

Referenced by Function::getJumpTableInformation().

bool Instruction::isMemoryDForm  ) 
 

Definition at line 295 of file Instruction.C.

References OcForm::opc, PowerPCInstruction::opc, opcode_Lwz, opcode_Stfdu, and ppci.

Referenced by CacheSimulator::byteCountForInst(), CacheSimulator::generateCodeForInst(), MemoryOperation::isDForm(), isMemoryOperation(), and print().

bool Instruction::isMemoryDFormFloat  ) 
 

Definition at line 738 of file Instruction.C.

References OcForm::opc, PowerPCInstruction::opc, opcode_Lfs, opcode_Stfdu, and ppci.

Referenced by CacheSimulator::byteCountForInst(), and CacheSimulator::generateCodeForInst().

bool Instruction::isMemoryDsForm  ) 
 

Definition at line 299 of file Instruction.C.

References OcForm::opc, PowerPCInstruction::opc, opcode_Ld, opcode_Std, and ppci.

Referenced by CacheSimulator::byteCountForInst(), CacheSimulator::generateCodeForInst(), MemoryOperation::isDsForm(), isMemoryOperation(), and print().

bool Instruction::isMemoryOperation  )  [inline]
 

Definition at line 115 of file Instruction.h.

References isMemoryDForm(), isMemoryDsForm(), and isMemoryXForm().

Referenced by BasicBlock::findMemoryFloatOps(), and MemoryOperation::MemoryOperation().

bool Instruction::isMemoryXForm  ) 
 

Definition at line 303 of file Instruction.C.

References BitSet< T >::contains(), memoryOperationXops, OcForm::opc, PowerPCInstruction::opc, opcode_Lwarx, ppci, PowerPCInstruction::x, and XForm::xo.

Referenced by isMemoryOperation(), MemoryOperation::isXForm(), and print().

bool Instruction::isMemoryXFormButNoSrc2  ) 
 

Definition at line 349 of file Instruction.C.

References IS_LSWI, IS_STSWI, and ppci.

Referenced by MemoryOperation::getAddressOperand2().

bool Instruction::isOtherBranch  ) 
 

Definition at line 166 of file Instruction.C.

References BRANCH_ALWAYS, XlForm::bt_bo, IS_BCCTR, IS_BCLR, LkForm::lk, PowerPCInstruction::lk, ppci, and PowerPCInstruction::xl.

Referenced by Function::generateCFG().

bool Instruction::isReturn  ) 
 

Definition at line 64 of file Instruction.C.

References BRANCH_ALWAYS, XlForm::bt_bo, GET_BH, IS_BCLR, isCondReturn(), LkForm::lk, PowerPCInstruction::lk, ppci, and PowerPCInstruction::xl.

Referenced by definesLeaders(), Function::generateCFG(), and print().

bool Instruction::isUnhandledMemoryOp  ) 
 

Definition at line 307 of file Instruction.C.

References BitSet< T >::contains(), MEMORY_MASK, MEMORY_MATCH, memoryOperationXops, OcForm::opc, PowerPCInstruction::opc, opcode_Lwarx, ppci, PowerPCInstruction::x, and XForm::xo.

Referenced by BasicBlock::findMemoryFloatOps(), and print().

bool Instruction::isZero  )  [inline]
 

Definition at line 71 of file Instruction.h.

References PowerPCInstruction::bits, and ppci.

Referenced by Function::generateCFG(), and Function::updateInstructionSize().

Instruction Instruction::multiplyImmediate uint32_t  tgt,
uint32_t  src,
int32_t  imm
[static]
 

Definition at line 463 of file Instruction.C.

References ASSERT, PowerPCInstruction::d, DForm::d_ui_si, isInLoadOffsetInsnRange(), DForm::opc, opcode_Mulli, ppci, DForm::ra, and DForm::rt_s_bf.

Referenced by CacheSimulator::generateCodeForInst().

void Instruction::print char *  buffer,
uint64_t  baseAddress,
uint32_t  sizeInBytes,
bool  is64Bit
[static]
 

Definition at line 283 of file Instruction.C.

References print().

void Instruction::print uint64_t  insnAddr,
bool  is64Bit
 

Definition at line 243 of file Instruction.C.

References PowerPCInstruction::bits, isCall(), isCondBranch(), isCondReturn(), isFloatAForm(), isFloatXForm(), isIndirectJump(), isJump(), isMemoryDForm(), isMemoryDsForm(), isMemoryXForm(), isReturn(), isUnhandledMemoryOp(), ppci, PRINT_DEBUG, and print_insn_powerpc_for_meminst().

Referenced by print(), and BasicBlock::print().


Member Data Documentation

BitSet * Instruction::memoryOperationXops = Instruction::initMemoryOperationXops() [static, protected]
 

Definition at line 25 of file Instruction.C.

Referenced by isMemoryXForm(), and isUnhandledMemoryOp().

PowerPCInstruction Instruction::ppci [protected]
 

Definition at line 64 of file Instruction.h.

Referenced by bits(), definesJTBaseAddress(), definesJTBaseAddrIndir(), definesJTEntryCount(), generateAdd(), generateAddImm(), generateAddImmShifted(), generateAnd(), generateCallToCTR(), generateCallToImmediate(), generateCompare(), generateCondBranch(), generateJumpInsn(), generateLoadDouble(), generateLoadDoubleFloat(), generateLoadDoubleIndx(), generateLoadWord(), generateLoadWordFloat(), generateLoadWordIndx(), generateMoveFromCR(), generateMoveFromFPSCR(), generateMoveFromSPR(), generateMoveReg(), generateMoveToCR(), generateMoveToFPSCR(), generateMoveToSPR(), generateOrImm(), generateReturnToLnk(), generateSPIncrementDouble(), generateSPIncrementWord(), generateStoreDouble(), generateStoreDoubleFloat(), generateStoreDoubleIndx(), generateStoreWord(), generateStoreWordFloat(), generateStoreWordIndx(), generateXorImm(), generateXorImmShifted(), getDFormImmediate(), getDFormSrc1(), getDFormTgt(), getDsFormImmediate(), getJTBaseAddrIndirOffset(), getJTBaseAddrIndirSrc(), getJTBaseAddrTarget(), getJTBaseOffsetTOC(), getJTEntryCount(), getLoadBeforeJumpSrc1(), getTargetAddress(), getXFormSrc1(), getXFormSrc2(), Instruction(), isAddBeforeJump(), isCall(), isCondBranch(), isCondReturn(), isFloatAForm(), isFloatXForm(), isIndirectJumpCtr(), isIndirectJumpLnk(), isJump(), isLoadBeforeJump(), isMemoryDForm(), isMemoryDFormFloat(), isMemoryDsForm(), isMemoryXForm(), isMemoryXFormButNoSrc2(), isOtherBranch(), isReturn(), isUnhandledMemoryOp(), isZero(), multiplyImmediate(), and print().


The documentation for this class was generated from the following files:
Generated on Mon Jan 28 11:08:39 2008 for PMaCInstrumentor by doxygen 1.3.5