summaryrefslogtreecommitdiff
path: root/src/arch/x86/insts
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2007-09-13 16:35:41 -0700
committerGabe Black <gblack@eecs.umich.edu>2007-09-13 16:35:41 -0700
commitbbc8a40857d47348753c59b91a93dd312fa1b809 (patch)
tree4407880abed5d0238276e6c0bdef6d00673e561f /src/arch/x86/insts
parent534c6a800ade5499bf37a896993ab86488b6654c (diff)
downloadgem5-bbc8a40857d47348753c59b91a93dd312fa1b809.tar.xz
X86: Fix how ECF is computed in genFlags, and get rid of some duplicate code.
--HG-- extra : convert_revision : f86330a5a9fea782ee63aaa18ca964fb6f9cef0b
Diffstat (limited to 'src/arch/x86/insts')
-rw-r--r--src/arch/x86/insts/microregop.cc14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/arch/x86/insts/microregop.cc b/src/arch/x86/insts/microregop.cc
index b6a30d6a7..ad48a4bc1 100644
--- a/src/arch/x86/insts/microregop.cc
+++ b/src/arch/x86/insts/microregop.cc
@@ -68,17 +68,15 @@ namespace X86ISA
{
DPRINTF(Sparc, "flagMask = %#x\n", flagMask);
uint64_t flags = oldFlags & ~flagMask;
- if(flagMask & CFBit)
+ if(flagMask & (ECFBit | CFBit))
{
if(findCarry(dataSize*8, _dest, _src1, _src2))
- flags |= CFBit;
+ flags |= (flagMask & (ECFBit | CFBit));
if(subtract)
- flags ^= CFBit;
+ flags ^= (flagMask & (ECFBit | CFBit));
}
if(flagMask & PFBit && findParity(dataSize*8, _dest))
flags |= PFBit;
- if(flagMask & ECFBit && findCarry(dataSize*8, _dest, _src1, _src2))
- flags |= ECFBit;
if(flagMask & AFBit)
{
if(findCarry(4, _dest, _src1, _src2))
@@ -86,10 +84,8 @@ namespace X86ISA
if(subtract)
flags ^= AFBit;
}
- if(flagMask & EZFBit && findZero(dataSize*8, _dest))
- flags |= EZFBit;
- if(flagMask & ZFBit && findZero(dataSize*8, _dest))
- flags |= ZFBit;
+ if(flagMask & (EZFBit | ZFBit) && findZero(dataSize*8, _dest))
+ flags |= (flagMask & (EZFBit | ZFBit));
if(flagMask & SFBit && findNegative(dataSize*8, _dest))
flags |= SFBit;
if(flagMask & OFBit && findOverflow(dataSize*8, _dest, _src1, _src2))