scale.backend.ppc
Class PPCBranch

java.lang.Object
  extended by scale.backend.Instruction
      extended by scale.backend.Branch
          extended by scale.backend.ppc.PPCBranch
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
BFormInstruction, IFormInstruction, SCFormInstruction

public abstract class PPCBranch
extends Branch

This is the abstract class for all machine PPCBranch instructions.

$Id: PPCBranch.java,v 1.4 2006-04-26 18:07:17 burrill Exp $

Copyright 2005 by the Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.


Field Summary
protected  int opcode
          the instruction opcode
protected  boolean pt
          True branch predicted?
 
Constructor Summary
protected PPCBranch(int opcode, boolean pt, int numTargets)
           
 
Method Summary
 java.lang.String assembleDisp(Assembler asm, Displacement disp, int ftn)
          Generate a String representation of a Displacement that can be used by the assembly code generater.
 boolean canBeAnnulled()
          Return true if the branch can be annulled.
 boolean canBeDeleted(RegisterSet registers)
          Return true if the instruction can be deleted without changing program semantics.
 int getOpcode()
          Return the numeric opcode of the instruction.
 boolean getPt()
           
 int instructionSize()
          Return the number of bytes required for the instruction.
 boolean isUnconditional()
          Return true if the branch is an unconditional transfer of control to a new address.
 void setOpcode(int opcode)
           
 
Methods inherited from class scale.backend.Branch
additionalRegsKilled, additionalRegsSet, additionalRegsUsed, addTarget, copy, defs, getBranchProbability, getExecutionCycles, getRegsKilled, getTarget, independent, isBranch, isCall, markAsCall, mods, nullify, numTargets, remapDestRegister, remapRegisters, remapSrcRegister, setBranchProbability, specifyRegisterUsage, toString, uses, uses
 
Methods inherited from class scale.backend.Instruction
assembler, clone, ehash, getBBID, getCopyDest, getCopySrc, getDestRegister, getFunctionalUnit, getLoopNumber, getNext, getPredicate, getPredicates, getSrcRegisters, getTag, isCopy, isLabel, isLoad, isMandatory, isMarker, isPhi, isPredicated, isPredicatedOnTrue, isPrefetch, isSpillInstruction, isSpillLoadPoint, isSpillStorePoint, isStore, markSpillInstruction, nullified, numPredicates, removePredicates, setBBID, setLoopNumber, setMandatory, setNext, setPredicate, setPredicate, setPredicatedOnTrue, setPredicates, setsSpecialReg, setTag, specifyNotSpillLoadPoint, specifySpillStorePoint
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

opcode

protected int opcode
the instruction opcode


pt

protected boolean pt
True branch predicted?

Constructor Detail

PPCBranch

protected PPCBranch(int opcode,
                    boolean pt,
                    int numTargets)
Parameters:
numTargets - is the number of successors of this instruction.
pt - is true if the true condition is predicted For routine calls, it does not include the routine called.
Method Detail

assembleDisp

public java.lang.String assembleDisp(Assembler asm,
                                     Displacement disp,
                                     int ftn)
Generate a String representation of a Displacement that can be used by the assembly code generater.


getOpcode

public final int getOpcode()
Description copied from class: Instruction
Return the numeric opcode of the instruction. This opcode may be an encoding of the actual instruction opcode.

Specified by:
getOpcode in class Instruction

setOpcode

public final void setOpcode(int opcode)

getPt

public boolean getPt()
Returns:
true if the branch is predicited to occur

canBeDeleted

public boolean canBeDeleted(RegisterSet registers)
Return true if the instruction can be deleted without changing program semantics.

Overrides:
canBeDeleted in class Instruction

instructionSize

public int instructionSize()
Description copied from class: Instruction
Return the number of bytes required for the instruction.

Specified by:
instructionSize in class Instruction
Returns:
the number of bytes required for the Branch Instruction

canBeAnnulled

public boolean canBeAnnulled()
Return true if the branch can be annulled.


isUnconditional

public boolean isUnconditional()
Return true if the branch is an unconditional transfer of control to a new address.