else if(FpSrcReg1 == FpSrcReg2)
ccFlagBits = ccFlagBits | ZFBit;
'''
+
+ class absfp(FpUnaryOp):
+ code = 'FpDestReg = fabs(FpSrcReg1);'
+ flag_code = 'FSW &= (~CC1Bit);'
+
+ class chsfp(FpUnaryOp):
+ code = 'FpDestReg = (-1) * (FpSrcReg1);'
+ flag_code = 'FSW &= (~CC1Bit);'
}};
# These register should needs to be more protected so that later
# instructions don't map their indexes with an old value.
'nccFlagBits': controlReg('MISCREG_RFLAGS', 65),
+
+ # Registers related to the state of x87 floating point unit.
'TOP': controlReg('MISCREG_X87_TOP', 66, ctype='ub'),
+ 'FSW': controlReg('MISCREG_FSW', 67, ctype='uw'),
+
# The segment base as used by memory instructions.
'SegBase': controlReg('MISCREG_SEG_EFF_BASE(segment)', 70),
IDBit = 1 << 21
};
+ enum X87StatusBit {
+ // Exception Flags
+ IEBit = 1 << 0,
+ DEBit = 1 << 1,
+ ZEBit = 1 << 2,
+ OEBit = 1 << 3,
+ UEBit = 1 << 4,
+ PEBit = 1 << 5,
+
+ // !Exception Flags
+ StackFaultBit = 1 << 6,
+ ErrSummaryBit = 1 << 7,
+ CC0Bit = 1 << 8,
+ CC1Bit = 1 << 9,
+ CC2Bit = 1 << 10,
+ CC3Bit = 1 << 14,
+ BusyBit = 1 << 15,
+ };
+
enum MiscRegIndex
{
// Control registers