|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object scale.common.Machine
public abstract class Machine
This is the base class for all machine specific information.
$Id: Machine.java,v 1.61 2007-11-01 16:52:31 burrill Exp $
Copyright 2008 by the
Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.
Field Summary | |
---|---|
static int |
ALL_CONDITIONAL_MOVES
Capability: All the conditional move possibilities. |
protected int |
cacheLineSize
The size in addressable units of an L1 cache line. |
static Machine |
currentMachine
The current machine specification. |
protected FloatType |
doubleType
The type used for the C double type. |
protected FloatType |
floatCalcType
The real type best used for floating point calculations. |
protected FloatType |
floatType
The type used for the C float type. |
static int |
HAS_EXPENSIVE_SUBROUTINE_CALLS
Capability: bad to flatten/unroll loops that contain a function call. |
static int |
HAS_FF_CONDITIONAL_MOVE
Capability: Has a conditional move using a floating point test and floating point values. |
static int |
HAS_FI_CONDITIONAL_MOVE
Capability: Has a conditional move using a floating point test and integer values. |
static int |
HAS_IF_CONDITIONAL_MOVE
Capability: Has a conditional move using an integer test and floating point values. |
static int |
HAS_II_CONDITIONAL_MOVE
Capability: Has a conditional move using an integer test and integer values. |
static int |
HAS_INT_FROM_FP_CMP
Capability: Has a floating point compare that returns an integer value. |
static int |
HAS_NO_FP_DIVIDE
Capability: Floating point divides are not performed by an instruction but by a subroutine call. |
static int |
HAS_NO_INT_DIVIDE
Capability: Integer divides are not performed by an instruction but by a subroutine call. |
static int |
HAS_NON_VOLATILE_FP_REGS
Capability: Has a floating point registers that are saved over function calls. |
static int |
HAS_PREDICATION
Capability: Has predicated instructions. |
static int |
HAS_SIMPLE_FLOOR
Capability: Has a simple inline floor capability. |
static int |
HAS_WHILE_LOOP_UNROLL_BENEFIT
Capability: Has benefit from unrolling loops with no induction variable. |
protected IntegerType |
intCalcType
The integer type best used for integer calculations. |
protected FloatType |
longDoubleType
The type used for the C long double type. |
protected IntegerType |
ptrdifftType
The type used for the C ptrdiff_t type. |
protected IntegerType |
signedCharType
The type used for the C signed char type. |
protected IntegerType |
signedIntType
The type used for the C signed int type. |
protected IntegerType |
signedLongLongType
The type used for the C signed long long type. |
protected IntegerType |
signedLongType
The type used for the C signed long type. |
protected IntegerType |
signedShortType
The type used for the C signed short type. |
protected IntegerType |
sizetType
The type used for the C size_t type. |
protected IntegerType |
smallestAddressableUnitType
The type for the smallest addressable unit (e.g., char). |
protected IntegerType |
unsignedCharType
The type used for the C unsigned char type. |
protected IntegerType |
unsignedIntType
The type used for the C unsigned int type. |
protected IntegerType |
unsignedLongLongType
The type used for the C unsigned long long type. |
protected IntegerType |
unsignedLongType
The type used for the C unsigned long type. |
protected IntegerType |
unsignedShortType
The type used for the C unsigned short type. |
protected Type |
vaListType
The type to be used for va_list . |
protected PointerType |
voidStarType
The type used for the C void* type. |
protected IntegerType |
wchartType
The type used for the C char_t type. |
Constructor Summary | |
---|---|
Machine(int capabilities)
Create a Machine instance. |
Method Summary | |
---|---|
abstract void |
addCPPFlags(Vector<java.lang.String> v)
Add the flags necessary for the C preprocessor. |
abstract int |
addressableMemoryUnits(int bitSize)
Return the number of addressable units required |
abstract int |
alignData(int dataSize)
Return the integer value alignmentthat satisfies (0 == address % alignment)
for the data size specified. |
static long |
alignTo(long value,
int to)
Round up a value so that it is evenly divisible by the second value. |
abstract java.lang.String |
determineArchitecture(java.lang.String architecture,
java.lang.String extension)
Determine the architecture sub-type. |
abstract int |
executionCostEstimate(double value)
Return an estimate of the execution cost to provide this value. |
abstract int |
executionCostEstimate(long value)
Return an estimate of the execution cost to provide this value. |
abstract int |
generalAlignment()
Return the most general purpose alignment in memory units. |
abstract 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. |
static java.lang.String |
getAssemblerCommand(java.lang.String user,
int backendFeatures)
Return the assembler command to use. |
int |
getCacheSize(int typeSize)
Return the number of elements of the specified size in a cache line. |
static Generator |
getCodeGenerator(CallGraph cg,
int backendFeatures)
Return a backend code generator instance for the specified target architecture. |
FloatType |
getDoubleType()
Return the type used for the C double type. |
FloatType |
getFloatType()
Return the type used for the C float type. |
byte[] |
getFunctionalUnitDescriptions()
Return the functional unit information. |
abstract java.lang.String |
getGenericArchitectureName()
Return the name of the generic target architecture. |
ICEstimator |
getInstructionCountEstimator()
Return the proper instruction count estimator for the target architecture. |
IntegerType |
getIntegerCalcType()
Return the type best used for integer calculations. |
FloatType |
getLongDoubleType()
Return the type used for the C long double type. |
int |
getMaxBlockSize()
For architectures that block instructions, this is the maximum number of instructions that can be in a block. |
IntegerType |
getPtrdifftType()
Return the type used for the C ptrdiff_t type. |
FloatType |
getRealCalcType()
Return the type best used for floating point calculations. |
IntegerType |
getSignedCharType()
Return the type used for the C signed char type. |
IntegerType |
getSignedIntType()
Return the type used for the C signed int type. |
IntegerType |
getSignedLongLongType()
Return the type used for the C signed long long
type. |
IntegerType |
getSignedLongType()
Return the type used for the C signed long type. |
IntegerType |
getSignedShortType()
Return the type used for the C signed short type. |
IntegerType |
getSizetType()
Return the type used for the C size_t type. |
IntegerType |
getSmallestAddressableUnitType()
Return the type of the smallest addressable unit for this machine. |
IntegerType |
getUnsignedCharType()
Return the type used for the C unsigned char type. |
IntegerType |
getUnsignedIntType()
Return the type used for the C unsigned int type. |
IntegerType |
getUnsignedLongLongType()
Return the type used for the C unsigned long long
type. |
IntegerType |
getUnsignedLongType()
Return the type used for the C unsigned long type. |
IntegerType |
getUnsignedShortType()
Return the type used for the C unsigned short type. |
Type |
getVaListType()
Return the type to be used for va_list . |
PointerType |
getVoidStarType()
Return the type used for the C void* type. |
IntegerType |
getWchartType()
Return the type used for the C wchar_t type. |
boolean |
hasCapabilities(int capabilities)
Return true if this architecture has all of the specified capabilities. |
boolean |
hasCapability(int capability)
Return true if this architecture has one of the specified capabilities. |
boolean |
keepTypeInRegister(Type type,
boolean temporary)
Return true if a value of the type should be allocated to a register. |
abstract boolean |
littleEndian()
Return true if the machine is little-endian. |
int |
maxBitFieldSize()
Return the maximum bit field size in bits. |
protected void |
setup()
Setup this instance of the machine. |
static java.lang.String |
setup(java.lang.String architecture)
Setup for the specified machine. |
static ICEstimator |
sGetInstructionCountEstimator()
Return the proper instruction count estimator for the target architecture. |
abstract 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 |
Field Detail |
---|
public static final int HAS_II_CONDITIONAL_MOVE
public static final int HAS_IF_CONDITIONAL_MOVE
public static final int HAS_FI_CONDITIONAL_MOVE
public static final int HAS_FF_CONDITIONAL_MOVE
public static final int HAS_INT_FROM_FP_CMP
public static final int HAS_SIMPLE_FLOOR
public static final int HAS_NON_VOLATILE_FP_REGS
public static final int HAS_PREDICATION
public static final int HAS_WHILE_LOOP_UNROLL_BENEFIT
public static final int HAS_EXPENSIVE_SUBROUTINE_CALLS
public static final int HAS_NO_INT_DIVIDE
public static final int HAS_NO_FP_DIVIDE
public static final int ALL_CONDITIONAL_MOVES
public static Machine currentMachine
protected int cacheLineSize
protected IntegerType smallestAddressableUnitType
protected IntegerType intCalcType
protected FloatType floatCalcType
protected Type vaListType
va_list
.
protected IntegerType signedCharType
signed char
type.
protected IntegerType unsignedCharType
unsigned char
type.
protected IntegerType signedShortType
signed short
type.
protected IntegerType unsignedShortType
unsigned short
type.
protected IntegerType signedIntType
signed int
type.
protected IntegerType unsignedIntType
unsigned int
type.
protected IntegerType signedLongType
signed long
type.
protected IntegerType unsignedLongType
unsigned long
type.
protected IntegerType signedLongLongType
signed long long
type.
protected IntegerType unsignedLongLongType
unsigned long long
type.
protected IntegerType sizetType
size_t
type.
protected IntegerType ptrdifftType
ptrdiff_t
type.
protected IntegerType wchartType
char_t
type.
protected PointerType voidStarType
void*
type.
protected FloatType floatType
float
type.
protected FloatType doubleType
double
type.
protected FloatType longDoubleType
long double
type.
Constructor Detail |
---|
public Machine(int capabilities)
capabilities
- specifies special abilities of this
architecture that the compiler can useMethod Detail |
---|
public final boolean hasCapability(int capability)
public final boolean hasCapabilities(int capabilities)
public final IntegerType getSmallestAddressableUnitType()
char
.
public final IntegerType getSignedCharType()
signed char
type.
public final IntegerType getUnsignedCharType()
unsigned char
type.
public final IntegerType getSignedShortType()
signed short
type.
public final IntegerType getUnsignedShortType()
unsigned short
type.
public final IntegerType getSignedIntType()
signed int
type.
public final IntegerType getUnsignedIntType()
unsigned int
type.
public final IntegerType getSignedLongType()
signed long
type.
public final IntegerType getUnsignedLongType()
unsigned long
type.
public final IntegerType getSignedLongLongType()
signed long long
type.
public final IntegerType getUnsignedLongLongType()
unsigned long long
type.
public final IntegerType getSizetType()
size_t
type.
public final IntegerType getPtrdifftType()
ptrdiff_t
type.
public final IntegerType getWchartType()
wchar_t
type.
public final PointerType getVoidStarType()
void*
type.
public final FloatType getFloatType()
float
type.
public final FloatType getDoubleType()
double
type.
public final FloatType getLongDoubleType()
long double
type.
public final IntegerType getIntegerCalcType()
public final FloatType getRealCalcType()
public final Type getVaListType()
va_list
.
protected void setup()
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); .... }
public abstract int alignData(int dataSize)
(0 == address % alignment)
for the data size specified.
dataSize
- is the size of the data in addressable units.public abstract int addressableMemoryUnits(int bitSize)
bitSize
- is the number of bits required for the datapublic abstract int executionCostEstimate(long value)
public abstract int executionCostEstimate(double value)
public int maxBitFieldSize()
public static long alignTo(long value, int to)
value
- - returned rounded upto
- - specifies the divisor
public abstract void addCPPFlags(Vector<java.lang.String> v)
public abstract int generalAlignment()
public abstract int stackAlignment(Type type)
public abstract boolean littleEndian()
public int getCacheSize(int typeSize)
typeSize
- is the number of addressable units per elementpublic abstract java.lang.String getGenericArchitectureName()
public abstract java.lang.String getArchitectureName()
public abstract java.lang.String determineArchitecture(java.lang.String architecture, java.lang.String extension) throws java.lang.Exception
architecture
- specifies the target architectureextension
- specifies an extension to the a target architecture
java.lang.Exception
- if the extension is not understoodpublic java.lang.String getAsmFileExtension()
public static java.lang.String setup(java.lang.String architecture)
public static Generator getCodeGenerator(CallGraph cg, int backendFeatures) throws java.lang.Exception
cg
- is the call graph containing the CFGs to be converted
to target architecture instructionsbackendFeatures
- specifies certain flags set on the command
line
java.lang.Exception
public java.lang.String getAssemblerCommand(int backendFeatures)
backendFeatures
- specifies code generation flags such as -gpublic static java.lang.String getAssemblerCommand(java.lang.String user, int backendFeatures)
user
- is the command specified by the user.backendFeatures
- specifies code generation flags such as -gpublic boolean keepTypeInRegister(Type type, boolean temporary)
type
- is the typetemporary
- is true if the duration will be shortpublic ICEstimator getInstructionCountEstimator()
public static ICEstimator sGetInstructionCountEstimator()
public int getMaxBlockSize()
public byte[] getFunctionalUnitDescriptions()
Instruction.getFunctionalUnit()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |