dioscuri.module.cpu32
Class FpuState64

java.lang.Object
  extended by dioscuri.module.cpu32.FpuState
      extended by dioscuri.module.cpu32.FpuState64
All Implemented Interfaces:
Hibernatable

public class FpuState64
extends FpuState

Author:
Bram Lohman, Bart Kiers

Field Summary
static int FPU_SPECIAL_TAG_DENORMAL
           
static int FPU_SPECIAL_TAG_INFINITY
           
static int FPU_SPECIAL_TAG_NAN
           
static int FPU_SPECIAL_TAG_NONE
           
static int FPU_SPECIAL_TAG_SNAN
           
static int FPU_SPECIAL_TAG_UNSUPPORTED
           
static double UNDERFLOW_THRESHOLD
           
 
Fields inherited from class dioscuri.module.cpu32.FpuState
conditionCode, FPU_PRECISION_CONTROL_DOUBLE, FPU_PRECISION_CONTROL_EXTENDED, FPU_PRECISION_CONTROL_SINGLE, FPU_ROUNDING_CONTROL_DOWN, FPU_ROUNDING_CONTROL_EVEN, FPU_ROUNDING_CONTROL_TRUNCATE, FPU_ROUNDING_CONTROL_UP, FPU_TAG_EMPTY, FPU_TAG_SPECIAL, FPU_TAG_VALID, FPU_TAG_ZERO, infinityControl, lastData, lastIP, lastOpcode, STACK_DEPTH, top
 
Constructor Summary
FpuState64(Processor owner)
           
 
Method Summary
 void checkExceptions()
           
 void clearExceptions()
           
static byte[] doubleToExtended(double x, boolean isSignalNaN)
           
 void dumpState(java.io.DataOutput output)
           
static double extendedToDouble(byte[] b)
           
 boolean getBusy()
           
 int getControl()
           
 boolean getDenormalizedOperand()
           
 boolean getDenormalizedOperandMask()
           
 boolean getErrorSummaryStatus()
           
 boolean getInvalidOperation()
           
 boolean getInvalidOperationMask()
           
 boolean getOverflow()
           
 boolean getOverflowMask()
           
 boolean getPrecision()
           
 int getPrecisionControl()
           
 boolean getPrecisionMask()
           
 int getRoundingControl()
           
 int getSpecialTag(int index)
           
 boolean getStackFault()
           
 int getStatus()
           
 int getTag(int index)
           
 int getTagWord()
           
 boolean getUnderflow()
           
 boolean getUnderflowMask()
           
 boolean getZeroDivide()
           
 boolean getZeroDivideMask()
           
 void init()
           
static boolean isDenormal(double x)
           
static boolean isSNaN(long n)
           
 void loadState(java.io.DataInput input)
           
 double pop()
           
 void push(double x)
           
 void setAllMasks(boolean value)
           
 void setControl(int w)
           
 void setDenormalizedOperand()
           
 void setDenormalizedOperandMask(boolean value)
           
 void setInvalidOperation()
           
 void setInvalidOperationMask(boolean value)
           
 void setOverflow()
           
 void setOverflowMask(boolean value)
           
 void setPrecision()
           
 void setPrecisionControl(int value)
           
 void setPrecisionMask(boolean value)
           
 void setRoundingControl(int value)
           
 void setST(int index, double value)
           
 void setStackFault()
           
 void setStatus(int w)
           
 void setTagWord(int w)
           
 void setUnderflow()
           
 void setUnderflowMask(boolean value)
           
 void setZeroDivide()
           
 void setZeroDivideMask(boolean value)
           
static int specialTagCode(byte[] b)
           
static int specialTagCode(double x)
           
 double ST(int index)
           
 int tagCode(double x)
           
 
Methods inherited from class dioscuri.module.cpu32.FpuState
copyStateInto, equals, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FPU_SPECIAL_TAG_NONE

public static final int FPU_SPECIAL_TAG_NONE
See Also:
Constant Field Values

FPU_SPECIAL_TAG_NAN

public static final int FPU_SPECIAL_TAG_NAN
See Also:
Constant Field Values

FPU_SPECIAL_TAG_UNSUPPORTED

public static final int FPU_SPECIAL_TAG_UNSUPPORTED
See Also:
Constant Field Values

FPU_SPECIAL_TAG_INFINITY

public static final int FPU_SPECIAL_TAG_INFINITY
See Also:
Constant Field Values

FPU_SPECIAL_TAG_DENORMAL

public static final int FPU_SPECIAL_TAG_DENORMAL
See Also:
Constant Field Values

FPU_SPECIAL_TAG_SNAN

public static final int FPU_SPECIAL_TAG_SNAN
See Also:
Constant Field Values

UNDERFLOW_THRESHOLD

public static final double UNDERFLOW_THRESHOLD
Constructor Detail

FpuState64

public FpuState64(Processor owner)
Parameters:
owner -
Method Detail

dumpState

public void dumpState(java.io.DataOutput output)
               throws java.io.IOException
Specified by:
dumpState in class FpuState
Parameters:
output -
Throws:
java.io.IOException

loadState

public void loadState(java.io.DataInput input)
               throws java.io.IOException
Specified by:
loadState in class FpuState
Parameters:
input -
Throws:
java.io.IOException

getInvalidOperation

public boolean getInvalidOperation()
Specified by:
getInvalidOperation in class FpuState
Returns:
-

getDenormalizedOperand

public boolean getDenormalizedOperand()
Specified by:
getDenormalizedOperand in class FpuState
Returns:
-

getZeroDivide

public boolean getZeroDivide()
Specified by:
getZeroDivide in class FpuState
Returns:
-

getOverflow

public boolean getOverflow()
Specified by:
getOverflow in class FpuState
Returns:
-

getUnderflow

public boolean getUnderflow()
Specified by:
getUnderflow in class FpuState
Returns:
-

getPrecision

public boolean getPrecision()
Specified by:
getPrecision in class FpuState
Returns:
-

getStackFault

public boolean getStackFault()
Specified by:
getStackFault in class FpuState
Returns:
-

setInvalidOperation

public void setInvalidOperation()
Specified by:
setInvalidOperation in class FpuState

setDenormalizedOperand

public void setDenormalizedOperand()
Specified by:
setDenormalizedOperand in class FpuState

setZeroDivide

public void setZeroDivide()
Specified by:
setZeroDivide in class FpuState

setOverflow

public void setOverflow()
Specified by:
setOverflow in class FpuState

setUnderflow

public void setUnderflow()
Specified by:
setUnderflow in class FpuState

setPrecision

public void setPrecision()
Specified by:
setPrecision in class FpuState

setStackFault

public void setStackFault()
Specified by:
setStackFault in class FpuState

getBusy

public boolean getBusy()
Specified by:
getBusy in class FpuState
Returns:
-

getErrorSummaryStatus

public boolean getErrorSummaryStatus()
Specified by:
getErrorSummaryStatus in class FpuState
Returns:
-

checkExceptions

public void checkExceptions()
                     throws ProcessorException
Specified by:
checkExceptions in class FpuState
Throws:
ProcessorException

clearExceptions

public void clearExceptions()
Specified by:
clearExceptions in class FpuState

getInvalidOperationMask

public boolean getInvalidOperationMask()
Specified by:
getInvalidOperationMask in class FpuState
Returns:
-

getDenormalizedOperandMask

public boolean getDenormalizedOperandMask()
Specified by:
getDenormalizedOperandMask in class FpuState
Returns:
-

getZeroDivideMask

public boolean getZeroDivideMask()
Specified by:
getZeroDivideMask in class FpuState
Returns:
-

getOverflowMask

public boolean getOverflowMask()
Specified by:
getOverflowMask in class FpuState
Returns:
-

getUnderflowMask

public boolean getUnderflowMask()
Specified by:
getUnderflowMask in class FpuState
Returns:
-

getPrecisionMask

public boolean getPrecisionMask()
Specified by:
getPrecisionMask in class FpuState
Returns:
-

getPrecisionControl

public int getPrecisionControl()
Specified by:
getPrecisionControl in class FpuState
Returns:
-

getRoundingControl

public int getRoundingControl()
Specified by:
getRoundingControl in class FpuState
Returns:
-

setInvalidOperationMask

public void setInvalidOperationMask(boolean value)
Specified by:
setInvalidOperationMask in class FpuState
Parameters:
value -

setDenormalizedOperandMask

public void setDenormalizedOperandMask(boolean value)
Specified by:
setDenormalizedOperandMask in class FpuState
Parameters:
value -

setZeroDivideMask

public void setZeroDivideMask(boolean value)
Specified by:
setZeroDivideMask in class FpuState
Parameters:
value -

setOverflowMask

public void setOverflowMask(boolean value)
Specified by:
setOverflowMask in class FpuState
Parameters:
value -

setUnderflowMask

public void setUnderflowMask(boolean value)
Specified by:
setUnderflowMask in class FpuState
Parameters:
value -

setPrecisionMask

public void setPrecisionMask(boolean value)
Specified by:
setPrecisionMask in class FpuState
Parameters:
value -

setAllMasks

public void setAllMasks(boolean value)
Specified by:
setAllMasks in class FpuState
Parameters:
value -

setPrecisionControl

public void setPrecisionControl(int value)
Specified by:
setPrecisionControl in class FpuState
Parameters:
value -

setRoundingControl

public void setRoundingControl(int value)
Specified by:
setRoundingControl in class FpuState
Parameters:
value -

init

public void init()
Specified by:
init in class FpuState

tagCode

public int tagCode(double x)
Parameters:
x -
Returns:
-

isDenormal

public static boolean isDenormal(double x)
Parameters:
x -
Returns:
-

isSNaN

public static boolean isSNaN(long n)
Parameters:
n -
Returns:
-

specialTagCode

public static int specialTagCode(double x)
Parameters:
x -
Returns:
-

push

public void push(double x)
          throws ProcessorException
Specified by:
push in class FpuState
Parameters:
x -
Throws:
ProcessorException

pop

public double pop()
           throws ProcessorException
Specified by:
pop in class FpuState
Returns:
-
Throws:
ProcessorException

ST

public double ST(int index)
          throws ProcessorException
Specified by:
ST in class FpuState
Parameters:
index -
Returns:
-
Throws:
ProcessorException

getTag

public int getTag(int index)
Specified by:
getTag in class FpuState
Parameters:
index -
Returns:
-

getSpecialTag

public int getSpecialTag(int index)
Parameters:
index -
Returns:
-

setST

public void setST(int index,
                  double value)
Specified by:
setST in class FpuState
Parameters:
index -
value -

getStatus

public int getStatus()
Specified by:
getStatus in class FpuState
Returns:
-

setStatus

public void setStatus(int w)
Specified by:
setStatus in class FpuState
Parameters:
w -

getControl

public int getControl()
Specified by:
getControl in class FpuState
Returns:
-

setControl

public void setControl(int w)
Specified by:
setControl in class FpuState
Parameters:
w -

getTagWord

public int getTagWord()
Specified by:
getTagWord in class FpuState
Returns:
-

setTagWord

public void setTagWord(int w)
Specified by:
setTagWord in class FpuState
Parameters:
w -

doubleToExtended

public static byte[] doubleToExtended(double x,
                                      boolean isSignalNaN)
Parameters:
x -
isSignalNaN -
Returns:
-

specialTagCode

public static int specialTagCode(byte[] b)
Parameters:
b -
Returns:
-

extendedToDouble

public static double extendedToDouble(byte[] b)
Parameters:
b -
Returns:
-