forked from len0rd/rockbox
Smaller & faster (on our targets) fixed point exp() with a multiplication.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10454 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
737e4768a1
commit
f212e6cf5f
1 changed files with 1 additions and 9 deletions
|
@ -226,15 +226,7 @@ static int exp_s16p16(int x)
|
|||
t = x - 0x007e1; if (t >= 0) x = t, y += y >> 5;
|
||||
t = x - 0x003f8; if (t >= 0) x = t, y += y >> 6;
|
||||
t = x - 0x001fe; if (t >= 0) x = t, y += y >> 7;
|
||||
if (x & 0x100) y += y >> 8;
|
||||
if (x & 0x080) y += y >> 9;
|
||||
if (x & 0x040) y += y >> 10;
|
||||
if (x & 0x020) y += y >> 11;
|
||||
if (x & 0x010) y += y >> 12;
|
||||
if (x & 0x008) y += y >> 13;
|
||||
if (x & 0x004) y += y >> 14;
|
||||
if (x & 0x002) y += y >> 15;
|
||||
if (x & 0x001) y += y >> 16;
|
||||
y += ((y >> 8) * x) >> 8;
|
||||
|
||||
return y;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue