coins
Class MachineParam

java.lang.Object
  extended bycoins.MachineParam
Direct Known Subclasses:
MachineParamAlpha, MachineParamArm, MachineParamMicroBlaze, MachineParamMips, MachineParamPpc, MachineParamSH4, MachineParamSparc, MachineParamX86, MachineParamX86_64

public class MachineParam
extends java.lang.Object

MachineParam class: Define target machine parameters and methods. This is the super class of MachineParamSparc, MachineParamX86, etc. Default is Sparc.


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
           
static int COST_INDEX_CALL
          index to access COST_OF_INSTRUCTION
static int COST_INDEX_GLOBAL_LOAD
          index to access COST_OF_INSTRUCTION
static int COST_INDEX_TEMP_LOAD
          index to access COST_OF_INSTRUCTION
static int INT_TYPE_OF_ADDRESS_IS_INT
           
static int INT_TYPE_OF_ADDRESS_IS_LONG
           
static int INT_TYPE_OF_ADDRESS_IS_U_INT
           
static int INT_TYPE_OF_ADDRESS_IS_U_LONG
           
static int INT_TYPE_OF_ADDRESS_IS_U_LONG_LONG
           
static int INT_TYPE_OF_CHAR_IS_INT
           
static int INT_TYPE_OF_CHAR_IS_U_INT
           
 IoRoot ioRoot
           
(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
           
 
Constructor Summary
MachineParam(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

ioRoot

public final IoRoot ioRoot

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

INT_TYPE_OF_CHAR_IS_INT

public static final int INT_TYPE_OF_CHAR_IS_INT
See Also:
Constant Field Values

INT_TYPE_OF_CHAR_IS_U_INT

public static final int INT_TYPE_OF_CHAR_IS_U_INT
See Also:
Constant Field Values

INT_TYPE_OF_ADDRESS_IS_INT

public static final int INT_TYPE_OF_ADDRESS_IS_INT
See Also:
Constant Field Values

INT_TYPE_OF_ADDRESS_IS_U_INT

public static final int INT_TYPE_OF_ADDRESS_IS_U_INT
See Also:
Constant Field Values

INT_TYPE_OF_ADDRESS_IS_LONG

public static final int INT_TYPE_OF_ADDRESS_IS_LONG
See Also:
Constant Field Values

INT_TYPE_OF_ADDRESS_IS_U_LONG

public static final int INT_TYPE_OF_ADDRESS_IS_U_LONG
See Also:
Constant Field Values

INT_TYPE_OF_ADDRESS_IS_U_LONG_LONG

public static final int INT_TYPE_OF_ADDRESS_IS_U_LONG_LONG
See Also:
Constant Field Values

COST_INDEX_TEMP_LOAD

public static final int COST_INDEX_TEMP_LOAD
index to access COST_OF_INSTRUCTION

See Also:
Constant Field Values

COST_INDEX_GLOBAL_LOAD

public static final int COST_INDEX_GLOBAL_LOAD
index to access COST_OF_INSTRUCTION

See Also:
Constant Field Values

COST_INDEX_CALL

public static final int COST_INDEX_CALL
index to access COST_OF_INSTRUCTION

See Also:
Constant Field Values
Constructor Detail

MachineParam

public MachineParam(IoRoot pIoRoot)
Method Detail

numberOfBitsInAddressingUnit

public int numberOfBitsInAddressingUnit()

numberOfBitsInPackedChar

public int numberOfBitsInPackedChar()

numberOfBitsInPackedShort

public int numberOfBitsInPackedShort()

getIntKindForAddress

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

Returns:
the selected constant.

getIntKindForChar

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

Returns:
the selected constant.

getAlignment

public int getAlignment(int pTypeKind)

minimumNumberOfAddressingUnitsForBitFieldSequence

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

Returns:
the number of allocation units.

initGlobalExplicitly

public boolean initGlobalExplicitly()

initByDataCode

public boolean initByDataCode()

evaluateSize

public int evaluateSize(int pTypeKind)
evaluateSize


getCharCode

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

Returns:
the character code.

getStringElemType

public Type getStringElemType()

blankRegionName

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

Returns:
the name to represent blank (unnamed) region.

getLargestAlignment

public int getLargestAlignment()

isBigEndian

public boolean isBigEndian()
isBigEndian //##16

Returns:
true if big endian is selected, false otherwise.

isLittleEndian

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

Returns:
true if little endian is selected, false otherwise.

isPackedFromRight

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

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

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.

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

getNumberOfFloatingRegisters

public int getNumberOfFloatingRegisters()