scale.backend.ppc
Class StoreInstruction

java.lang.Object
  extended by scale.backend.Instruction
      extended by scale.backend.ppc.PPCInstruction
          extended by scale.backend.ppc.FrInstruction
              extended by scale.backend.ppc.MemoryInstruction
                  extended by scale.backend.ppc.StoreInstruction
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
StorexInstruction

public class StoreInstruction
extends MemoryInstruction

This is the base class for all PPC Store instructions.

$Id: StoreInstruction.java,v 1.4 2006-10-04 13:59:23 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
 
Fields inherited from class scale.backend.ppc.MemoryInstruction
dftn, displacement, macosx, rd
 
Fields inherited from class scale.backend.ppc.FrInstruction
ra
 
Fields inherited from class scale.backend.ppc.PPCInstruction
opcode
 
Constructor Summary
StoreInstruction(int opcode, int rd, int ra)
           
StoreInstruction(int opcode, int rd, int ra, Displacement disp)
           
StoreInstruction(int opcode, int rd, int ra, Displacement disp, int dftn, boolean macosx)
           
 
Method Summary
 boolean defs(int register, RegisterSet registers)
          Return true if the instruction sets the register.
 int getDestRegister()
          Return the destination register or -1 if none.
 int[] getSrcRegisters()
          Return the source registers or null if none.
 boolean independent(Instruction inst, RegisterSet registers)
          Return true if this instruction is independent of the specified instruction.
 boolean mods(int register, RegisterSet registers)
          Return true if the instruction sets the register.
 void nullify(RegisterSet rs)
          Mark the instruction as no longer needed.
 void remapSrcRegister(int oldReg, int newReg)
          Map the registers used in the instruction as sources to the specified register.
 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.ppc.MemoryInstruction
assembler, remapRegisters, toString
 
Methods inherited from class scale.backend.ppc.PPCInstruction
assembleDisp, canBeDeleted, getOpcode, instructionSize, isLoad, isStore, remapDestRegister, setOpcode
 
Methods inherited from class scale.backend.Instruction
clone, copy, ehash, getBBID, getCopyDest, getCopySrc, getExecutionCycles, getFunctionalUnit, getLoopNumber, getNext, getPredicate, getPredicates, getTag, isBranch, isCopy, isLabel, isMandatory, isMarker, isPhi, isPredicated, isPredicatedOnTrue, isPrefetch, isSpillInstruction, isSpillLoadPoint, isSpillStorePoint, markSpillInstruction, nullified, numPredicates, removePredicates, setBBID, setLoopNumber, setMandatory, setNext, setPredicate, setPredicate, setPredicatedOnTrue, setPredicates, setsSpecialReg, setTag, specifyNotSpillLoadPoint, specifySpillStorePoint
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StoreInstruction

public StoreInstruction(int opcode,
                        int rd,
                        int ra)
Parameters:
opcode - is the instruction's opcode
rd - is the destination register
ra - is the source register

StoreInstruction

public StoreInstruction(int opcode,
                        int rd,
                        int ra,
                        Displacement disp)
Parameters:
opcode - is the instruction's opcode
rd - is the destination register
ra - is the source register
disp - is the displacement

StoreInstruction

public StoreInstruction(int opcode,
                        int rd,
                        int ra,
                        Displacement disp,
                        int dftn,
                        boolean macosx)
Parameters:
opcode - is the instruction's opcode
rd - is the destination register
ra - is the source register
disp - is the displacement
Method Detail

getDestRegister

public int getDestRegister()
Return the destination register or -1 if none.

Overrides:
getDestRegister in class FrInstruction

getSrcRegisters

public int[] getSrcRegisters()
Return the source registers or null if none.

Overrides:
getSrcRegisters in class FrInstruction

specifyRegisterUsage

public void specifyRegisterUsage(RegisterAllocator rs,
                                 int index,
                                 int strength)
Specify the registers used by this instruction.

Overrides:
specifyRegisterUsage in class FrInstruction
Parameters:
rs - is the register set in use
index - is an index associated with the instruction
strength - is the importance of the instruction
See Also:
RegisterAllocator.useRegister(int,int,int), RegisterAllocator.defRegister(int,int)

uses

public boolean uses(int register,
                    RegisterSet registers)
Return true if the instruction uses the register.

Overrides:
uses in class FrInstruction

mods

public boolean mods(int register,
                    RegisterSet registers)
Return true if the instruction sets the register.

Overrides:
mods in class Instruction

independent

public boolean independent(Instruction inst,
                           RegisterSet registers)
Return true if this instruction is independent of the specified instruction. If instructions are independent, than one instruction can be moved before or after the other instruction without changing the semantics of the program.

Overrides:
independent in class MemoryInstruction
Parameters:
inst - is the specified instruction

defs

public boolean defs(int register,
                    RegisterSet registers)
Return true if the instruction sets the register.

Overrides:
defs in class PPCInstruction

nullify

public void nullify(RegisterSet rs)
Mark the instruction as no longer needed.

Overrides:
nullify in class Instruction

remapSrcRegister

public void remapSrcRegister(int oldReg,
                             int newReg)
Map the registers used in the instruction as sources to the specified register. If the register is not used as a source register, no change is made.

Overrides:
remapSrcRegister in class FrInstruction
Parameters:
oldReg - is the previous source register
newReg - is the new source register