|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object scale.backend.Instruction scale.backend.mips.MipsInstruction
public abstract class MipsInstruction
This is the base class for all Mips instructions except branches.
$Id: MipsInstruction.java,v 1.9 2006-11-16 17:49:37 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 |
Constructor Summary | |
---|---|
MipsInstruction(int opcode)
|
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. |
void |
assembler(Assembler gen,
Emit emit)
Insert the assembler representation of the instruction into the output stream. |
boolean |
defs(int register,
RegisterSet registers)
Return true if the instruction sets the register. |
int |
getOpcode()
Return the numeric opcode of the instruction. |
int |
instructionSize()
Return the number of bytes required for all Mips instructions. |
void |
remapRegisters(int[] map)
Map the virtual registers referenced in the instruction to the specified real registers. |
protected void |
setOpcode(int opcode)
|
void |
specifyRegisterUsage(RegisterAllocator rs,
int index,
int strength)
Specify the registers used and defined by this instruction. |
java.lang.String |
toString()
|
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, wait, wait, wait |
Field Detail |
---|
protected int opcode
Constructor Detail |
---|
public MipsInstruction(int opcode)
opcode
- is the instruction's opcodeMethod Detail |
---|
public int getOpcode()
Instruction
getOpcode
in class Instruction
protected void setOpcode(int opcode)
public int instructionSize()
instructionSize
in class Instruction
public 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 boolean defs(int register, RegisterSet registers)
defs
in class Instruction
public void remapRegisters(int[] map)
Instruction
remapRegisters
in class Instruction
map
- maps from the virtual register to real registerpublic java.lang.String assembleDisp(Assembler asm, Displacement disp, int ftn)
public void assembler(Assembler gen, Emit emit)
assembler
in class Instruction
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |