|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object scale.backend.Instruction scale.backend.trips2.TripsInstruction
public abstract class TripsInstruction
This class represents a Trips instruction.
$Id: TripsInstruction.java,v 1.22 2007-10-31 23:47:51 bmaher Exp $
Copyright 2008 by the
Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.
Field Summary | |
---|---|
protected boolean |
definesPredicate
True if the instruction defines a predicate. |
protected int |
numPredicates
The number of registers the instruction is predicated on. |
protected boolean |
predicatedOnTrue
Whether the instruction is predicated on true or false. |
protected int[] |
predicates
The registers the instruction is predicated on. |
Constructor Summary | |
---|---|
TripsInstruction()
Create a new unpredicated Trips instruction. |
|
TripsInstruction(int rp,
boolean predicatedOnTrue)
Create a new predicated Trips instruction. |
Method Summary | |
---|---|
boolean |
definesPredicate()
Return true if the instruction defines a predicated. |
protected java.lang.String |
formatOpcode(Assembler asm,
int opcode)
Return a string representation of the opcode for the assembler. |
protected java.lang.String |
formatOpcode(int opcode)
Return a string representation of the opcode. |
protected java.lang.String |
formatOpcode(java.lang.String opcode)
Return a string representation of the opcode. |
protected java.lang.String |
formatRa(Assembler asm,
int ra)
Return a string representation of the ra register for the assembler. |
int |
getBBID()
Get the basic block number of the instruction. |
int |
getLoopNumber()
Return the loop number of the instruction. |
int |
getPredicate(int i)
Return the i-th predicate for the instruction. |
int[] |
getPredicates()
Return the predicates for the instruction. |
int[] |
getSrcRegisters()
This routine returns the source registers for an instruction. |
boolean |
independent(Instruction inst,
RegisterSet registers)
Return true if this instruction is independent of the specified instruction. |
boolean |
isPredicated()
Return true if the instruction is predicated. |
boolean |
isPredicatedOnTrue()
Return true if the instruction is predicated on true. |
void |
nullify(RegisterSet rs)
Mark the instruction so that it is not used. |
int |
numPredicates()
Return the number of predicates for the instruction. |
void |
remapRegisters(int[] map)
Map the registers used in the instruction to the specified registers. |
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 |
setDefinesPredicate()
Set if the instruction defines a predicate. |
protected void |
setLoopNumber(int loopNumber)
Set the loop number of the 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)
Set the predicates for the instruction. |
void |
setPredicates(int[] predicates,
boolean predicatedOnTrue)
Set the predicates for the instruction. |
void |
specifyRegisterUsage(RegisterAllocator rs,
int index,
int strength)
Specify the registers used by this instruction. |
boolean |
uses(int register,
RegisterSet registers)
Return true if the instruction uses the register. |
Methods inherited from class scale.backend.Instruction |
---|
assembler, canBeDeleted, clone, copy, defs, ehash, getCopyDest, getCopySrc, getDestRegister, getExecutionCycles, getFunctionalUnit, getNext, getOpcode, getTag, instructionSize, isBranch, isCopy, isLabel, isLoad, isMandatory, isMarker, isPhi, isPrefetch, isSpillInstruction, isSpillLoadPoint, isSpillStorePoint, isStore, markSpillInstruction, mods, nullified, remapDestRegister, setMandatory, setNext, setsSpecialReg, setTag, specifyNotSpillLoadPoint, specifySpillStorePoint |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int[] predicates
protected int numPredicates
protected boolean predicatedOnTrue
protected boolean definesPredicate
Constructor Detail |
---|
public TripsInstruction()
public TripsInstruction(int rp, boolean predicatedOnTrue)
Method Detail |
---|
public final int numPredicates()
numPredicates
in class Instruction
public final int getPredicate(int i)
getPredicate
in class Instruction
public int[] getPredicates()
getPredicates
in class Instruction
public void setPredicate(int rp)
setPredicate
in class Instruction
public void setPredicate(int rp, boolean predicatedOnTrue)
setPredicate
in class Instruction
public void setPredicates(int[] predicates)
setPredicates
in class Instruction
public void setPredicates(int[] predicates, boolean predicatedOnTrue)
public void removePredicates()
removePredicates
in class Instruction
public void setPredicatedOnTrue(boolean predicatedOnTrue)
setPredicatedOnTrue
in class Instruction
public boolean isPredicatedOnTrue()
isPredicatedOnTrue
in class Instruction
public boolean isPredicated()
isPredicated
in class Instruction
public boolean definesPredicate()
protected void setDefinesPredicate()
public void remapRegisters(int[] map)
remapRegisters
in class Instruction
map
- maps from the virtual register to real registerpublic void remapSrcRegister(int oldReg, int newReg)
remapSrcRegister
in class Instruction
oldReg
- is the previous source registernewReg
- is the new source registerpublic void specifyRegisterUsage(RegisterAllocator rs, int index, int strength)
specifyRegisterUsage
in class Instruction
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)
uses
in class Instruction
public void nullify(RegisterSet rs)
nullify
in class Instruction
public int[] getSrcRegisters()
getSrcRegisters
in class Instruction
public boolean independent(Instruction inst, RegisterSet registers)
independent
in class Instruction
inst
- is the specified instructionprotected java.lang.String formatRa(Assembler asm, int ra)
protected java.lang.String formatOpcode(Assembler asm, int opcode)
protected java.lang.String formatOpcode(int opcode)
protected java.lang.String formatOpcode(java.lang.String opcode)
public int getLoopNumber()
getLoopNumber
in class Instruction
protected void setLoopNumber(int loopNumber)
setLoopNumber
in class Instruction
public int getBBID()
getBBID
in class Instruction
public void setBBID(int bbid)
setBBID
in class Instruction
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |