scale.backend.ppc
Class PPCG5RegisterSet

java.lang.Object
  extended by scale.backend.RegisterSet
      extended by scale.backend.ppc.PPCRegisterSet
          extended by scale.backend.ppc.PPCG5RegisterSet

public class PPCG5RegisterSet
extends PPCRegisterSet

This class describes the register set of the G5 PowerPC.

$Id: PPCG5RegisterSet.java,v 1.8 2006-10-04 13:59:22 burrill Exp $

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

The PPC has 67 programmable registers. The first 32 registers are used for integer values and addresses. This includes the stack pointer and other housekeeping registers. Registers 32 through 62 are used for floating point values.


Field Summary
static short[] actualRegisters
          The types of real registers on the PPC.
static short[] calleeSavesLinux
          The registers that a callee must save and restore if they are used by the callee.
static short[] calleeSavesMacosx
          The registers that a callee must save and restore if they are used by the callee.
static short[] calleeUsesLinux
          The registers that a callee can use without saving and restoring.
static short[] calleeUsesMacosx
          The registers that a callee can use without saving and restoring.
static int FREG_SIZE
          Size in bytes of integer register.
static int IREG_SIZE
          Size in bytes of integer register.
static short[] preferredOrder
          The preferred order in which registers should be allocated.
 
Fields inherited from class scale.backend.ppc.PPCRegisterSet
FFA_REG, FIA_REG, FR_REG, IR_REG, LFA_REG_LINUX, LFA_REG_MACOSX, LIA_REG, SP_REG, TOC_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
PPCG5RegisterSet(boolean macosx)
           
 
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(Type type, long bs)
          Return the register type with the size information added.
 
Methods inherited from class scale.backend.ppc.PPCRegisterSet
numAllocatableRegisters, registerSize
 
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, tempRegisterType, useContiguous, virtualRegister
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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 integer register.

See Also:
Constant Field Values

actualRegisters

public static final short[] actualRegisters
The types of real registers on the PPC.


preferredOrder

public static final short[] preferredOrder
The preferred order in which registers should be allocated. This array must be the same length as actualRegisters.


calleeUsesLinux

public static final short[] calleeUsesLinux
The registers that a callee can use without saving and restoring.


calleeUsesMacosx

public static final short[] calleeUsesMacosx
The registers that a callee can use without saving and restoring.


calleeSavesLinux

public static final short[] calleeSavesLinux
The registers that a callee must save and restore if they are used by the callee.


calleeSavesMacosx

public static final short[] calleeSavesMacosx
The registers that a callee must save and restore if they are used by the callee.

Constructor Detail

PPCG5RegisterSet

public PPCG5RegisterSet(boolean macosx)
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

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

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

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