coins
Class MachineParamSparc

java.lang.Object
  extended bycoins.MachineParam
      extended bycoins.MachineParamSparc

public class MachineParamSparc
extends MachineParam

MachineParamSparc class: Define target machine parameters and methods. The target machine is Sparc Ver. 8.


Field Summary
(package private) static int ALIGN_ADDRESS
           
(package private) static int ALIGN_BOOL
           
(package private) static int ALIGN_CHAR
           
(package private) static int ALIGN_DOUBLE
           
(package private) static int ALIGN_ENUM
           
(package private) static int ALIGN_FLOAT
           
(package private) static int ALIGN_INT
           
(package private) static int ALIGN_LONG
           
(package private) static int ALIGN_LONG_DOUBLE
           
(package private) static int ALIGN_LONG_LONG
           
(package private) static int ALIGN_OFFSET
           
(package private) static int ALIGN_PTR
           
(package private) static int ALIGN_REGION_MIN
           
(package private) static int ALIGN_SHORT
           
(package private) static int ALIGN_STRUCT_MIN
           
(package private) static int ALIGN_SUBP
           
(package private) static int ALIGN_VOID
           
(package private) static int ALIGN_WCHAR
           
(package private) static int NUMBER_OF_BITS_IN_ADDRESSING_UNIT
           
(package private) static int NUMBER_OF_BITS_IN_PACKED_CHAR
           
(package private) static int NUMBER_OF_BITS_IN_PACKED_SHORT
           
(package private) static int SIZEOF_ADDRESS
           
(package private) static int SIZEOF_BOOL
           
(package private) static int SIZEOF_CHAR
           
(package private) static int SIZEOF_DOUBLE
           
(package private) static int SIZEOF_ENUM
           
(package private) static int SIZEOF_FLOAT
           
(package private) static int SIZEOF_INT
           
(package private) static int SIZEOF_LONG
           
(package private) static int SIZEOF_LONG_DOUBLE
           
(package private) static int SIZEOF_LONG_LONG
           
(package private) static int SIZEOF_OFFSET
           
(package private) static int SIZEOF_PTR
           
(package private) static int SIZEOF_SHORT
           
(package private) static int SIZEOF_VOID
           
(package private) static int SIZEOF_WCHAR
           
 
Fields inherited from class coins.MachineParam
COST_INDEX_CALL, COST_INDEX_GLOBAL_LOAD, COST_INDEX_TEMP_LOAD, INT_TYPE_OF_ADDRESS_IS_INT, INT_TYPE_OF_ADDRESS_IS_LONG, INT_TYPE_OF_ADDRESS_IS_U_INT, INT_TYPE_OF_ADDRESS_IS_U_LONG, INT_TYPE_OF_ADDRESS_IS_U_LONG_LONG, INT_TYPE_OF_CHAR_IS_INT, INT_TYPE_OF_CHAR_IS_U_INT, ioRoot
 
Constructor Summary
MachineParamSparc(IoRoot pIoRoot)
           
 
Method Summary
 java.lang.String blankRegionName()
          balnkRegionName: //##29
 int costOfInstruction(int pIndex)
          costOfInstruction Approximate cost of executing instructions in unit of register-register integer addition.
 int evaluateSize(int pTypeKind)
          evaluateSize:
 int getAlignment(int pTypeKind)
           
 int getCharCode(char pChar)
          getCharCode: Get the character code of the given character.
 int getIntKindForAddress()
          Select one of the constants INT_TYPE_OF_ADDRESS_IS_* (see abobe).
 int getIntKindForChar()
          Select one of the constants INT_TYPE_OF_CHAR_IS_* (see abobe).
 int getLargestAlignment()
           
 int getNumberOfFloatingRegisters()
           
 int getNumberOfGeneralRegisters()
           
 Type getStringElemType()
           
 boolean initByDataCode()
           
 boolean initGlobalExplicitly()
           
 boolean isBigEndian()
          isBigEndian: //##16
 boolean isLittleEndian()
          isLittleEndian: //##16
 boolean isPackedFromLeft()
          isPackedFromLeft: //##16
 boolean isPackedFromRight()
          isPackedFromRight: //##16
 int minimumNumberOfAddressingUnitsForBitFieldSequence()
          Allocation unit for bit field sequence.
 int numberOfBitsInAddressingUnit()
           
 int numberOfBitsInPackedChar()
           
 int numberOfBitsInPackedShort()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NUMBER_OF_BITS_IN_ADDRESSING_UNIT

static final int NUMBER_OF_BITS_IN_ADDRESSING_UNIT
See Also:
Constant Field Values

NUMBER_OF_BITS_IN_PACKED_CHAR

static final int NUMBER_OF_BITS_IN_PACKED_CHAR
See Also:
Constant Field Values

NUMBER_OF_BITS_IN_PACKED_SHORT

static final int NUMBER_OF_BITS_IN_PACKED_SHORT
See Also:
Constant Field Values

SIZEOF_BOOL

static final int SIZEOF_BOOL
See Also:
Constant Field Values

SIZEOF_SHORT

static final int SIZEOF_SHORT
See Also:
Constant Field Values

SIZEOF_INT

static final int SIZEOF_INT
See Also:
Constant Field Values

SIZEOF_LONG

static final int SIZEOF_LONG
See Also:
Constant Field Values

SIZEOF_LONG_LONG

static final int SIZEOF_LONG_LONG
See Also:
Constant Field Values

SIZEOF_CHAR

static final int SIZEOF_CHAR
See Also:
Constant Field Values

SIZEOF_WCHAR

static final int SIZEOF_WCHAR
See Also:
Constant Field Values

SIZEOF_VOID

static final int SIZEOF_VOID
See Also:
Constant Field Values

SIZEOF_PTR

static final int SIZEOF_PTR
See Also:
Constant Field Values

SIZEOF_ENUM

static final int SIZEOF_ENUM
See Also:
Constant Field Values

SIZEOF_ADDRESS

static final int SIZEOF_ADDRESS
See Also:
Constant Field Values

SIZEOF_OFFSET

static final int SIZEOF_OFFSET
See Also:
Constant Field Values

SIZEOF_FLOAT

static final int SIZEOF_FLOAT
See Also:
Constant Field Values

SIZEOF_DOUBLE

static final int SIZEOF_DOUBLE
See Also:
Constant Field Values

SIZEOF_LONG_DOUBLE

static final int SIZEOF_LONG_DOUBLE
See Also:
Constant Field Values

ALIGN_BOOL

static final int ALIGN_BOOL
See Also:
Constant Field Values

ALIGN_SHORT

static final int ALIGN_SHORT
See Also:
Constant Field Values

ALIGN_INT

static final int ALIGN_INT
See Also:
Constant Field Values

ALIGN_LONG

static final int ALIGN_LONG
See Also:
Constant Field Values

ALIGN_LONG_LONG

static final int ALIGN_LONG_LONG
See Also:
Constant Field Values

ALIGN_CHAR

static final int ALIGN_CHAR
See Also:
Constant Field Values

ALIGN_WCHAR

static final int ALIGN_WCHAR
See Also:
Constant Field Values

ALIGN_VOID

static final int ALIGN_VOID
See Also:
Constant Field Values

ALIGN_PTR

static final int ALIGN_PTR
See Also:
Constant Field Values

ALIGN_ENUM

static final int ALIGN_ENUM
See Also:
Constant Field Values

ALIGN_ADDRESS

static final int ALIGN_ADDRESS
See Also:
Constant Field Values

ALIGN_OFFSET

static final int ALIGN_OFFSET
See Also:
Constant Field Values

ALIGN_FLOAT

static final int ALIGN_FLOAT
See Also:
Constant Field Values

ALIGN_DOUBLE

static final int ALIGN_DOUBLE
See Also:
Constant Field Values

ALIGN_LONG_DOUBLE

static final int ALIGN_LONG_DOUBLE
See Also:
Constant Field Values

ALIGN_STRUCT_MIN

static final int ALIGN_STRUCT_MIN
See Also:
Constant Field Values

ALIGN_REGION_MIN

static final int ALIGN_REGION_MIN
See Also:
Constant Field Values

ALIGN_SUBP

static final int ALIGN_SUBP
See Also:
Constant Field Values
Constructor Detail

MachineParamSparc

public MachineParamSparc(IoRoot pIoRoot)
Method Detail

numberOfBitsInAddressingUnit

public int numberOfBitsInAddressingUnit()
Overrides:
numberOfBitsInAddressingUnit in class MachineParam

numberOfBitsInPackedChar

public int numberOfBitsInPackedChar()
Overrides:
numberOfBitsInPackedChar in class MachineParam

numberOfBitsInPackedShort

public int numberOfBitsInPackedShort()
Overrides:
numberOfBitsInPackedShort in class MachineParam

getIntKindForAddress

public int getIntKindForAddress()
Select one of the constants INT_TYPE_OF_ADDRESS_IS_* (see abobe).

Overrides:
getIntKindForAddress in class MachineParam
Returns:
the selected constant.

getIntKindForChar

public int getIntKindForChar()
Select one of the constants INT_TYPE_OF_CHAR_IS_* (see abobe).

Overrides:
getIntKindForChar in class MachineParam
Returns:
the selected constant.

getAlignment

public int getAlignment(int pTypeKind)
Overrides:
getAlignment in class MachineParam

minimumNumberOfAddressingUnitsForBitFieldSequence

public int minimumNumberOfAddressingUnitsForBitFieldSequence()
Allocation unit for bit field sequence.

Overrides:
minimumNumberOfAddressingUnitsForBitFieldSequence in class MachineParam
Returns:
the number of allocation units.

initGlobalExplicitly

public boolean initGlobalExplicitly()
Overrides:
initGlobalExplicitly in class MachineParam

initByDataCode

public boolean initByDataCode()
Overrides:
initByDataCode in class MachineParam

evaluateSize

public int evaluateSize(int pTypeKind)
evaluateSize:

Overrides:
evaluateSize in class MachineParam

getCharCode

public int getCharCode(char pChar)
getCharCode: Get the character code of the given character.

Overrides:
getCharCode in class MachineParam
Returns:
the character code.

getStringElemType

public Type getStringElemType()
Overrides:
getStringElemType in class MachineParam

blankRegionName

public java.lang.String blankRegionName()
balnkRegionName: //##29

Overrides:
blankRegionName in class MachineParam
Returns:
the name to represent blank (unnamed) region.

getLargestAlignment

public int getLargestAlignment()
Overrides:
getLargestAlignment in class MachineParam

isBigEndian

public boolean isBigEndian()
isBigEndian: //##16

Overrides:
isBigEndian in class MachineParam
Returns:
true if big endian is selected, false otherwise.

isLittleEndian

public boolean isLittleEndian()
isLittleEndian: //##16

Overrides:
isLittleEndian in class MachineParam
Returns:
true if little endian is selected, false otherwise.

isPackedFromRight

public boolean isPackedFromRight()
isPackedFromRight: //##16

Overrides:
isPackedFromRight in class MachineParam
Returns:
true if bit fields of a structure are packed from right (the least significant bit of 1st field is placed at the least significant bit of object).

isPackedFromLeft

public boolean isPackedFromLeft()
isPackedFromLeft: //##16

Overrides:
isPackedFromLeft in class MachineParam
Returns:
true if bit fields of a structure are packed from left (the most significant bit of 1st field is placed at the most significant bit of object).

costOfInstruction

public int costOfInstruction(int pIndex)
costOfInstruction Approximate cost of executing instructions in unit of register-register integer addition. The cost of each executable HIR node is assumed at least 1, so that the cost of (assign (exp e)) is assumed to be (1 + (cost of x) + (cost of e)). This value is used in HIR optimization, etc.

Overrides:
costOfInstruction in class MachineParam
Parameters:
pIndex - is the index to select instruction in such way as COST_INDEX_TEMP_LOAD, COST_INDEX_CALL, etc.
Returns:
the approximate cost of instruction specified by pIndex.

getNumberOfGeneralRegisters

public int getNumberOfGeneralRegisters()
Overrides:
getNumberOfGeneralRegisters in class MachineParam

getNumberOfFloatingRegisters

public int getNumberOfFloatingRegisters()
Overrides:
getNumberOfFloatingRegisters in class MachineParam