|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object scale.backend.Instruction scale.backend.sparc.SparcInstruction
public abstract class SparcInstruction
This is the base class for all Sparc instructions except branches.
$Id: SparcInstruction.java,v 1.23 2007-09-20 18:56:42 burrill Exp $
Copyright 2007 by the Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.
Inst Op Format Repr. Instruction Class 00 1 disp30 call label CallInstruction 01 0 -op2-const22 illtrap const22 IlltrapInstruction 01 0 rd-op2-imm22 sethi const22,reg SethiInstruction 02 0 a-cond-op2-disp22 fbcc label BranchInstruction 03 0 a-cond-op2-cc1-cc0-p-disp19 fbpcc %fccn,label BranchCCInstruction 04 0 a-rcnd-op2-d16hi-p- rs1-d16lo brcc reg,lab BranchRegInstruction 05 2 rd-op3- rs1-0- -rs2 add reg,reg,reg IntOpInstruction 05 3 fcn-op3- rs1-0- -rs2 ldfsr reg+reg,%fsr FtnOpInstruction 06 2 rd-op3- rs1-1-simm13 add reg,imm,reg IntOpLitInstruction 06 3 fcn-op3- rs1-1-simm13 prefetch reg+address,fcn FtnOpLitInstruction 07 2 -op3- -0- flushw SparcInstruction 07 2 -op3- rs1-0- -rs2 flush reg+reg Inst7Instruction 07 2 -op3- rs1-0- -rs2 return reg+reg ReturnInstruction 08 2 -op3- rs1-1-simm13 flush reg+address Inst8Instruction 08 2 -op3- rs1-1-simm13 return reg+address ReturnLitInstruction 09 2 rd-op3- rs1-0-rcnd- -rs2 movrcc reg,reg,reg IntOpInstruction 10 2 rd-op3- rs1-1-rcnd-simm10 movrcc reg,simm10,reg IntOpLitInstruction 11 3 rd-op3- rs1-0- -rd2 casa reg,%asi,reg,reg CasaInstruction 12 2 0000-op3-000f-0- -cmask-mmask membar mask MembarInstruction 13 3 rd-op3- rs1-0- asi-rd2 casa reg,asi,reg,reg AsiLitInstruction 14 2 imp1-op3-imp2 impdep const22 IlltrapInstruction 15 2 rd-op3- rs1-0- -rs2 sll reg,reg,reg IntOpInstruction 16 2 rd-op3- rs1-1-scnt32 sll reg,scnt32,reg IntOpLitInstruction 17 2 rd-op3- rs1-1-scnt64 sllx reg,scnt64,reg IntOpLitInstruction 18 2 rd-op3- -opf-rs2 fmovs reg,reg FltOpInstruction 19 2 cc10-op3- rs1-opf-rs2 fcmps %fccn,reg,reg FltCmpInstruction 20 2 rd-op3- rs1-opf-rs2 fadds reg,reg,reg FltOp2Instruction 21 2 rd-op3- rs1- rdpr preg,reg ReadRegInstruction 21 2 0000-op3-000f-0000- stbar SparcInstruction 22 2 000x-op3- done SparcInstruction 24 2 cond-op3- rs1-0-cc1-cc0- -rs2 tcc %icc,reg+reg TrapInstruction 26 2 rd-op3-cc2-cond-0-cc1-cc0- -rs2 movcc %cc,reg,reg ImoveInstruction 27 2 rd-op3-cc2-cond-1-cc1-cc0-simm11 movcc %cc,simm11,reg ImoveLitInstruction 28 2 cond-op3- rs1-1-cc1-cc0- -swtn tcc %icc,reg+swtn TrapLitInstruction 29 2 rd-op3- rs1-rcnd-opf_low-rs2 fmovrcc reg,reg,reg FltOp2Instruction 30 2 rd-op3-cond-opf_cc-opf_low-rs2 fmovscc %cc,reg,reg FmoveInstructionThe Inst references Figures 33 & 34 on pages 64 & 65 of the Sparc Architecture Manual Version 9.
Field Summary | |
---|---|
protected int |
opcode
the instruction opcode |
protected byte |
setCC
flags that specify the condition codes set by the instruction |
protected byte |
useCC
flags that specify the condition codes used by the instruction |
Constructor Summary | |
---|---|
SparcInstruction(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 |
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. |
protected boolean |
independentCC(SparcInstruction inst)
Return true if this instruction's CC use is independent of the specified instruction. |
int |
instructionSize()
Return the number of bytes required for the instruction. |
void |
remapRegisters(int[] map)
Map the virtual registers referenced in the instruction to the specified real registers. |
protected void |
setOpcode(int opcode)
|
boolean |
setsCC(int cc)
Return true if the instruction sets the CC flag specified. |
void |
setSetCC(int cc)
Specify the CC set by this instruction. |
boolean |
setsSpecialReg()
Return true if this instruction has a side effect of changing a special register. |
void |
setUseCC(int cc)
Specify the CCs used by this instruction. |
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. |
boolean |
usesCC(int cc)
Return true if the instruction uses the CC flag specified. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected int opcode
protected byte setCC
protected byte useCC
Constructor Detail |
---|
public SparcInstruction(int opcode)
opcode
- is the instruction's opcodeMethod Detail |
---|
public int getOpcode()
Instruction
getOpcode
in class Instruction
protected 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()
Instruction
instructionSize
in class Instruction
public final void setSetCC(int cc)
public final void setUseCC(int cc)
public final boolean setsCC(int cc)
cc
- specifies the CCpublic boolean setsSpecialReg()
setsSpecialReg
in class Instruction
public final boolean usesCC(int cc)
cc
- specifies the CCprotected final boolean independentCC(SparcInstruction inst)
inst
- is the specified instructionpublic 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)
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 |