|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object scale.backend.Instruction scale.backend.ppc.PPCInstruction
public class PPCInstruction
This is the base class for all PPC instructions except branches.
$Id: PPCInstruction.java,v 1.7 2006-11-09 00:56:06 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 | |
---|---|
PPCInstruction(int opcode)
|
Method Summary | |
---|---|
java.lang.String |
assembleDisp(Assembler asm,
Displacement disp,
int ftn,
boolean macosx)
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 |
canBeDeleted(RegisterSet registers)
Return true if the instruction can be deleted without changing program semantics. |
boolean |
defs(int register,
RegisterSet registers)
Return true if the instruction sets the register. |
int |
getOpcode()
Return the numeric opcode of the instruction. |
boolean |
independent(Instruction inst,
RegisterSet registers)
Return true if this instruction is independent of the specified instruction. |
int |
instructionSize()
Return the number of bytes required for the BranchRegInstruction. |
boolean |
isLoad()
Return true if the instruction is a load. |
boolean |
isStore()
Return true if the instruction is a load. |
void |
remapDestRegister(int oldReg,
int newReg)
Map the registers defined in the instruction as destinations to the specified register. |
void |
remapRegisters(int[] map)
Map the virtual registers referenced in the instruction to the specified real registers. |
void |
remapSrcRegister(int oldReg,
int newReg)
Map the registers used in the instruction as sources to the specified register. |
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 PPCInstruction(int opcode)
opcode
- is the instruction's opcodeMethod Detail |
---|
public final int getOpcode()
Instruction
getOpcode
in class Instruction
public final void setOpcode(int opcode)
public boolean uses(int register, RegisterSet registers)
uses
in class Instruction
public boolean defs(int register, RegisterSet registers)
defs
in class Instruction
public int instructionSize()
instructionSize
in class Instruction
public boolean independent(Instruction inst, RegisterSet registers)
independent
in class Instruction
inst
- is the specified instructionpublic void remapSrcRegister(int oldReg, int newReg)
remapSrcRegister
in class Instruction
oldReg
- is the previous source registernewReg
- is the new source registerpublic void remapDestRegister(int oldReg, int newReg)
remapDestRegister
in class Instruction
oldReg
- is the previous destination registernewReg
- is the new destination registerpublic final boolean isLoad()
isLoad
in class Instruction
public final boolean isStore()
isStore
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 void remapRegisters(int[] map)
Instruction
remapRegisters
in class Instruction
map
- maps from the virtual register to real registerpublic boolean canBeDeleted(RegisterSet registers)
canBeDeleted
in class Instruction
public java.lang.String assembleDisp(Assembler asm, Displacement disp, int ftn, boolean macosx)
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 |