scale.backend.alpha
Class LoadInstruction

java.lang.Object
  extended by scale.backend.Instruction
      extended by scale.backend.alpha.MemoryInstruction
          extended by scale.backend.alpha.LoadInstruction
All Implemented Interfaces:
java.lang.Cloneable

public class LoadInstruction
extends MemoryInstruction

This class represents Alpha load instructions.

$Id: LoadInstruction.java,v 1.27 2006-11-16 17:49:36 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.alpha.MemoryInstruction
displacement, opcode, ra, rb, relocType
 
Constructor Summary
LoadInstruction(int opcode, int ra, int rb)
           
LoadInstruction(int opcode, int ra, int rb, Displacement displacement)
           
LoadInstruction(int opcode, int ra, int rb, Displacement displacement, int relocType)
           
 
Method Summary
 boolean canBeDeleted(RegisterSet registers)
          Return true if the instruction can be deleted without changing program semantics.
static int created()
          Return the number of instances of this class created.
 boolean defs(int register, RegisterSet registers)
          Return true if the instruction sets the register.
 int getDestRegister()
          Return the destination register or -1 if none.
 boolean independent(Instruction inst, RegisterSet registers)
          Return true if this instruction is independent of the specified instruction.
 boolean isLoad()
          Return true if this is a load-from-memory instruction.
 boolean mods(int register, RegisterSet registers)
          Return true if the instruction modifies the 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.alpha.MemoryInstruction
assembler, getDisplacement, getExecutionCycles, getFunctionalUnit, getOpcode, getRa, getRb, getRelocType, instructionSize, remapDestRegister, remapRegisters, remapSrcRegister, setDisplacement, setRb, toString
 
Methods inherited from class scale.backend.Instruction
clone, copy, ehash, getBBID, getCopyDest, getCopySrc, getLoopNumber, getNext, getPredicate, getPredicates, getSrcRegisters, getTag, isBranch, isCopy, isLabel, isMandatory, isMarker, isPhi, isPredicated, isPredicatedOnTrue, isPrefetch, isSpillInstruction, isSpillLoadPoint, isSpillStorePoint, isStore, markSpillInstruction, nullified, nullify, 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

LoadInstruction

public LoadInstruction(int opcode,
                       int ra,
                       int rb)

LoadInstruction

public LoadInstruction(int opcode,
                       int ra,
                       int rb,
                       Displacement displacement)

LoadInstruction

public LoadInstruction(int opcode,
                       int ra,
                       int rb,
                       Displacement displacement,
                       int relocType)
Method Detail

created

public static int created()
Return the number of instances of this class created.


getDestRegister

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

Overrides:
getDestRegister in class Instruction

isLoad

public boolean isLoad()
Return true if this is a load-from-memory instruction.

Overrides:
isLoad in class Instruction

specifyRegisterUsage

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

Specified by:
specifyRegisterUsage in class Instruction
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 Instruction

defs

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

Overrides:
defs in class Instruction

mods

public boolean mods(int register,
                    RegisterSet registers)
Return true if the instruction modifies 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

canBeDeleted

public boolean canBeDeleted(RegisterSet registers)
Return true if the instruction can be deleted without changing program semantics.

Overrides:
canBeDeleted in class Instruction