bsr-algorithm?
- From: spamtrap <spamtrap@xxxxxxxxxx>
- Date: Wed, 21 May 2008 09:46:06 -0700 (PDT)
Hy;
I saw the discussion about the popcnt, and it reminded me of my own
search of a solution to this function:
/* first-bit position */
static int __fastcall fbpos(short int e) {
__asm {
/* handle '0'-case */
__asm xor eax, eax
__asm dec ax
__asm bsr ax, cx
};
}
but in MMX/XMMX.
I didn't find any slight dicussion of 'emulating' lzcnt or bsr at all,
and the solutions I could think of are very unsmart and probably
slower than sequencially transfering the data into GPRs and do the bsr
there.
I think on AltiVec helps the permutation-op, that we don't have on
x86.
Anybody got an idea about a branch-free 'emulation' of bsr?
Ciao
Niels
.
- Follow-Ups:
- Re: bsr-algorithm?
- From: Jacek Wawrzaszek
- Re: bsr-algorithm?
- From: Terje Mathisen
- Re: bsr-algorithm?
- Prev by Date: Re: Simulator for x486
- Next by Date: Re: bsr-algorithm?
- Previous by thread: linuxassembly (italian book) I will not allow more than follow the work.
- Next by thread: Re: bsr-algorithm?
- Index(es):
Relevant Pages
|