microregop.cc (4693:ca44a1014212) | microregop.cc (4713:c208cec7b5b3) |
---|---|
1/* 2 * Copyright (c) 2007 The Hewlett-Packard Development Company 3 * All rights reserved. 4 * 5 * Redistribution and use of this software in source and binary forms, 6 * with or without modification, are permitted provided that the 7 * following conditions are met: 8 * --- 49 unchanged lines hidden (view full) --- 58#include "arch/x86/insts/microregop.hh" 59#include "arch/x86/miscregs.hh" 60#include "base/condcodes.hh" 61#include <string> 62 63namespace X86ISA 64{ 65 uint64_t RegOpBase::genFlags(uint64_t oldFlags, uint64_t flagMask, | 1/* 2 * Copyright (c) 2007 The Hewlett-Packard Development Company 3 * All rights reserved. 4 * 5 * Redistribution and use of this software in source and binary forms, 6 * with or without modification, are permitted provided that the 7 * following conditions are met: 8 * --- 49 unchanged lines hidden (view full) --- 58#include "arch/x86/insts/microregop.hh" 59#include "arch/x86/miscregs.hh" 60#include "base/condcodes.hh" 61#include <string> 62 63namespace X86ISA 64{ 65 uint64_t RegOpBase::genFlags(uint64_t oldFlags, uint64_t flagMask, |
66 uint64_t _dest, uint64_t _src1, uint64_t _src2) const | 66 uint64_t _dest, uint64_t _src1, uint64_t _src2, 67 bool subtract) const |
67 { | 68 { |
69 DPRINTF(Sparc, "flagMask = %#x\n", flagMask); |
|
68 uint64_t flags = oldFlags & ~flagMask; | 70 uint64_t flags = oldFlags & ~flagMask; |
69 if(flagMask & CFBit && findCarry(dataSize, _dest, _src1, _src2)) 70 flags |= CFBit; 71 if(flagMask & PFBit && findParity(dataSize, _dest)) | 71 if(flagMask & CFBit) 72 if(findCarry(dataSize*8, _dest, _src1, _src2)) 73 flags |= CFBit; 74 if(subtract) 75 flags ^= CFBit; 76 if(flagMask & PFBit && findParity(dataSize*8, _dest)) |
72 flags |= PFBit; | 77 flags |= PFBit; |
73 if(flagMask & ECFBit && findCarry(dataSize, _dest, _src1, _src2)) | 78 if(flagMask & ECFBit && findCarry(dataSize*8, _dest, _src1, _src2)) |
74 flags |= ECFBit; | 79 flags |= ECFBit; |
75 if(flagMask & AFBit && findCarry(4, _dest, _src1, _src2)) 76 flags |= AFBit; 77 if(flagMask & EZFBit && findZero(dataSize, _dest)) | 80 if(flagMask & AFBit) 81 if(findCarry(4, _dest, _src1, _src2)) 82 flags |= AFBit; 83 if(subtract) 84 flags ^= AFBit; 85 if(flagMask & EZFBit && findZero(dataSize*8, _dest)) |
78 flags |= EZFBit; | 86 flags |= EZFBit; |
79 if(flagMask & ZFBit && findZero(dataSize, _dest)) | 87 if(flagMask & ZFBit && findZero(dataSize*8, _dest)) |
80 flags |= ZFBit; | 88 flags |= ZFBit; |
81 if(flagMask & SFBit && findNegative(dataSize, _dest)) | 89 if(flagMask & SFBit && findNegative(dataSize*8, _dest)) |
82 flags |= SFBit; | 90 flags |= SFBit; |
83 if(flagMask & OFBit && findOverflow(dataSize, _dest, _src1, _src2)) | 91 if(flagMask & OFBit && findOverflow(dataSize*8, _dest, _src1, _src2)) |
84 flags |= OFBit; 85 return flags; 86 } 87 88 bool RegOpBase::checkCondition(uint64_t flags) const 89 { 90 CCFlagBits ccflags = flags; 91 switch(ext) --- 97 unchanged lines hidden --- | 92 flags |= OFBit; 93 return flags; 94 } 95 96 bool RegOpBase::checkCondition(uint64_t flags) const 97 { 98 CCFlagBits ccflags = flags; 99 switch(ext) --- 97 unchanged lines hidden --- |