scale.backend.sparc
Class SparcV8RegisterSet

java.lang.Object
  extended by scale.backend.RegisterSet
      extended by scale.backend.sparc.SparcRegisterSet
          extended by scale.backend.sparc.SparcV8RegisterSet

public class SparcV8RegisterSet
extends SparcRegisterSet

This class describes the register set of the Sparc V8 using the 32-bit ABI.

$Id: SparcV8RegisterSet.java,v 1.18 2005-02-07 21:27:39 burrill Exp $

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

The Sparc V8 has 64 programmable registers. The registers 0..31 are used for integer values and addresses and registers 32..63 are used for floating point. The integer registers include the stack pointer and other housekeeping registers. Register 0 contains a hardwired 0 value.

Registers 0 through 31 are used for 32-bit integers. Registers 32 through 63 are used for single precision floating point values. Registers 64 through 63 are used for double precision floating point values. Registers 64 through 63 are used for quad precision floating point values.

This register description defines a set of pseudo registers which map onto the actual hardware registers.


Field Summary
static int LI0_REG
          64-bit integer register %i0
static int LO0_REG
          64-bit integer register %o0
 
Fields inherited from class scale.backend.sparc.SparcRegisterSet
D0_REG, D2_REG, F0_REG, F1_REG, FP_REG, G0_REG, G1_REG, G2_REG, G3_REG, G4_REG, G5_REG, G6_REG, G7_REG, I0_REG, I1_REG, I2_REG, I3_REG, I4_REG, I5_REG, I6_REG, I7_REG, L0_REG, L1_REG, L2_REG, L3_REG, L4_REG, L5_REG, L6_REG, L7_REG, O0_REG, O1_REG, O2_REG, O3_REG, O4_REG, O5_REG, O6_REG, O7_REG, Q0_REG, Q2_REG, SP_REG
 
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
SparcV8RegisterSet()
           
 
Method Summary
 int actualRegister(int reg)
          For architecture where a pseudo register are mapped onto actual registers, return the actual register.
 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 rangeBegin(int reg)
          Return the first real register that is affected when this register is modified.
 int rangeEnd(int reg)
          Return the last real register that is affected when this register is modified.
 java.lang.String registerName(int reg)
          Convert a register number into its assembly language form.
 int tempRegisterType(int type, int bs)
          Return the type with the size information added.
 
Methods inherited from class scale.backend.sparc.SparcRegisterSet
numAllocatableRegisters, registerSize, tempRegisterType
 
Methods inherited from class scale.backend.RegisterSet
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, readOnlyRegister, setResultRegister, specialRegister, tempRegister, useContiguous, virtualRegister
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LO0_REG

public static final int LO0_REG
64-bit integer register %o0

See Also:
Constant Field Values

LI0_REG

public static final int LI0_REG
64-bit integer register %i0

See Also:
Constant Field Values
Constructor Detail

SparcV8RegisterSet

public SparcV8RegisterSet()
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

rangeBegin

public final int rangeBegin(int reg)
Return the first real register that is affected when this register is modified.

Overrides:
rangeBegin in class RegisterSet

rangeEnd

public final int rangeEnd(int reg)
Return the last real register that is affected when this register is modified.

Overrides:
rangeEnd in class RegisterSet

actualRegister

public int actualRegister(int reg)
For architecture where a pseudo register are mapped onto actual registers, return the actual register. An example is shown by the SparcV8RegisterSet where a 64-bit long long register is mapped onto a set of two 32-bit registers.

Overrides:
actualRegister 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

tempRegisterType

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

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