|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object scale.common.Machine scale.backend.xyz.XyzMachine
public class XyzMachine
This is the base class for all Xyz specific information.
$Id: XyzMachine.java,v 1.4 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 is used by the compiler to determine architecture specific information. You must modify each method to provide the information specific to your system. Some of the methods below are preset for a 64-bit system and may need to be changed for a 32-bit system. Some of the methods may be removed if the default in the base class is suitable. Use the machine classes from the other architectures to help you understand how to make changes for your architecture.
Machine
,
AlphaMachine
,
SparcMachine
,
PPCMachine
Field Summary |
---|
Constructor Summary | |
---|---|
XyzMachine()
Create a Machine instance for an Xyz. |
Method Summary | |
---|---|
void |
addCPPFlags(Vector<java.lang.String> v)
Add the flags necessary for the C preprocessor. |
int |
addressableMemoryUnits(int bitSize)
Return the number of addressable units required |
int |
alignData(int dataSize)
Return the integer value alignmentthat satisfies (0 == address % alignment)
for the data size specified. |
java.lang.String |
determineArchitecture(java.lang.String architecture,
java.lang.String extension)
Determine the architecture sub-type. |
int |
executionCostEstimate(double value)
Return an estimate of the execution cost to provide this value. |
int |
executionCostEstimate(long value)
Return an estimate of the execution cost to provide this value. |
int |
generalAlignment()
Return the most general purpose alignment in memory units. |
java.lang.String |
getArchitectureName()
Return the name of the specific target architecture. |
java.lang.String |
getAsmFileExtension()
Return the file extension to use for an assembler source file. |
java.lang.String |
getAssemblerCommand(int backendFeatures)
Return the assembler command appropriate to the architecture. |
byte[] |
getFunctionalUnitDescriptions()
Return the functional unit information. |
java.lang.String |
getGenericArchitectureName()
Return the name of the generic target architecture. |
ICEstimator |
getInstructionCountEstimator()
Return the proper instruction count estimator for the target architecture. |
boolean |
keepTypeInRegister(Type type,
boolean temporary)
Return true if a value of the type should be allocated to a register. |
boolean |
littleEndian()
Return true if the machine is little-endian. |
int |
maxBitFieldSize()
Return the maximum bit field size in bits. |
protected void |
setDoubleType()
|
protected void |
setFloatType()
|
protected void |
setLongDoubleType()
|
protected void |
setSignedIntType()
|
protected void |
setSignedLongLongType()
|
protected void |
setSignedLongType()
|
protected void |
setSignedShortType()
|
protected void |
setSizetType()
|
protected void |
setUnsignedCharType()
|
protected void |
setUnsignedIntType()
|
protected void |
setUnsignedLongLongType()
|
protected void |
setUnsignedLongType()
|
protected void |
setUnsignedShortType()
|
protected void |
setup()
Setup this instance of the machine. |
protected void |
setVaListType()
|
protected void |
setVoidStarType()
|
boolean |
simpleInteger(long value)
|
int |
stackAlignment(Type type)
Return the alignment of things stored on the stack. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XyzMachine()
Method Detail |
---|
protected void setup()
Machine
protected void setup() { super.setup(); // Initialize type, etc that are not set here. // Specify the types that are different. PointerType.setMinBitSize(64); intCalcType = scale.clef.type.SignedIntegerType.create(64); .... }
setup
in class Machine
protected void setUnsignedCharType()
protected void setSignedShortType()
protected void setUnsignedShortType()
protected void setSignedIntType()
protected void setUnsignedIntType()
protected void setSignedLongType()
protected void setUnsignedLongType()
protected void setSignedLongLongType()
protected void setUnsignedLongLongType()
protected void setSizetType()
protected void setVoidStarType()
protected void setFloatType()
protected void setDoubleType()
protected void setLongDoubleType()
protected void setVaListType()
public java.lang.String getGenericArchitectureName()
Machine
getGenericArchitectureName
in class Machine
public java.lang.String getArchitectureName()
Machine
getArchitectureName
in class Machine
public java.lang.String determineArchitecture(java.lang.String architecture, java.lang.String extension) throws java.lang.Exception
determineArchitecture
in class Machine
architecture
- specifies the target architectureextension
- specifies an extension to the a target architecture
java.lang.Exception
- if the extension is not understoodpublic int alignData(int dataSize)
Machine
(0 == address % alignment)
for the data size specified.
alignData
in class Machine
dataSize
- is the size of the data in addressable units.public int addressableMemoryUnits(int bitSize)
Machine
addressableMemoryUnits
in class Machine
bitSize
- is the number of bits required for the datapublic boolean simpleInteger(long value)
public int executionCostEstimate(long value)
Machine
executionCostEstimate
in class Machine
public int executionCostEstimate(double value)
Machine
executionCostEstimate
in class Machine
public int maxBitFieldSize()
Machine
maxBitFieldSize
in class Machine
public java.lang.String getAsmFileExtension()
Machine
getAsmFileExtension
in class Machine
public void addCPPFlags(Vector<java.lang.String> v)
Machine
addCPPFlags
in class Machine
public final int generalAlignment()
Machine
generalAlignment
in class Machine
public final int stackAlignment(Type type)
Machine
stackAlignment
in class Machine
public boolean littleEndian()
Machine
littleEndian
in class Machine
public java.lang.String getAssemblerCommand(int backendFeatures)
Machine
getAssemblerCommand
in class Machine
backendFeatures
- specifies code generation flags such as -gpublic boolean keepTypeInRegister(Type type, boolean temporary)
Machine
keepTypeInRegister
in class Machine
type
- is the typetemporary
- is true if the duration will be shortpublic ICEstimator getInstructionCountEstimator()
Machine
getInstructionCountEstimator
in class Machine
public byte[] getFunctionalUnitDescriptions()
Machine
getFunctionalUnitDescriptions
in class Machine
Instruction.getFunctionalUnit()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |