scale.backend.x86
Class X86RegisterSet

java.lang.Object
  extended by scale.backend.RegisterSet
      extended by scale.backend.x86.X86RegisterSet

public class X86RegisterSet
extends RegisterSet

This class describes the register set of the X86 architecture.

$Id: X86RegisterSet.java,v 1.1 2007-11-01 16:52:30 burrill Exp $

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

This class represents the register set for the specific architecture. Most of the methods below generate a "not implemented error". These must be replaced with code that is specific to the register set of the architecture. The other methods may need to be modified. Use the register set classes from the other architectures to help you understand how to make changes for your architecture.

See Also:
RegisterSet, AlphaRegisterSet, SparcRegisterSet, PPCRegisterSet

Field Summary
static int AH
           
static int AL
           
static int AX
           
static int BH
           
static int BL
           
static int BP
           
static int BX
           
static int CH
           
static int CL
           
static int CR0
           
static int CR1
           
static int CR2
           
static int CR3
           
static int CS
           
static int CX
           
static int DH
           
static int DI
           
static int DL
           
static int DR0
           
static int DR1
           
static int DR2
           
static int DR3
           
static int DR4
           
static int DR5
           
static int DR6
           
static int DR7
           
static int DS
           
static int DX
           
static int EAX
           
static int EBP
           
static int EBX
           
static int ECX
           
static int EDI
           
static int EDX
           
static int EFLAGS
           
static int ES
           
static int ESI
           
static int ESP
           
static int FS
           
static int GS
           
static int SI
           
static int SP
           
static int SS
           
 
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
X86RegisterSet()
           
 
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 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.
 boolean useContiguous()
          Return true if virtual registers, that require more than one real register, must be allocated to contiguous real registers.
 
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, rangeBegin, rangeEnd, readOnlyRegister, setResultRegister, specialRegister, tempRegister, tempRegisterType, virtualRegister
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EAX

public static final int EAX
See Also:
Constant Field Values

AX

public static final int AX
See Also:
Constant Field Values

AH

public static final int AH
See Also:
Constant Field Values

AL

public static final int AL
See Also:
Constant Field Values

EBX

public static final int EBX
See Also:
Constant Field Values

BX

public static final int BX
See Also:
Constant Field Values

BH

public static final int BH
See Also:
Constant Field Values

BL

public static final int BL
See Also:
Constant Field Values

ECX

public static final int ECX
See Also:
Constant Field Values

CX

public static final int CX
See Also:
Constant Field Values

CH

public static final int CH
See Also:
Constant Field Values

CL

public static final int CL
See Also:
Constant Field Values

EDX

public static final int EDX
See Also:
Constant Field Values

DX

public static final int DX
See Also:
Constant Field Values

DH

public static final int DH
See Also:
Constant Field Values

DL

public static final int DL
See Also:
Constant Field Values

EBP

public static final int EBP
See Also:
Constant Field Values

BP

public static final int BP
See Also:
Constant Field Values

ESI

public static final int ESI
See Also:
Constant Field Values

SI

public static final int SI
See Also:
Constant Field Values

EDI

public static final int EDI
See Also:
Constant Field Values

DI

public static final int DI
See Also:
Constant Field Values

ESP

public static final int ESP
See Also:
Constant Field Values

SP

public static final int SP
See Also:
Constant Field Values

CS

public static final int CS
See Also:
Constant Field Values

DS

public static final int DS
See Also:
Constant Field Values

SS

public static final int SS
See Also:
Constant Field Values

ES

public static final int ES
See Also:
Constant Field Values

FS

public static final int FS
See Also:
Constant Field Values

GS

public static final int GS
See Also:
Constant Field Values

CR0

public static final int CR0
See Also:
Constant Field Values

CR1

public static final int CR1
See Also:
Constant Field Values

CR2

public static final int CR2
See Also:
Constant Field Values

CR3

public static final int CR3
See Also:
Constant Field Values

DR0

public static final int DR0
See Also:
Constant Field Values

DR1

public static final int DR1
See Also:
Constant Field Values

DR2

public static final int DR2
See Also:
Constant Field Values

DR3

public static final int DR3
See Also:
Constant Field Values

DR4

public static final int DR4
See Also:
Constant Field Values

DR5

public static final int DR5
See Also:
Constant Field Values

DR6

public static final int DR6
See Also:
Constant Field Values

DR7

public static final int DR7
See Also:
Constant Field Values

EFLAGS

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

X86RegisterSet

public X86RegisterSet()
Method Detail

registerName

public java.lang.String registerName(int reg)
Description copied from class: RegisterSet
Convert a register number into its assembly language form.

Specified by:
registerName in class RegisterSet

getPreferredOrder

public short[] getPreferredOrder()
Description copied from class: RegisterSet
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. This method SHOULD BE overridden by derived classes.

Overrides:
getPreferredOrder in class RegisterSet

useContiguous

public boolean useContiguous()
Description copied from class: RegisterSet
Return true if virtual registers, that require more than one real register, must be allocated to contiguous real registers.

Overrides:
useContiguous in class RegisterSet

registerSize

public int registerSize(int reg)
Description copied from class: RegisterSet
Return the size of the register in addressable memory units.

Specified by:
registerSize in class RegisterSet

actualRegister

public int actualRegister(int reg)
Description copied from class: RegisterSet
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()
Description copied from class: RegisterSet
Return the callee saves registers.

Specified by:
getCalleeSaves in class RegisterSet

getCalleeUses

public short[] getCalleeUses()
Description copied from class: RegisterSet
Return the callee uses registers.

Specified by:
getCalleeUses in class RegisterSet

numAllocatableRegisters

public int numAllocatableRegisters()
Description copied from class: RegisterSet
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)
Description copied from class: RegisterSet
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