summaryrefslogtreecommitdiff
path: root/src/arch/arm/insts/pred_inst.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/arm/insts/pred_inst.hh')
-rw-r--r--src/arch/arm/insts/pred_inst.hh7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/arch/arm/insts/pred_inst.hh b/src/arch/arm/insts/pred_inst.hh
index c5e2ab386..8a335879b 100644
--- a/src/arch/arm/insts/pred_inst.hh
+++ b/src/arch/arm/insts/pred_inst.hh
@@ -48,10 +48,11 @@
namespace ArmISA
{
static inline uint32_t
-rotate_imm(uint32_t immValue, int rotateValue)
+rotate_imm(uint32_t immValue, uint32_t rotateValue)
{
- return ((immValue >> (rotateValue & 31)) |
- (immValue << (32 - (rotateValue & 31))));
+ rotateValue &= 31;
+ return rotateValue == 0 ? immValue :
+ (immValue >> rotateValue) | (immValue << (32 - rotateValue));
}
static inline uint32_t