Re: Count Leading Zeros (cntlzw)



Kostas wrote:

How should it be best implemented in order to be best optimised?


function cntlzw(const v: Longword): Longword;
asm
    MOV    EDX, 00000020h
    BSF    EAX, EAX
    CMOVZ  EAX, EDX
end;


-- Regards Torjei Kvinen .