7 clz – ARM VERSION 1.2 User Manual

Page 148

Advertising
background image

ARM Instruction Reference

4-38

Copyright © 2000, 2001 ARM Limited. All rights reserved.

ARM DUI 0068B

4.3.7

CLZ

Count Leading Zeroes.

Syntax

CLZ{cond} Rd, Rm

where:

cond

is an optional condition code (see Conditional execution on page 4-4).

Rd

is the ARM register for the result.

Rd

must not be r15.

Rm

is the operand register.

Usage

The

CLZ

instruction counts the number of leading zeroes in the value in

Rm

and returns

the result in

Rd

. The result value is 32 if no bits are set in the source register, and zero if

bit 31 is set.

Condition flags

This instruction does not affect the flags.

Architectures

This instruction is available in ARM architecture versions 5 and above.

Examples

CLZ r4,r9
CLZNE r2,r3

Advertising