scale.backend.mips
Class MipsRegisterSet

java.lang.Object
  extended by scale.backend.RegisterSet
      extended by scale.backend.mips.MipsRegisterSet

public class MipsRegisterSet
extends RegisterSet

This class describes the register set of the Mips.

$Id: MipsRegisterSet.java,v 1.11 2005-02-07 21:27:24 burrill Exp $

Copyright 2005 by the Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.

The Mips has 64 programmable registers. 31 of the first 32 registers are used for integer value and addresses; register 0 constains a hardwired 0 value. This includes the stack pointer and other housekeeping registers. Registers 32 through 63 are used for floating point values.


Field Summary
static int CCREG
           
static int FA0_REG
          Floating point argument register
static int FA1_REG
          Floating point argument register
static int FA2_REG
          Floating point argument register
static int FA3_REG
          Floating point argument register
static int FA4_REG
          Floating point argument register
static int FA5_REG
          Floating point argument register
static int FA6_REG
          Floating point argument register
static int FA7_REG
          Floating point argument register
static int FCC0
           
static int FP_REG
          Frame pointer register
static int FR_REG
          Floating point result register
static int FR2_REG
          Second floating point result register (complex part)
static int FREG_SIZE
          Size in bytes of floating point register.
static int GP_REG
          Pointer to global area
static int HI_REG
           
static int IA0_REG
          First argument register
static int IA1_REG
          Integer argument register
static int IA2_REG
          Integer argument register
static int IA3_REG
          Integer argument register
static int IA4_REG
          Integer argument register
static int IA5_REG
          Integer argument register
static int IA6_REG
          Integer argument register
static int IA7_REG
          Integer argument register
static int IR_REG
          Integer result register 1 of 2
static int IR2_REG
          Integer result register 2 of 2
static int IREG_SIZE
          Size in bytes of integer register.
static int LAST_INT_REG
          Last integer register
static int LO_REG
           
static int RA_REG
          Return address register
static int RESERVEDREG
           
static int SP_REG
          Stack pointer register
static int SPECIAL
           
static int T9_REG
          Temp register 9; used for function calling
static int ZERO_REG
          Zero register
static int ZEROREG
           
 
Fields inherited from class scale.backend.RegisterSet
ADRREG, AFIREG, AIREG, checkMask, CNTREG, DBLEREG, FIREG, FLTREG, INTREG, nextRegister, PAIRREG, QUADREG, RDREG, registers, sizeMask, SPCREG, typeMask
 
Constructor Summary
MipsRegisterSet()
           
 
Method Summary
 short[] getCalleeSaves()
          Return the callee saves registers.
 short[] getCalleeUses()
          Return the callee uses registers.
 short[] getPreferredOrder()
          Return a mapping from an order index to a real register number.
 int numAllocatableRegisters()
          Return the number of unique registers that can hold programmer values.
 java.lang.String registerName(int reg)
          Convert a register number into its assembly language form.
 int registerSize(int reg)
          Return the size of the register in addressable memory units.
 int tempRegisterType(Type type, long bs)
          Return the register type with the size information added.
 
Methods inherited from class scale.backend.RegisterSet
actualRegister, adrRegister, compatible, compatibleNS, continueRegister, display, doubleRegister, floatRegister, getResultRegister, getType, initialize, intRegister, isAdrType, isContinueType, isDoubleType, isFloatType, isIntType, isModType, isPairType, isQuadType, isReadOnlyType, isSpecialType, lastRegister, modRegister, newTempRegister, numContiguousRegisters, numContiguousType, numRealRegisters, numRegisters, pairRegister, quadRegister, rangeBegin, rangeEnd, readOnlyRegister, setResultRegister, specialRegister, tempRegister, tempRegisterType, useContiguous, virtualRegister
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ZERO_REG

public static final int ZERO_REG
Zero register

See Also:
Constant Field Values

GP_REG

public static final int GP_REG
Pointer to global area

See Also:
Constant Field Values

SP_REG

public static final int SP_REG
Stack pointer register

See Also:
Constant Field Values

FP_REG

public static final int FP_REG
Frame pointer register

See Also:
Constant Field Values

RA_REG

public static final int RA_REG
Return address register

See Also:
Constant Field Values

LAST_INT_REG

public static final int LAST_INT_REG
Last integer register

See Also:
Constant Field Values

IR_REG

public static final int IR_REG
Integer result register 1 of 2

See Also:
Constant Field Values

IR2_REG

public static final int IR2_REG
Integer result register 2 of 2

See Also:
Constant Field Values

FR_REG

public static final int FR_REG
Floating point result register

See Also:
Constant Field Values

FR2_REG

public static final int FR2_REG
Second floating point result register (complex part)

See Also:
Constant Field Values

IA0_REG

public static final int IA0_REG
First argument register

See Also:
Constant Field Values

IA1_REG

public static final int IA1_REG
Integer argument register

See Also:
Constant Field Values

IA2_REG

public static final int IA2_REG
Integer argument register

See Also:
Constant Field Values

IA3_REG

public static final int IA3_REG
Integer argument register

See Also:
Constant Field Values

IA4_REG

public static final int IA4_REG
Integer argument register

See Also:
Constant Field Values

IA5_REG

public static final int IA5_REG
Integer argument register

See Also:
Constant Field Values

IA6_REG

public static final int IA6_REG
Integer argument register

See Also:
Constant Field Values

IA7_REG

public static final int IA7_REG
Integer argument register

See Also:
Constant Field Values

FA0_REG

public static final int FA0_REG
Floating point argument register

See Also:
Constant Field Values

FA1_REG

public static final int FA1_REG
Floating point argument register

See Also:
Constant Field Values

FA2_REG

public static final int FA2_REG
Floating point argument register

See Also:
Constant Field Values

FA3_REG

public static final int FA3_REG
Floating point argument register

See Also:
Constant Field Values

FA4_REG

public static final int FA4_REG
Floating point argument register

See Also:
Constant Field Values

FA5_REG

public static final int FA5_REG
Floating point argument register

See Also:
Constant Field Values

FA6_REG

public static final int FA6_REG
Floating point argument register

See Also:
Constant Field Values

FA7_REG

public static final int FA7_REG
Floating point argument register

See Also:
Constant Field Values

T9_REG

public static final int T9_REG
Temp register 9; used for function calling

See Also:
Constant Field Values

FCC0

public static final int FCC0
See Also:
Constant Field Values

LO_REG

public static final int LO_REG
See Also:
Constant Field Values

HI_REG

public static final int HI_REG
See Also:
Constant Field Values

IREG_SIZE

public static final int IREG_SIZE
Size in bytes of integer register.

See Also:
Constant Field Values

FREG_SIZE

public static final int FREG_SIZE
Size in bytes of floating point register.

See Also:
Constant Field Values

ZEROREG

public static final int ZEROREG
See Also:
Constant Field Values

RESERVEDREG

public static final int RESERVEDREG
See Also:
Constant Field Values

CCREG

public static final int CCREG
See Also:
Constant Field Values

SPECIAL

public static final int SPECIAL
See Also:
Constant Field Values
Constructor Detail

MipsRegisterSet

public MipsRegisterSet()
Method Detail

registerName

public java.lang.String registerName(int reg)
Convert a register number into its assembly language form.

Specified by:
registerName in class RegisterSet

getPreferredOrder

public short[] getPreferredOrder()
Return a mapping from an order index to a real register number. This mapping allows the order of allocation of real registers to be specified.

Overrides:
getPreferredOrder in class RegisterSet

registerSize

public int registerSize(int reg)
Return the size of the register in addressable memory units.

Specified by:
registerSize in class RegisterSet

getCalleeSaves

public short[] getCalleeSaves()
Return the callee saves registers.

Specified by:
getCalleeSaves in class RegisterSet

getCalleeUses

public short[] getCalleeUses()
Return the callee uses registers.

Specified by:
getCalleeUses in class RegisterSet

numAllocatableRegisters

public int numAllocatableRegisters()
Return the number of unique registers that can hold programmer values.

Specified by:
numAllocatableRegisters in class RegisterSet
Returns:
the number of unique registers that can hold programmer values.

tempRegisterType

public int tempRegisterType(Type type,
                            long bs)
Return the register type with the size information added.

Specified by:
tempRegisterType in class RegisterSet
Parameters:
type - is the type required
bs - is the size required