Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 13 Next »

Description

Counts the number of contiguous, most-significant, leading zero bits in a data value. If available on the targeted architecture an alternate optimized implementation can be defined.

Files

cpu_core.h/cpu_core.c / Specific CPU/compiler cpu_a.asm

Prototypes

Arguments

val

Data value to count leading zero bits.

Returned Value

Number of contiguous, most-significant, leading zero bits in val.

Required Configuration

CPU_CntLeadZeros()is available and implemented in cpu_core.c if CPU_CFG_LEAD_ZEROS_ASM_PRESENT is not #define'd in cpu_cfg.h (or cpu.h), but should be implemented in cpu_a.asm (or cpu_a.s) if CPU_CFG_LEAD_ZEROS_ASM_PRESENT is #define'd in cpu_cfg.h (or cpu.h). Refer to Core Library Configuration for details.

Each CPU_CntLeadZerosXX() is available and implemented in cpu_core.c based on CPU_CFG_DATA_SIZE_MAX configuration as #define'd in cpu.h :

Functions available according to CPU_CFG_DATA_SIZE_MAX:

CPU_CntLeadZero08() = CPU_WORD_SIZE_08
CPU_CntLeadZero16() = CPU_WORD_SIZE_16
CPU_CntLeadZero32() = CPU_WORD_SIZE_32
CPU_CntLeadZero64() = CPU_WORD_SIZE_64

Notes / Warnings

None.

Example Usage

  • No labels