|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object scale.backend.Instruction
public abstract class Instruction
This is the abstract class for all machine instructions including Markers.
$Id: Instruction.java,v 1.57 2007-10-17 23:21:34 bmaher Exp $
Copyright 2008 by the
Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.
Constructor Summary | |
---|---|
protected |
Instruction()
|
Method Summary | |
---|---|
abstract void |
assembler(Assembler asm,
Emit emit)
Insert the assembler representation of the instruction into the output stream. |
boolean |
canBeDeleted(RegisterSet registers)
Return true if the instruction can be deleted without changing the program's semantics. |
java.lang.Object |
clone()
Clone the instruction. |
Instruction |
copy()
Make a copy of this instruction. |
boolean |
defs(int register,
RegisterSet registers)
Return true if the instruction sets the register. |
int |
ehash()
Return a hash code that can be used to determine equivalence. |
int |
getBBID()
Get the basic block number of the instruction. |
int |
getCopyDest()
Return the source register of a copy instruction. |
int |
getCopySrc()
Return the source register of a copy instruction. |
int |
getDestRegister()
Return the destination register or -1 if none. |
int |
getExecutionCycles()
Return the number of cycles that this instruction requires. |
int |
getFunctionalUnit()
Return the number of the functional unit required to execute this instruction. |
int |
getLoopNumber()
Return the loop number of the instruction. |
Instruction |
getNext()
Return the next lexical instruction. |
abstract int |
getOpcode()
Return the numeric opcode of the instruction. |
int |
getPredicate(int i)
Return the specified predicate. |
int[] |
getPredicates()
Return the predicates for the instruction. |
int[] |
getSrcRegisters()
Return the source registers or null if none. |
int |
getTag()
Get the tag value. |
abstract boolean |
independent(Instruction inst,
RegisterSet registers)
Return true if this instruction is independent of the specified instruction. |
abstract int |
instructionSize()
Return the number of bytes required for the instruction. |
boolean |
isBranch()
Return true if this is a branch instruction. |
boolean |
isCopy()
Return true if the instruction copies a value from one register to another without modification. |
boolean |
isLabel()
Return true if this is a LabelMarker. |
boolean |
isLoad()
Return true if this is a load-from-memory instruction. |
boolean |
isMandatory()
Return true if this instruction is mandatory. |
boolean |
isMarker()
Return true if this is a Marker. |
boolean |
isPhi()
Return true if this is a phi instruction. |
boolean |
isPredicated()
Return true if the instruction is predicated. |
boolean |
isPredicatedOnTrue()
Returns true if the instruction is predicated on true. |
boolean |
isPrefetch()
Return true if this is a prefetch instruction. |
boolean |
isSpillInstruction()
Return true if this instruction was inserted as part of a spill load or spill store sequence. |
boolean |
isSpillLoadPoint()
Return true if this instruction is the first in a sequence of instructions. |
boolean |
isSpillStorePoint()
Return true if this instruction is the last in a sequence of instructions. |
boolean |
isStore()
Return true if this is a store-into-memory instruction. |
void |
markSpillInstruction()
Mark this instruction as part of a spill load or spill store sequence. |
boolean |
mods(int register,
RegisterSet registers)
Return true if the instruction clobbers the register. |
boolean |
nullified()
Return true if the instruction is nullified. |
void |
nullify(RegisterSet rs)
Mark the instruction so that it is not used. |
int |
numPredicates()
Return the number of predicates. |
abstract void |
remapDestRegister(int oldReg,
int newReg)
Map the registers defined in the instruction as destinations to the specified register. |
abstract void |
remapRegisters(int[] map)
Map the virtual registers referenced in the instruction to the specified real registers. |
abstract void |
remapSrcRegister(int oldReg,
int newReg)
Map the registers used in the instruction as sources to the specified register. |
void |
removePredicates()
Remove the predicates from this instruction. |
void |
setBBID(int bbid)
Set the basic block number of the instruction. |
protected void |
setLoopNumber(int loopNumber)
Set the loop number of the instruction. |
void |
setMandatory()
Specify that this instruction should never be eliminated. |
void |
setNext(Instruction next)
Set the next lexical instruction. |
void |
setPredicate(int rp)
Set the predicate for the instruction. |
void |
setPredicate(int rp,
boolean predicatedOnTrue)
Set the predicate for the instruction. |
void |
setPredicatedOnTrue(boolean predicatedOnTrue)
Set the condition for the predicate. |
void |
setPredicates(int[] predicates)
Specify the predicates for the instruction. |
boolean |
setsSpecialReg()
Return true if this instruction has a side effect of changing a special register. |
void |
setTag(int tag)
Set the tag value. |
void |
specifyNotSpillLoadPoint()
Specify that this instruction is not the first in a sequence of instructions. |
abstract void |
specifyRegisterUsage(RegisterAllocator rs,
int index,
int strength)
Specify the registers used and defined by this instruction. |
void |
specifySpillStorePoint()
Specify that this instruction is the last in a sequence of instructions and that a spill store can be inserted after it. |
boolean |
uses(int register,
RegisterSet registers)
Return true if the instruction uses the register. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected Instruction()
Method Detail |
---|
public Instruction copy()
public abstract void remapRegisters(int[] map)
map
- maps from the virtual register to real registerpublic abstract void remapSrcRegister(int oldReg, int newReg)
oldReg
- is the previous source registernewReg
- is the new source registerpublic abstract void remapDestRegister(int oldReg, int newReg)
oldReg
- is the previous destination registernewReg
- is the new destination registerpublic abstract int getOpcode()
public int getDestRegister()
public int[] getSrcRegisters()
null
if none.
public void nullify(RegisterSet rs)
public final boolean nullified()
public final void setMandatory()
public final boolean isMandatory()
public final void markSpillInstruction()
public boolean isSpillInstruction()
public final void setTag(int tag)
public final int getTag()
public int getExecutionCycles()
public int getFunctionalUnit()
public final void specifySpillStorePoint()
ExprChord
instance is translated or
after the predicate of an if-then-else is evaluated.
isSpillStorePoint()
,
specifyNotSpillLoadPoint()
,
isSpillLoadPoint()
public final boolean isSpillStorePoint()
ExprChord
instance is translated.
specifySpillStorePoint()
,
specifyNotSpillLoadPoint()
,
isSpillLoadPoint()
public final void specifyNotSpillLoadPoint()
specifySpillStorePoint()
,
isSpillStorePoint()
,
isSpillLoadPoint()
public final boolean isSpillLoadPoint()
specifySpillStorePoint()
,
isSpillStorePoint()
,
specifyNotSpillLoadPoint()
public boolean isLoad()
public boolean isStore()
public boolean isBranch()
public boolean isMarker()
Marker
public boolean isPrefetch()
public boolean isLabel()
public boolean isPhi()
public final void setNext(Instruction next)
public final Instruction getNext()
public abstract void assembler(Assembler asm, Emit emit)
public abstract int instructionSize()
public abstract void specifyRegisterUsage(RegisterAllocator rs, int index, int strength)
rs
- is the register set in useindex
- is an index associated with the instructionstrength
- is the importance of the instructionRegisterAllocator.useRegister(int,int,int)
,
RegisterAllocator.defRegister(int,int)
public boolean uses(int register, RegisterSet registers)
public boolean defs(int register, RegisterSet registers)
public boolean mods(int register, RegisterSet registers)
public boolean canBeDeleted(RegisterSet registers)
public abstract boolean independent(Instruction inst, RegisterSet registers)
inst
- is the specified instructionpublic boolean setsSpecialReg()
public boolean isCopy()
public boolean isPredicated()
public boolean isPredicatedOnTrue()
public void setPredicate(int rp)
public void setPredicate(int rp, boolean predicatedOnTrue)
public void setPredicatedOnTrue(boolean predicatedOnTrue)
public void removePredicates()
public int[] getPredicates()
public int numPredicates()
public int getPredicate(int i)
public void setPredicates(int[] predicates)
public int ehash()
public int getCopySrc()
public int getCopyDest()
public java.lang.Object clone()
clone
in class java.lang.Object
public int getLoopNumber()
protected void setLoopNumber(int loopNumber)
public int getBBID()
public void setBBID(int bbid)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |