flag_code = '''
//Don't have genFlags handle the OF or CF bits
uint64_t mask = CFBit | ECFBit | OFBit;
- uint64_t newFlags = genFlags(ccFlagBits | ezfBit, ext & ~mask,
- result, psrc1, op2);
+ uint64_t newFlags = genFlags(ccFlagBits | dfBit | ezfBit,
+ ext & ~mask, result, psrc1, op2);
ezfBit = newFlags & EZFBit;
+ dfBit = newFlags & DFBit;
ccFlagBits = newFlags & ccFlagMask;
//If a logic microop wants to set these, it wants to set them to 0.
class FlagRegOp(RegOp):
abstract = True
flag_code = '''
- uint64_t newFlags = genFlags(ccFlagBits | cfofBits | ecfBit |
- ezfBit, ext, result, psrc1, op2);
+ uint64_t newFlags = genFlags(ccFlagBits | cfofBits | dfBit |
+ ecfBit | ezfBit, ext, result, psrc1, op2);
cfofBits = newFlags & cfofMask;
ecfBit = newFlags & ECFBit;
ezfBit = newFlags & EZFBit;
+ dfBit = newFlags & DFBit;
ccFlagBits = newFlags & ccFlagMask;
'''
class SubRegOp(RegOp):
abstract = True
flag_code = '''
- uint64_t newFlags = genFlags(ccFlagBits | cfofBits | ecfBit |
- ezfBit, ext, result, psrc1, ~op2, true);
+ uint64_t newFlags = genFlags(ccFlagBits | cfofBits | dfBit |
+ ecfBit | ezfBit, ext, result, psrc1,
+ ~op2, true);
cfofBits = newFlags & cfofMask;
ecfBit = newFlags & ECFBit;
ezfBit = newFlags & EZFBit;
+ dfBit = newFlags & DFBit;
ccFlagBits = newFlags & ccFlagMask;
'''
class CondRegOp(RegOp):
abstract = True
- cond_check = "checkCondition(ccFlagBits | cfofBits | ecfBit | ezfBit, \
- ext)"
+ cond_check = "checkCondition(ccFlagBits | cfofBits | dfBit | ecfBit | \
+ ezfBit, ext)"
cond_control_flag_init = "flags[IsCondControl] = flags[IsControl];"
class RdRegOp(RegOp):
cfofBits = cfofBits | OFBit;
//Use the regular mechanisms to calculate the other flags.
- uint64_t newFlags = genFlags(ccFlagBits | ezfBit,
+ uint64_t newFlags = genFlags(ccFlagBits | dfBit | ezfBit,
ext & ~(CFBit | ECFBit | OFBit), DestReg, psrc1, op2);
ezfBit = newFlags & EZFBit;
+ dfBit = newFlags & DFBit;
ccFlagBits = newFlags & ccFlagMask;
}
'''
cfofBits = cfofBits | OFBit;
//Use the regular mechanisms to calculate the other flags.
- uint64_t newFlags = genFlags(ccFlagBits | ezfBit,
+ uint64_t newFlags = genFlags(ccFlagBits | dfBit | ezfBit,
ext & ~(CFBit | ECFBit | OFBit), DestReg, psrc1, op2);
ezfBit = newFlags & EZFBit;
+ dfBit = newFlags & DFBit;
ccFlagBits = newFlags & ccFlagMask;
}
'''
}
//Use the regular mechanisms to calculate the other flags.
- uint64_t newFlags = genFlags(ccFlagBits | ezfBit,
+ uint64_t newFlags = genFlags(ccFlagBits | dfBit | ezfBit,
ext & ~(CFBit | ECFBit | OFBit), DestReg, psrc1, op2);
ezfBit = newFlags & EZFBit;
+ dfBit = newFlags & DFBit;
ccFlagBits = newFlags & ccFlagMask;
}
'''
cfofBits = cfofBits | OFBit;
//Use the regular mechanisms to calculate the other flags.
- uint64_t newFlags = genFlags(ccFlagBits | ezfBit,
+ uint64_t newFlags = genFlags(ccFlagBits | dfBit | ezfBit,
ext & ~(CFBit | ECFBit | OFBit), DestReg, psrc1, op2);
ezfBit = newFlags & EZFBit;
+ dfBit = newFlags & DFBit;
ccFlagBits = newFlags & ccFlagMask;
}
'''
}
//Use the regular mechanisms to calculate the other flags.
- uint64_t newFlags = genFlags(ccFlagBits | ezfBit,
+ uint64_t newFlags = genFlags(ccFlagBits | dfBit | ezfBit,
ext & ~(CFBit | ECFBit | OFBit), DestReg, psrc1, op2);
ezfBit = newFlags & EZFBit;
+ dfBit = newFlags & DFBit;
ccFlagBits = newFlags & ccFlagMask;
}
'''
cfofBits = cfofBits | OFBit;
//Use the regular mechanisms to calculate the other flags.
- uint64_t newFlags = genFlags(ccFlagBits | ezfBit,
+ uint64_t newFlags = genFlags(ccFlagBits | dfBit | ezfBit,
ext & ~(CFBit | ECFBit | OFBit), DestReg, psrc1, op2);
ezfBit = newFlags & EZFBit;
+ dfBit = newFlags & DFBit;
ccFlagBits = newFlags & ccFlagMask;
}
'''
cfofBits = cfofBits | OFBit;
//Use the regular mechanisms to calculate the other flags.
- uint64_t newFlags = genFlags(ccFlagBits | ezfBit,
+ uint64_t newFlags = genFlags(ccFlagBits | dfBit | ezfBit,
ext & ~(CFBit | ECFBit | OFBit), DestReg, psrc1, op2);
ezfBit = newFlags & EZFBit;
+ dfBit = newFlags & DFBit;
ccFlagBits = newFlags & ccFlagMask;
}
'''
cfofBits = cfofBits | OFBit;
//Use the regular mechanisms to calculate the other flags.
- uint64_t newFlags = genFlags(ccFlagBits | ezfBit,
+ uint64_t newFlags = genFlags(ccFlagBits | dfBit | ezfBit,
ext & ~(CFBit | ECFBit | OFBit), DestReg, psrc1, op2);
ezfBit = newFlags & EZFBit;
+ dfBit = newFlags & DFBit;
ccFlagBits = newFlags & ccFlagMask;
}
'''
cfofBits = cfofBits | OFBit;
//Use the regular mechanisms to calculate the other flags.
- uint64_t newFlags = genFlags(ccFlagBits | ezfBit,
+ uint64_t newFlags = genFlags(ccFlagBits | dfBit | ezfBit,
ext & ~(CFBit | ECFBit | OFBit), DestReg, psrc1, op2);
ezfBit = newFlags & EZFBit;
+ dfBit = newFlags & DFBit;
ccFlagBits = newFlags & ccFlagMask;
}
'''
cfofBits = newFlags & cfofMask;
ecfBit = newFlags & ECFBit;
ezfBit = newFlags & EZFBit;
+ dfBit = newFlags & DFBit;
ccFlagBits = newFlags & ccFlagMask;
'''
// Get only the user flags
ccFlagBits = newFlags & ccFlagMask;
+ dfBit = newFlags & DFBit;
cfofBits = newFlags & cfofMask;
ecfBit = 0;
ezfBit = 0;
code = 'DestReg = NRIP - CSBase;'
class Ruflags(RdRegOp):
- code = 'DestReg = ccFlagBits | cfofBits | ecfBit | ezfBit;'
+ code = 'DestReg = ccFlagBits | cfofBits | dfBit | ecfBit | ezfBit;'
class Rflags(RdRegOp):
code = '''
- DestReg = ccFlagBits | cfofBits | ecfBit | ezfBit | nccFlagBits;
+ DestReg = ccFlagBits | cfofBits | dfBit |
+ ecfBit | ezfBit | nccFlagBits;
'''
class Ruflag(RegOp):
code = '''
- int flag = bits(ccFlagBits | cfofBits | ecfBit | ezfBit, imm8);
+ int flag = bits(ccFlagBits | cfofBits | dfBit |
+ ecfBit | ezfBit, imm8);
DestReg = merge(DestReg, flag, dataSize);
ezfBit = (flag == 0) ? EZFBit : 0;
'''
big_code = '''
- int flag = bits(ccFlagBits | cfofBits | ecfBit | ezfBit, imm8);
+ int flag = bits(ccFlagBits | cfofBits | dfBit |
+ ecfBit | ezfBit, imm8);
DestReg = flag & mask(dataSize * 8);
ezfBit = (flag == 0) ? EZFBit : 0;
'''
class Rflag(RegOp):
code = '''
MiscReg flagMask = 0x3F7FDD5;
- MiscReg flags = (nccFlagBits | ccFlagBits | cfofBits |
+ MiscReg flags = (nccFlagBits | ccFlagBits | cfofBits | dfBit |
ecfBit | ezfBit) & flagMask;
int flag = bits(flags, imm8);
big_code = '''
MiscReg flagMask = 0x3F7FDD5;
- MiscReg flags = (nccFlagBits | ccFlagBits | cfofBits |
+ MiscReg flags = (nccFlagBits | ccFlagBits | cfofBits | dfBit |
ecfBit | ezfBit) & flagMask;
int flag = bits(flags, imm8);