Re: Count Leading Zeros (cntlzw)
- From: Lars <lbg_@xxxxxxxxxxxx>
- Date: Mon, 29 Aug 2005 19:33:20 +0200
Kostas wrote:
I wanted to use this function -which is part of the PowerPC assembly language- in a x86 architecture (prefered an Athlon). This function calculates the leading zeros of a word. I need this function to be really fast, so i thought to ask the basm group :)
How should it be best implemented in order to be best optimised?
As others mention that the 80x86 has the BSR.
But you wanted a fast function ;-)
If you are running on a AMD Athlon cpu you are pretty safe with BSR
But some of the intel cpu are pretty bad :-(
From http://www.azillionmonkeys.com/qed/pentopt.html
^^BSF and BSR are the poorest optimized instructions on the PPlain and PMMX
and
from http://www.codecomments.com/A86_Assembler/message203346.html
^^ 486 - fast ^^ Pent - terribly slow ^^ PIII - very fast ^^ P4 - slow
Regards Lars .
- References:
- Count Leading Zeros (cntlzw)
- From: Kostas
- Count Leading Zeros (cntlzw)
- Prev by Date: Re: Count Leading Zeros (cntlzw)
- Next by Date: Re: Count Leading Zeros (cntlzw)
- Previous by thread: Re: Count Leading Zeros (cntlzw)
- Next by thread: Re: Count Leading Zeros (cntlzw)
- Index(es):
Relevant Pages
|