scale.common
Class Machine

java.lang.Object
  |
  +--scale.common.Machine
Direct Known Subclasses:
AlphaMachine, MipsMachine, PPCMachine, SparcMachine

public abstract class Machine
extends java.lang.Object

This is the base class for all machine specific information.

$Id: Machine.java,v 1.7 2002/01/03 21:44:38 burrill Exp $

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


Field Summary
protected  int aligned
           
static int ALIGNED
          Items in memory should be aligned on the proper boundary.
protected  int blockSize
           
protected  int cacheSize
           
static Machine currentMachine
          The current machine specification.
static int UNALIGNED
          Items in memory do not need to be aligned on the proper boundary.
 
Constructor Summary
Machine(int aligned)
          Create a Machine instance.
 
Method Summary
abstract  void addEDGCFlags(Vector v)
          Add the flags necessary for the EDG C front end.
abstract  int addressableMemoryUnits(int bitSize)
          Return the number of addressable units required
abstract  int alignData(int dataSize)
          Return the integer value alignmentthat satisfies
static int alignTo(int value, int to)
          Round up a value so that it is evenly divisible by the second value.
abstract  int generalAlignment()
          Return the most general purpose alignment in memory units.
 int getAligned()
          Return the alignment specified for the machine.
 int getCacheDistance(int typeSize)
           
abstract  boolean littleEndian()
          Return true if the machine is little-endian.
abstract  boolean simpleFloat(double value)
          Return true if it is faster to generate the floating point value than to load it.
abstract  boolean simpleInteger(long value)
          Return true if it is faster to generate the integer value than to load it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentMachine

public static Machine currentMachine
The current machine specification.

ALIGNED

public static final int ALIGNED
Items in memory should be aligned on the proper boundary.

UNALIGNED

public static final int UNALIGNED
Items in memory do not need to be aligned on the proper boundary.

aligned

protected int aligned

cacheSize

protected int cacheSize

blockSize

protected int blockSize
Constructor Detail

Machine

public Machine(int aligned)
Create a Machine instance.
Parameters:
aligned - == UNALIGNED if data alignment not required
Method Detail

getAligned

public int getAligned()
Return the alignment specified for the machine.

alignData

public abstract int alignData(int dataSize)
Return the integer value alignmentthat satisfies
 0 == address % alignment
 
for the data size specified.
Parameters:
dataSize - is the size of the data in addressable units.

addressableMemoryUnits

public abstract int addressableMemoryUnits(int bitSize)
Return the number of addressable units required
Parameters:
bitSize - is the number of bits required for the data

simpleInteger

public abstract boolean simpleInteger(long value)
Return true if it is faster to generate the integer value than to load it.

simpleFloat

public abstract boolean simpleFloat(double value)
Return true if it is faster to generate the floating point value than to load it.

alignTo

public static int alignTo(int value,
                          int to)
Round up a value so that it is evenly divisible by the second value.
Parameters:
value - - returned rounded up
to - - specifies the divisor
Returns:
value rounded up

addEDGCFlags

public abstract void addEDGCFlags(Vector v)
Add the flags necessary for the EDG C front end.

generalAlignment

public abstract int generalAlignment()
Return the most general purpose alignment in memory units.

littleEndian

public abstract boolean littleEndian()
Return true if the machine is little-endian.

getCacheDistance

public int getCacheDistance(int typeSize)