regop.isa (6442:580a6fbc7585) regop.isa (6443:fa4e81c993d0)
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

--- 686 unchanged lines hidden (view full) ---

695 '''
696
697 class Sra(RegOp):
698 code = '''
699 uint8_t shiftAmt = (op2 & ((dataSize == 8) ? mask(6) : mask(5)));
700 // Because what happens to the bits shift -in- on a right shift
701 // is not defined in the C/C++ standard, we have to sign extend
702 // them manually to be sure.
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

--- 686 unchanged lines hidden (view full) ---

695 '''
696
697 class Sra(RegOp):
698 code = '''
699 uint8_t shiftAmt = (op2 & ((dataSize == 8) ? mask(6) : mask(5)));
700 // Because what happens to the bits shift -in- on a right shift
701 // is not defined in the C/C++ standard, we have to sign extend
702 // them manually to be sure.
703 uint64_t arithMask =
703 uint64_t arithMask = (shiftAmt == 0) ? 0 :
704 -bits(psrc1, dataSize * 8 - 1) << (dataSize * 8 - shiftAmt);
705 DestReg = merge(DestReg, (psrc1 >> shiftAmt) | arithMask, dataSize);
706 '''
707 flag_code = '''
708 // If the shift amount is zero, no flags should be modified.
709 if (shiftAmt) {
710 //Zero out any flags we might modify. This way we only have to
711 //worry about setting them.

--- 594 unchanged lines hidden ---
704 -bits(psrc1, dataSize * 8 - 1) << (dataSize * 8 - shiftAmt);
705 DestReg = merge(DestReg, (psrc1 >> shiftAmt) | arithMask, dataSize);
706 '''
707 flag_code = '''
708 // If the shift amount is zero, no flags should be modified.
709 if (shiftAmt) {
710 //Zero out any flags we might modify. This way we only have to
711 //worry about setting them.

--- 594 unchanged lines hidden ---