1// Copyright (c) 2007-2008 The Hewlett-Packard Development Company 2// All rights reserved. 3// 4// Redistribution and use of this software in source and binary forms, 5// with or without modification, are permitted provided that the 6// following conditions are met: 7// 8// The software must be used only for Non-Commercial Use which means any --- 634 unchanged lines hidden (view full) --- 643 flag_code = ''' 644 // If the shift amount is zero, no flags should be modified. 645 if (shiftAmt) { 646 //Zero out any flags we might modify. This way we only have to 647 //worry about setting them. 648 ccFlagBits = ccFlagBits & ~(ext & (CFBit | ECFBit | OFBit)); 649 int CFBits = 0; 650 //Figure out if we -would- set the CF bits if requested. |
651 if (shiftAmt <= dataSize * 8 && 652 bits(SrcReg1, dataSize * 8 - shiftAmt)) { |
653 CFBits = 1; |
654 } |
655 //If some combination of the CF bits need to be set, set them. 656 if ((ext & (CFBit | ECFBit)) && CFBits) 657 ccFlagBits = ccFlagBits | (ext & (CFBit | ECFBit)); 658 //Figure out what the OF bit should be. 659 if ((ext & OFBit) && (CFBits ^ bits(DestReg, dataSize * 8 - 1))) 660 ccFlagBits = ccFlagBits | OFBit; 661 //Use the regular mechanisms to calculate the other flags. 662 ccFlagBits = genFlags(ccFlagBits, ext & ~(CFBit | ECFBit | OFBit), --- 640 unchanged lines hidden --- |