From b560acfe17b5898d0c68715f9d1cb7e1dd1f006f Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Mon, 27 Jul 2009 00:52:59 -0700 Subject: ARM: Fix the CLZ instruction. --- src/arch/arm/isa/decoder.isa | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/arch/arm/isa') 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 { -- cgit v1.2.3