summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2009-07-27 00:52:59 -0700
committerGabe Black <gblack@eecs.umich.edu>2009-07-27 00:52:59 -0700
commitb560acfe17b5898d0c68715f9d1cb7e1dd1f006f (patch)
tree5d47a5528cdfa2a7118214d5fe8c977f3a1a4a33
parentdc0df3f3966b3d4a5ff313007b44fb4b428a70d9 (diff)
downloadgem5-b560acfe17b5898d0c68715f9d1cb7e1dd1f006f.tar.xz
ARM: Fix the CLZ instruction.
-rw-r--r--src/arch/arm/isa/decoder.isa3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/arch/arm/isa/decoder.isa b/src/arch/arm/isa/decoder.isa
index f43395c19..046e52950 100644
--- a/src/arch/arm/isa/decoder.isa
+++ b/src/arch/arm/isa/decoder.isa
@@ -113,8 +113,7 @@ format DataOp {
0x1: decode OPCODE {
0x9: BranchExchange::bx({{ }});
0xb: PredOp::clz({{
- unsigned lsb = findLsbSet(Rm);
- Rd = (lsb > 31) ? 32 : lsb;
+ Rd = ((Rm == 0) ? 32 : (31 - findMsbSet(Rm)));
}});
}
0x2: decode OPCODE {