regop.isa (6444:8e72cf8196cc) | regop.isa (6446:cc8568cfce8f) |
---|---|
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 --- 782 unchanged lines hidden (view full) --- 791 DestReg, psrc1, op2); 792 } 793 ''' 794 795 class Rol(RegOp): 796 code = ''' 797 uint8_t shiftAmt = 798 (op2 & ((dataSize == 8) ? mask(6) : mask(5))); | 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 --- 782 unchanged lines hidden (view full) --- 791 DestReg, psrc1, op2); 792 } 793 ''' 794 795 class Rol(RegOp): 796 code = ''' 797 uint8_t shiftAmt = 798 (op2 & ((dataSize == 8) ? mask(6) : mask(5))); |
799 if(shiftAmt) | 799 uint8_t realShiftAmt = shiftAmt % (dataSize * 8); 800 if(realShiftAmt) |
800 { | 801 { |
801 uint64_t top = psrc1 << shiftAmt; | 802 uint64_t top = psrc1 << realShiftAmt; |
802 uint64_t bottom = | 803 uint64_t bottom = |
803 bits(psrc1, dataSize * 8 - 1, dataSize * 8 - shiftAmt); | 804 bits(psrc1, dataSize * 8 - 1, dataSize * 8 - realShiftAmt); |
804 DestReg = merge(DestReg, top | bottom, dataSize); 805 } 806 else 807 DestReg = DestReg; 808 ''' 809 flag_code = ''' 810 // If the shift amount is zero, no flags should be modified. 811 if (shiftAmt) { --- 498 unchanged lines hidden --- | 805 DestReg = merge(DestReg, top | bottom, dataSize); 806 } 807 else 808 DestReg = DestReg; 809 ''' 810 flag_code = ''' 811 // If the shift amount is zero, no flags should be modified. 812 if (shiftAmt) { --- 498 unchanged lines hidden --- |