From: Gabe Black Date: Mon, 27 Jul 2009 07:52:59 +0000 (-0700) Subject: ARM: Fix the CLZ instruction. X-Git-Tag: Calvin_Submission~194^2~22 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b560acfe17b5898d0c68715f9d1cb7e1dd1f006f;p=gem5.git ARM: Fix the CLZ instruction. --- 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 {