diff options
Diffstat (limited to 'src/arch')
-rw-r--r-- | src/arch/arm/isa/decoder.isa | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/arch/arm/isa/decoder.isa b/src/arch/arm/isa/decoder.isa index 9d2c90b4c..8c9f7aa50 100644 --- a/src/arch/arm/isa/decoder.isa +++ b/src/arch/arm/isa/decoder.isa @@ -270,18 +270,8 @@ format DataOp { 0x1: decode OPCODE { 0x9: BranchExchange::bx({{ }}); 0xb: PredOp::clz({{ - if (Rm == 0) - Rd = 32; - else - { - int i; - for (i = 0; i < 32; i++) - { - if (Rm & (1<<(31-i))) - break; - } - Rd = i; - } + unsigned lsb = findLsbSet(Rm); + Rd = (lsb > 31) ? 32 : lsb; }}); } 0x2: decode OPCODE { |