scale.backend.sparc
Class BranchCCInstruction

java.lang.Object
  extended by scale.backend.Instruction
      extended by scale.backend.Branch
          extended by scale.backend.sparc.SparcBranch
              extended by scale.backend.sparc.BranchCCInstruction
All Implemented Interfaces:
java.lang.Cloneable

public class BranchCCInstruction
extends SparcBranch

This class represents Sparc Branch on CC register instructions.

$Id: BranchCCInstruction.java,v 1.18 2007-10-04 19:57:56 burrill Exp $

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

Instance=03, Op=00, op2=x01

It is important that the branch target always be target 0 and the fall through target be target 1.

See Also:
Branch.addTarget(scale.backend.Label, int)

Field Summary
protected  int cc
          The condition code.
protected  Displacement displacement
          The displacement.
 
Fields inherited from class scale.backend.sparc.SparcBranch
annulled, delaySlot, opcode, pt
 
Constructor Summary
BranchCCInstruction(int opcode, int cc, Displacement displacement, boolean annulled, int numTargets, SparcInstruction delaySlot)
           
 
Method Summary
 void assembler(Assembler asm, Emit emit)
          Insert the assembler representation of the instruction into the output stream.
 boolean canBeAnnulled()
          Return true if the branch can be annulled.
 boolean independent(Instruction inst, RegisterSet registers)
          Return true if this instruction is independent of the specified instruction.
 boolean isUnconditional()
          Return true if the branch is an unconditional transfer of control to a new address.
 void setDisplacement(Displacement displacement)
          After all of the instructions have been created, the Sparc Branch displacements must be calculated.
 java.lang.String toString()
           
 
Methods inherited from class scale.backend.sparc.SparcBranch
assembleDelay, assembleDisp, canBeDeleted, defs, delayToStringBuf, getAnnulled, getDelaySlot, getOpcode, getPt, instructionSize, mods, remapDestRegister, remapRegisters, remapSrcRegister, setAnnulled, setDelaySlot, setOpcode, setReturnedStructSize, specifyRegisterUsage, uses
 
Methods inherited from class scale.backend.Branch
additionalRegsKilled, additionalRegsSet, additionalRegsUsed, addTarget, copy, getBranchProbability, getExecutionCycles, getRegsKilled, getTarget, isBranch, isCall, markAsCall, nullify, numTargets, setBranchProbability, uses
 
Methods inherited from class scale.backend.Instruction
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

displacement

protected Displacement displacement
The displacement.


cc

protected int cc
The condition code.

Constructor Detail

BranchCCInstruction

public BranchCCInstruction(int opcode,
                           int cc,
                           Displacement displacement,
                           boolean annulled,
                           int numTargets,
                           SparcInstruction delaySlot)
Method Detail

setDisplacement

public void setDisplacement(Displacement displacement)
After all of the instructions have been created, the Sparc Branch displacements must be calculated. This must be done prior to generating the assembly file.


independent

public boolean independent(Instruction inst,
                           RegisterSet registers)
Return true if this instruction is independent of the specified instruction. If instructions are independent, than one instruction can be moved before or after the other instruction without changing the semantics of the program.

Overrides:
independent in class Branch
Parameters:
inst - is the specified instruction

assembler

public void assembler(Assembler asm,
                      Emit emit)
Insert the assembler representation of the instruction into the output stream.

Specified by:
assembler in class Instruction

toString

public java.lang.String toString()
Overrides:
toString in class Branch

canBeAnnulled

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

Overrides:
canBeAnnulled in class SparcBranch

isUnconditional

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

Overrides:
isUnconditional in class SparcBranch